@codacy/tools-eslint-9
v0.2.0
Published
ESLint 9 adapter — Library-mode JavaScript/TypeScript linter
Readme
@codacy/tools-eslint-9
Table of Contents
Overview
JavaScript/TypeScript linter using ESLint 9 with the flat config format. Uses the Library execution strategy — calls the ESLint API directly rather than spawning a subprocess.
| Property | Value |
|----------|-------|
| Tool ID | ESLint9 |
| Codacy UUID | 2a30ab97-477f-4769-8b88-af596ce7a94c |
| Strategy | Library |
| Languages | JavaScript, TypeScript |
| Dependency | eslint npm package (v9.x) + 68 plugin packages |
| Patterns | 2900 (292 core + 2608 plugin) |
| File patterns | **/*.js, **/*.jsx, **/*.ts, **/*.tsx |
Updating patterns
# Re-fetch pattern metadata from the Codacy API
pnpm prefetch
# Commit the result
git add src/patterns.jsonPattern IDs use the codacy-eslint9 encoding: _ → __, / → _. Examples:
ESLint9_no-unused-vars(core rule)ESLint9_@typescript-eslint_no-unused-vars(scoped plugin)ESLint9_react_jsx-no-target-blank(non-scoped plugin)
Updating the ESLint version
- Update
eslintand related packages inpackage.json - Run
pnpm install - Run
pnpm prefetchto check for new/removed rules - Run
pnpm testto verify compatibility - If the major version changes, create a new adapter package (
eslint-10/)
Development
pnpm build # Build with tsup
pnpm test # Run testsNotes for maintainers
- ESLint 9 uses the flat config format exclusively. The adapter generates flat config arrays when building from Codacy patterns.
- Pattern IDs use the same encoding as the codacy-eslint9 wrapper:
_→__then/→_(encode), reverse for decode. This means_in rule names is escaped as__. - The
blacklist.tsfile contains 30+ rules known to crash ESLint or produce severe false positives, sourced from the codacy-eslint9 wrapper. TheisBlacklisted()function also checks regex patterns (e.g.unused-imports/*-ts). - The
plugin-registry.tshandles lazy loading of all 68 ESLint plugin packages. Plugins are only loaded when rules from that plugin are in the active pattern selection. - The
config-builder.tsgenerates flat config objects from Codacy patterns, grouping rules by plugin and setting up appropriate parsers. TypeScript files get@typescript-eslint/parser; Vue/Svelte/JSONC/YML files get appropriate file globs. - When no config or patterns are provided, the adapter falls back to
@eslint/jsrecommended config. checkAvailabilityimports the ESLint class and returnsESLint.version.installis a no-op — the npm dependency handles installation.- Peer dependency warnings from plugins not yet updated for ESLint 9 are expected and match the codacy-eslint9 wrapper behavior.
