{"id":25779,"library":"java-lint","title":"java-lint","description":"A Java lint utility library focused on removing unused imports. Current version 0.3.0 ships TypeScript types and requires Node.js ^18.13.0 || >=20.2.0. It uses java-parser for AST parsing. The package has been superseded by eslint-plugin-java-lang starting at v0.4.0, which converts the project into an ESLint plugin format. Key differentiators: lightweight, focused only on unused import removal, but with caveats about false negatives due to lazy global identifier collection.","status":"deprecated","version":"0.3.0","language":"javascript","source_language":"en","source_url":"git://github.com/mshima/java-lint","tags":["javascript","typescript"],"install":[{"cmd":"npm install java-lint","lang":"bash","label":"npm"},{"cmd":"yarn add java-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add java-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for parsing Java source code into an AST for lint analysis","package":"java-parser","optional":false}],"imports":[{"note":"ESM-only since v0.1.0; no CommonJS wrapper provided.","wrong":"const removeUnusedImports = require('java-lint').removeUnusedImports;","symbol":"removeUnusedImports","correct":"import { removeUnusedImports } from 'java-lint'"}],"quickstart":{"code":"import { removeUnusedImports } from 'java-lint';\n\nconst source = `package my.project;\n\nimport my.project.pack.Unused;\n\nclass Foo {}`;\n\nconst cleaned = removeUnusedImports(source);\nconsole.log(cleaned);\n// Output: \"package my.project;\\n\\nclass Foo {}\"","lang":"typescript","description":"Demonstrates removing an unused import from a Java source string using removeUnusedImports."},"warnings":[{"fix":"Migrate to eslint-plugin-java-lang.","message":"This package is superseded by eslint-plugin-java-lang as of v0.4.0.","severity":"deprecated","affected_versions":"<=0.3.0"},{"fix":"Review results manually or consider using eslint-plugin-java-lang.","message":"False negatives possible: global identifiers collection is lazy.","severity":"gotcha","affected_versions":">=0.0.1 <=0.3.0"},{"fix":"Ensure Node.js version compatibility.","message":"Requires Node.js ^18.13.0 || >=20.2.0","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use ESM import: import { removeUnusedImports } from 'java-lint'","cause":"Using CommonJS require which returns an object with default export?","error":"TypeError: removeUnusedImports is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}