@codacy/tools-eslint-9 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Codacy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # @codacy/tools-eslint-9
2
+
3
+ ## Table of Contents
4
+ - [Overview](#overview)
5
+ - [Updating patterns](#updating-patterns)
6
+ - [Updating the ESLint version](#updating-the-eslint-version)
7
+ - [Development](#development)
8
+ - [Notes for maintainers](#notes-for-maintainers)
9
+
10
+ ---
11
+
12
+ ## Overview
13
+
14
+ JavaScript/TypeScript linter using [ESLint 9](https://eslint.org) with the flat config format. Uses the Library execution strategy — calls the ESLint API directly rather than spawning a subprocess.
15
+
16
+ | Property | Value |
17
+ |----------|-------|
18
+ | Tool ID | `ESLint9` |
19
+ | Codacy UUID | `2a30ab97-477f-4769-8b88-af596ce7a94c` |
20
+ | Strategy | Library |
21
+ | Languages | JavaScript, TypeScript |
22
+ | Dependency | `eslint` npm package (v9.x) + 68 plugin packages |
23
+ | Patterns | 2900 (292 core + 2608 plugin) |
24
+ | File patterns | `**/*.js`, `**/*.jsx`, `**/*.ts`, `**/*.tsx` |
25
+
26
+ ## Updating patterns
27
+
28
+ ```bash
29
+ # Re-fetch pattern metadata from the Codacy API
30
+ pnpm prefetch
31
+
32
+ # Commit the result
33
+ git add src/patterns.json
34
+ ```
35
+
36
+ Pattern IDs use the codacy-eslint9 encoding: `_` → `__`, `/` → `_`. Examples:
37
+ - `ESLint9_no-unused-vars` (core rule)
38
+ - `ESLint9_@typescript-eslint_no-unused-vars` (scoped plugin)
39
+ - `ESLint9_react_jsx-no-target-blank` (non-scoped plugin)
40
+
41
+ ## Updating the ESLint version
42
+
43
+ 1. Update `eslint` and related packages in `package.json`
44
+ 2. Run `pnpm install`
45
+ 3. Run `pnpm prefetch` to check for new/removed rules
46
+ 4. Run `pnpm test` to verify compatibility
47
+ 5. If the major version changes, create a new adapter package (`eslint-10/`)
48
+
49
+ ## Development
50
+
51
+ ```bash
52
+ pnpm build # Build with tsup
53
+ pnpm test # Run tests
54
+ ```
55
+
56
+ ## Notes for maintainers
57
+
58
+ - ESLint 9 uses the **flat config** format exclusively. The adapter generates flat config arrays when building from Codacy patterns.
59
+ - Pattern IDs use the same encoding as the codacy-eslint9 wrapper: `_` → `__` then `/` → `_` (encode), reverse for decode. This means `_` in rule names is escaped as `__`.
60
+ - The `blacklist.ts` file contains 30+ rules known to crash ESLint or produce severe false positives, sourced from the codacy-eslint9 wrapper. The `isBlacklisted()` function also checks regex patterns (e.g. `unused-imports/*-ts`).
61
+ - The `plugin-registry.ts` handles lazy loading of all 68 ESLint plugin packages. Plugins are only loaded when rules from that plugin are in the active pattern selection.
62
+ - The `config-builder.ts` generates 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.
63
+ - When no config or patterns are provided, the adapter falls back to `@eslint/js` recommended config.
64
+ - `checkAvailability` imports the ESLint class and returns `ESLint.version`.
65
+ - `install` is a no-op — the npm dependency handles installation.
66
+ - Peer dependency warnings from plugins not yet updated for ESLint 9 are expected and match the codacy-eslint9 wrapper behavior.
@@ -0,0 +1,5 @@
1
+ import * as _codacy_tooling from '@codacy/tooling';
2
+
3
+ declare const _default: Readonly<_codacy_tooling.ToolAdapter>;
4
+
5
+ export { _default as default };