{"id":14830,"library":"pyjslint","title":"pyjslint - JSLint Wrapper","description":"pyjslint is a Python wrapper for JSLint, designed to integrate JavaScript linting into Python projects. It bundles an old version of JSLint and appears to be unmaintained. The current version is 0.3.4, released in 2013, indicating an abandoned project.","status":"abandoned","version":"0.3.4","language":"en","source_language":"en","source_url":"https://github.com/Yaco-Sistemas/pyjslint/","tags":["linting","javascript","jslint","static-analysis","abandoned-project"],"install":[{"cmd":"pip install pyjslint","lang":"bash","label":"Install pyjslint"}],"dependencies":[],"imports":[{"note":"The `PyJsLint` class is located within a submodule named `pyjslint` inside the top-level package, requiring the double `pyjslint` in the import path.","wrong":"from pyjslint import PyJsLint","symbol":"PyJsLint","correct":"from pyjslint.pyjslint import PyJsLint"}],"quickstart":{"code":"from pyjslint.pyjslint import PyJsLint\n\n# Example JavaScript code to lint\ncode_to_lint = \"\"\"\nvar a = 1;\nvar b = 2;\nvar c = a + b // Missing semicolon, will be flagged\n\"\"\"\n\n# Initialize the linter\nlinter = PyJsLint()\n\n# Lint the code\nresult = linter.lint(code_to_lint)\n\nif result:\n    print(\"Linting errors found:\")\n    for error in result:\n        print(f\"  Line {error.get('line')}, Character {error.get('character')}: {error.get('reason')}\")\nelse:\n    print(\"No linting errors.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize `PyJsLint` and use its `lint()` method to analyze a string of JavaScript code. The method returns a list of error dictionaries or `None` if no errors are found."},"warnings":[{"fix":"This library is not suitable for modern development. Consider using actively maintained JavaScript linters like ESLint (run via subprocess or a dedicated Python wrapper if available) or other static analysis tools for JavaScript.","message":"Project is abandoned and unmaintained since 2013. Expect no new features, bug fixes, or compatibility updates.","severity":"breaking","affected_versions":"All versions"},{"fix":"There is no direct fix within this library. For linting modern JavaScript, you must use an external, up-to-date linter like ESLint.","message":"The bundled JSLint version is severely outdated (from 2013 or earlier). It will not understand modern JavaScript syntax (ES6+, ES2015+) and its linting rules are not configurable to modern standards.","severity":"gotcha","affected_versions":"All versions"},{"fix":"The library was likely written for Python 2.x. While it might run on some Python 3 environments, expect potential `SyntaxError` (e.g., `print` statement vs. function), `TypeError` (e.g., string handling), or other runtime errors. Thorough testing on your target Python 3 version is crucial, but migration to a modern tool is highly recommended.","message":"Potential Python 3 compatibility issues. The package was released when Python 2 was prevalent, and it has `requires_python: None`.","severity":"gotcha","affected_versions":"All Python 3.x versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"The class is nested within a submodule. Change `from pyjslint import PyJsLint` to `from pyjslint.pyjslint import PyJsLint`.","cause":"Incorrect import path used for the `PyJsLint` class.","error":"ModuleNotFoundError: No module named 'pyjslint.pyjslint'"},{"fix":"This specific `SyntaxError` (and others) indicate fundamental incompatibility with Python 3. The library is unmaintained and not updated for Python 3. There is no simple fix other than to abandon `pyjslint` for a modern alternative or run it in a Python 2 environment (not recommended for new projects).","cause":"This error typically occurs when running Python 2 code on a Python 3 interpreter, as `print` became a function in Python 3.","error":"SyntaxError: Missing parentheses in call to 'print'"},{"fix":"The `lint()` method returns `None` if no errors are found, or a list of dictionaries if errors are present. Always check for `None` before attempting to iterate or access elements: `result = linter.lint(code); if result: for error in result: ...`.","cause":"Attempting to access attributes on the result of `linter.lint()` without checking if it returned `None`.","error":"AttributeError: 'NoneType' object has no attribute 'get'"}],"ecosystem":"pypi"}