@codacy/tools-eslint-9 0.18.0 → 0.19.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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # @codacy/tools-eslint-9
2
2
 
3
3
  ## Table of Contents
4
+
4
5
  - [Overview](#overview)
5
6
  - [Updating patterns](#updating-patterns)
6
7
  - [Updating the ESLint version](#updating-the-eslint-version)
@@ -13,15 +14,15 @@
13
14
 
14
15
  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
 
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` |
17
+ | Property | Value |
18
+ | ------------- | ------------------------------------------------ |
19
+ | Tool ID | `ESLint9` |
20
+ | Codacy UUID | `2a30ab97-477f-4769-8b88-af596ce7a94c` |
21
+ | Strategy | Library |
22
+ | Languages | JavaScript, TypeScript |
23
+ | Dependency | `eslint` npm package (v9.x) + 68 plugin packages |
24
+ | Patterns | 2900 (292 core + 2608 plugin) |
25
+ | File patterns | `**/*.js`, `**/*.jsx`, `**/*.ts`, `**/*.tsx` |
25
26
 
26
27
  ## Updating patterns
27
28
 
@@ -34,6 +35,7 @@ git add src/patterns.json
34
35
  ```
35
36
 
36
37
  Pattern IDs use the codacy-eslint9 encoding: `_` → `__`, `/` → `_`. Examples:
38
+
37
39
  - `ESLint9_no-unused-vars` (core rule)
38
40
  - `ESLint9_@typescript-eslint_no-unused-vars` (scoped plugin)
39
41
  - `ESLint9_react_jsx-no-target-blank` (non-scoped plugin)
@@ -55,6 +57,16 @@ pnpm test # Run tests
55
57
 
56
58
  ## Notes for maintainers
57
59
 
60
+ - **Preset mappings (`src/pattern-mappings.json`)**: prefixes only. SonarJS's four React rules
61
+ and `@stylistic`'s JSX rules live under `ESLint9_sonarjs_` / `ESLint9_@stylistic_` beside
62
+ those plugins' framework-agnostic rules, so the `react` key names them explicitly
63
+ (`ESLint9_@stylistic_jsx-` plus the four SonarJS ids). Codacy tags them `reactjs`, but
64
+ gating on the tag is wrong here: the same tag sits on rules that are not React rules, and
65
+ because `filterAutoPatterns` ORs matched keys, a tag also drags in rules prefix-owned by
66
+ other keys entirely (`i18next/no-literal-string`, `perfectionist/sort-jsx-props` — the
67
+ latter duplicating `@stylistic/jsx-sort-props`). Measured on an ordinary React login form,
68
+ tag gating produced 15 findings from rules the project had no reason to enable. Same
69
+ reasoning for the Vue SFC custom-block rules under `jsonc`/`yml`.
58
70
  - ESLint 9 uses the **flat config** format exclusively. The adapter generates flat config arrays when building from Codacy patterns.
59
71
  - 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
72
  - 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`).
package/dist/index.js CHANGED
@@ -30564,45 +30564,52 @@ function pluginExposesRule(plugin, prefix, fullRuleId) {
30564
30564
 
30565
30565
  // src/pattern-mappings.json
30566
30566
  var pattern_mappings_default = {
30567
- React: {
30567
+ react: {
30568
30568
  prefixes: [
30569
30569
  "ESLint9_react_",
30570
30570
  "ESLint9_react-hooks_",
30571
30571
  "ESLint9_react-perf_",
30572
30572
  "ESLint9_react-redux_",
30573
- "ESLint9_jsx-a11y_"
30573
+ "ESLint9_jsx-a11y_",
30574
+ "ESLint9_@stylistic_jsx-",
30575
+ "ESLint9_sonarjs_jsx-no-leaked-render",
30576
+ "ESLint9_sonarjs_no-hook-setter-in-body",
30577
+ "ESLint9_sonarjs_no-useless-react-setstate",
30578
+ "ESLint9_sonarjs_prefer-read-only-props"
30574
30579
  ]
30575
30580
  },
30576
- "Vue.js": {
30581
+ vue: {
30577
30582
  prefixes: [
30578
30583
  "ESLint9_vue_",
30579
30584
  "ESLint9_vue-scoped-css_",
30580
30585
  "ESLint9_vuejs-accessibility_",
30581
- "ESLint9_vuetify_"
30586
+ "ESLint9_vuetify_",
30587
+ "ESLint9_jsonc_vue-custom-block",
30588
+ "ESLint9_yml_vue-custom-block"
30582
30589
  ]
30583
30590
  },
30584
- Angular: {
30591
+ angular: {
30585
30592
  prefixes: ["ESLint9_@angular-eslint_"]
30586
30593
  },
30587
- AngularJS: {
30594
+ "angular-js": {
30588
30595
  prefixes: ["ESLint9_angular_"]
30589
30596
  },
30590
- TypeScript: {
30597
+ "lang:TypeScript": {
30591
30598
  prefixes: ["ESLint9_@typescript-eslint_"]
30592
30599
  },
30593
- Svelte: {
30600
+ svelte: {
30594
30601
  prefixes: ["ESLint9_svelte_"]
30595
30602
  },
30596
- Lit: {
30603
+ lit: {
30597
30604
  prefixes: ["ESLint9_lit_"]
30598
30605
  },
30599
- "Ember.js": {
30606
+ ember: {
30600
30607
  prefixes: ["ESLint9_ember_", "ESLint9_ember-suave_"]
30601
30608
  },
30602
- Nuxt: {
30609
+ nuxt: {
30603
30610
  prefixes: ["ESLint9_nuxt_"]
30604
30611
  },
30605
- Jest: {
30612
+ jest: {
30606
30613
  prefixes: [
30607
30614
  "ESLint9_jest_",
30608
30615
  "ESLint9_jest-dom_",
@@ -30610,67 +30617,67 @@ var pattern_mappings_default = {
30610
30617
  "ESLint9_jest-formatting_"
30611
30618
  ]
30612
30619
  },
30613
- Vitest: {
30620
+ vitest: {
30614
30621
  prefixes: ["ESLint9_@vitest_"]
30615
30622
  },
30616
- Cypress: {
30623
+ cypress: {
30617
30624
  prefixes: ["ESLint9_cypress_"]
30618
30625
  },
30619
- Mocha: {
30626
+ mocha: {
30620
30627
  prefixes: ["ESLint9_mocha_"]
30621
30628
  },
30622
- Playwright: {
30629
+ playwright: {
30623
30630
  prefixes: ["ESLint9_playwright_"]
30624
30631
  },
30625
- AVA: {
30632
+ ava: {
30626
30633
  prefixes: ["ESLint9_ava_"]
30627
30634
  },
30628
- Jasmine: {
30635
+ jasmine: {
30629
30636
  prefixes: ["ESLint9_jasmine_"]
30630
30637
  },
30631
- "Testing Library": {
30638
+ "testing-library": {
30632
30639
  prefixes: ["ESLint9_testing-library_"]
30633
30640
  },
30634
- Storybook: {
30641
+ storybook: {
30635
30642
  prefixes: ["ESLint9_storybook_"]
30636
30643
  },
30637
- "Tailwind CSS": {
30644
+ "tailwind-css": {
30638
30645
  prefixes: ["ESLint9_tailwindcss_"]
30639
30646
  },
30640
- Lodash: {
30647
+ lodash: {
30641
30648
  prefixes: ["ESLint9_lodash_", "ESLint9_lodash-fp_"]
30642
30649
  },
30643
- Redux: {
30650
+ redux: {
30644
30651
  prefixes: ["ESLint9_redux-saga_"]
30645
30652
  },
30646
30653
  i18next: {
30647
30654
  prefixes: ["ESLint9_i18next_"]
30648
30655
  },
30649
- "Backbone.js": {
30656
+ backbone: {
30650
30657
  prefixes: ["ESLint9_backbone_"]
30651
30658
  },
30652
- WebdriverIO: {
30659
+ webdriverio: {
30653
30660
  prefixes: ["ESLint9_wdio_"]
30654
30661
  },
30655
- TanStack: {
30662
+ tanstack: {
30656
30663
  prefixes: ["ESLint9_@tanstack_"]
30657
30664
  },
30658
- Shopify: {
30665
+ shopify: {
30659
30666
  prefixes: ["ESLint9_@shopify_"]
30660
30667
  },
30661
- "Lightning Web Components": {
30668
+ "lightning-web-components": {
30662
30669
  prefixes: ["ESLint9_@lwc_"]
30663
30670
  },
30664
- Salesforce: {
30671
+ salesforce: {
30665
30672
  prefixes: ["ESLint9_@salesforce_"]
30666
30673
  },
30667
- Meteor: {
30674
+ meteor: {
30668
30675
  prefixes: ["ESLint9_meteor_"]
30669
30676
  },
30670
- SuiteScript: {
30677
+ suitescript: {
30671
30678
  prefixes: ["ESLint9_suitescript_"]
30672
30679
  },
30673
- "ESLint Plugin": {
30680
+ "eslint-plugin": {
30674
30681
  prefixes: ["ESLint9_eslint-plugin_"]
30675
30682
  }
30676
30683
  };
package/dist/metadata.js CHANGED
@@ -26,45 +26,52 @@ module.exports = __toCommonJS(metadata_exports);
26
26
 
27
27
  // src/pattern-mappings.json
28
28
  var pattern_mappings_default = {
29
- React: {
29
+ react: {
30
30
  prefixes: [
31
31
  "ESLint9_react_",
32
32
  "ESLint9_react-hooks_",
33
33
  "ESLint9_react-perf_",
34
34
  "ESLint9_react-redux_",
35
- "ESLint9_jsx-a11y_"
35
+ "ESLint9_jsx-a11y_",
36
+ "ESLint9_@stylistic_jsx-",
37
+ "ESLint9_sonarjs_jsx-no-leaked-render",
38
+ "ESLint9_sonarjs_no-hook-setter-in-body",
39
+ "ESLint9_sonarjs_no-useless-react-setstate",
40
+ "ESLint9_sonarjs_prefer-read-only-props"
36
41
  ]
37
42
  },
38
- "Vue.js": {
43
+ vue: {
39
44
  prefixes: [
40
45
  "ESLint9_vue_",
41
46
  "ESLint9_vue-scoped-css_",
42
47
  "ESLint9_vuejs-accessibility_",
43
- "ESLint9_vuetify_"
48
+ "ESLint9_vuetify_",
49
+ "ESLint9_jsonc_vue-custom-block",
50
+ "ESLint9_yml_vue-custom-block"
44
51
  ]
45
52
  },
46
- Angular: {
53
+ angular: {
47
54
  prefixes: ["ESLint9_@angular-eslint_"]
48
55
  },
49
- AngularJS: {
56
+ "angular-js": {
50
57
  prefixes: ["ESLint9_angular_"]
51
58
  },
52
- TypeScript: {
59
+ "lang:TypeScript": {
53
60
  prefixes: ["ESLint9_@typescript-eslint_"]
54
61
  },
55
- Svelte: {
62
+ svelte: {
56
63
  prefixes: ["ESLint9_svelte_"]
57
64
  },
58
- Lit: {
65
+ lit: {
59
66
  prefixes: ["ESLint9_lit_"]
60
67
  },
61
- "Ember.js": {
68
+ ember: {
62
69
  prefixes: ["ESLint9_ember_", "ESLint9_ember-suave_"]
63
70
  },
64
- Nuxt: {
71
+ nuxt: {
65
72
  prefixes: ["ESLint9_nuxt_"]
66
73
  },
67
- Jest: {
74
+ jest: {
68
75
  prefixes: [
69
76
  "ESLint9_jest_",
70
77
  "ESLint9_jest-dom_",
@@ -72,67 +79,67 @@ var pattern_mappings_default = {
72
79
  "ESLint9_jest-formatting_"
73
80
  ]
74
81
  },
75
- Vitest: {
82
+ vitest: {
76
83
  prefixes: ["ESLint9_@vitest_"]
77
84
  },
78
- Cypress: {
85
+ cypress: {
79
86
  prefixes: ["ESLint9_cypress_"]
80
87
  },
81
- Mocha: {
88
+ mocha: {
82
89
  prefixes: ["ESLint9_mocha_"]
83
90
  },
84
- Playwright: {
91
+ playwright: {
85
92
  prefixes: ["ESLint9_playwright_"]
86
93
  },
87
- AVA: {
94
+ ava: {
88
95
  prefixes: ["ESLint9_ava_"]
89
96
  },
90
- Jasmine: {
97
+ jasmine: {
91
98
  prefixes: ["ESLint9_jasmine_"]
92
99
  },
93
- "Testing Library": {
100
+ "testing-library": {
94
101
  prefixes: ["ESLint9_testing-library_"]
95
102
  },
96
- Storybook: {
103
+ storybook: {
97
104
  prefixes: ["ESLint9_storybook_"]
98
105
  },
99
- "Tailwind CSS": {
106
+ "tailwind-css": {
100
107
  prefixes: ["ESLint9_tailwindcss_"]
101
108
  },
102
- Lodash: {
109
+ lodash: {
103
110
  prefixes: ["ESLint9_lodash_", "ESLint9_lodash-fp_"]
104
111
  },
105
- Redux: {
112
+ redux: {
106
113
  prefixes: ["ESLint9_redux-saga_"]
107
114
  },
108
115
  i18next: {
109
116
  prefixes: ["ESLint9_i18next_"]
110
117
  },
111
- "Backbone.js": {
118
+ backbone: {
112
119
  prefixes: ["ESLint9_backbone_"]
113
120
  },
114
- WebdriverIO: {
121
+ webdriverio: {
115
122
  prefixes: ["ESLint9_wdio_"]
116
123
  },
117
- TanStack: {
124
+ tanstack: {
118
125
  prefixes: ["ESLint9_@tanstack_"]
119
126
  },
120
- Shopify: {
127
+ shopify: {
121
128
  prefixes: ["ESLint9_@shopify_"]
122
129
  },
123
- "Lightning Web Components": {
130
+ "lightning-web-components": {
124
131
  prefixes: ["ESLint9_@lwc_"]
125
132
  },
126
- Salesforce: {
133
+ salesforce: {
127
134
  prefixes: ["ESLint9_@salesforce_"]
128
135
  },
129
- Meteor: {
136
+ meteor: {
130
137
  prefixes: ["ESLint9_meteor_"]
131
138
  },
132
- SuiteScript: {
139
+ suitescript: {
133
140
  prefixes: ["ESLint9_suitescript_"]
134
141
  },
135
- "ESLint Plugin": {
142
+ "eslint-plugin": {
136
143
  prefixes: ["ESLint9_eslint-plugin_"]
137
144
  }
138
145
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-eslint-9",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "ESLint 9 adapter — Library-mode JavaScript/TypeScript linter",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -79,7 +79,7 @@
79
79
  "eslint-plugin-wdio": "^9.0.0",
80
80
  "eslint-plugin-xss": "^0.1.0",
81
81
  "eslint-plugin-yml": "^1.0.0",
82
- "@codacy/tooling": "0.18.0"
82
+ "@codacy/tooling": "0.19.0"
83
83
  },
84
84
  "license": "MIT",
85
85
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",