# eslint-plugin-java-lang

> ESLint plugin and utilities for Java

Latest version **0.6.0** (published 2026-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-java-lang
pnpm add eslint-plugin-java-lang
yarn add eslint-plugin-java-lang
bun add eslint-plugin-java-lang
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2026-04-03 |
| First published | 2026-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 1 |
| Unpacked size | 428.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | mshima |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-java-lang
- Repository: https://github.com/mshima/eslint-plugin-java-lang
- Issues: https://github.com/mshima/eslint-plugin-java-lang/issues
- Funding: https://opencollective.com/marcelo-boveto-shima
- npm.io page: https://npm.io/package/eslint-plugin-java-lang

## Dependencies (1)

- [web-tree-sitter](https://npm.io/package/web-tree-sitter.md) ^0.26.8

## Recent versions

- 0.6.0 (latest) — 2026-04-03
- 0.5.0 — 2026-04-03
- 0.4.1 — 2026-04-02
- 0.4.0 — 2026-04-01

## README

# eslint-plugin-java-lang

ESLint plugin for Java files.

## Installation

```bash
npm i -D eslint eslint-plugin-java-lang
```

## Usage (Flat Config)

Use the recommended config to enable Java parsing/processing and the default rule set.

```js
// eslint.config.js
import java from 'eslint-plugin-java-lang';

export default [java.configs.recommended];
```

## Custom Configuration

```js
// eslint.config.js
import java from 'eslint-plugin-java-lang';

export default [
  {
    files: ['**/*.java'],
    plugins: {
      'eslint-plugin-java-lang': java,
    },
    languageOptions: {
      parser: java.parsers.java,
    },
    processor: java.processors.java,
    rules: {
      'eslint-plugin-java-lang/no-unused-imports': 'warn',
    },
  },
];
```

## Available Rules

- `eslint-plugin-java-lang/no-unused-imports`

## Notes

Current implementation has a lazy global identifier collector.
False negatives may happen.

## Example

Input:

```java
package my.project;

import my.project.pack.Unused;

class Foo {}
```

After running ESLint with `--fix`:

```java
package my.project;

class Foo {}
```

---
_Source: https://npm.io/package/eslint-plugin-java-lang · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
