eslint-config-un 1.0.0-alpha.2 → 1.0.0-alpha.20

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.
Files changed (207) hide show
  1. package/README.md +93 -31
  2. package/dist/angular-cWftUPrZ.js +102 -0
  3. package/dist/astro-CvR9K0gV.js +51 -0
  4. package/dist/ava-SLDP66eK.js +23 -0
  5. package/dist/better-tailwind-azPYeaEn.js +22 -0
  6. package/dist/case-police-DBwLQOVl.js +22 -0
  7. package/dist/cli-BzQFfgVw.js +26 -0
  8. package/dist/cloudfront-functions-BVhErVDp.js +155 -0
  9. package/dist/compat-B93yCNFB.js +17 -0
  10. package/dist/cspell-Bm6iyjh-.js +23 -0
  11. package/dist/css-DTwag5G6.js +36 -0
  12. package/dist/css-in-js-DycfdUwQ.js +22 -0
  13. package/dist/cypress-9Xn3n9ew.js +23 -0
  14. package/dist/de-morgan-Cz-bumEx.js +19 -0
  15. package/dist/depend-Ui3Jv1M-.js +22 -0
  16. package/dist/ember-BdN_N0Pf.js +40 -0
  17. package/dist/erasable-syntax-only-BTwpy-N9.js +20 -0
  18. package/dist/es-Bdl9Y-AD.js +4 -0
  19. package/dist/es-CvoaEvOg.js +51 -0
  20. package/dist/eslint-CA-T1mGF.js +820 -0
  21. package/dist/eslint-comments-DSK3-cG0.js +21 -0
  22. package/dist/eslint-plugin-DOzBdVRJ.js +25 -0
  23. package/dist/file-progress-BdKBYflw.js +17 -0
  24. package/dist/graphql-ny5sliuQ.js +103 -0
  25. package/dist/html-hhlV3C4E.js +25 -0
  26. package/dist/import-Dii1B5QQ.js +60 -0
  27. package/dist/index.d.ts +34468 -36333
  28. package/dist/index.js +508 -568
  29. package/dist/jest-CNiSTRCJ.js +61 -0
  30. package/dist/js-DccveTXD.js +86 -0
  31. package/dist/js-inline-Uj2v6w_c.js +60 -0
  32. package/dist/jsdoc-C3vt6uPV.js +36 -0
  33. package/dist/json-schema-validator-j937NQr1.js +28 -0
  34. package/dist/jsonc-DW59DXwo.js +48 -0
  35. package/dist/jsx-a11y-V0-wCeTY.js +204 -0
  36. package/dist/lit-CmcOg2hP.js +30 -0
  37. package/dist/markdown-Cysb9zfR.js +74 -0
  38. package/dist/math-CTy57jGy.js +17 -0
  39. package/dist/mdx-CbN8DxRF.js +61 -0
  40. package/dist/mocha-B7F8FRRw.js +30 -0
  41. package/dist/nextjs-BpQlzj5U.js +20 -0
  42. package/dist/no-only-tests-DNt2xV5N.js +20 -0
  43. package/dist/no-stylistic-rules-B7ZIDLFp.js +4073 -0
  44. package/dist/no-unsanitized-n86JZvL7.js +16 -0
  45. package/dist/node-Dy2Mgs0k.js +24 -0
  46. package/dist/node-dependencies-B0HdPYFH.js +25 -0
  47. package/dist/package-json-DI9Q5h6H.js +4 -0
  48. package/dist/package-json-DiWZz25w.js +60 -0
  49. package/dist/perfectionist-DlbX4_pk.js +67 -0
  50. package/dist/playwright-19BGSIHO.js +23 -0
  51. package/dist/pnpm-BItaSLlf.js +35 -0
  52. package/dist/prefer-arrow-functions-DoXDp5_p.js +19 -0
  53. package/dist/promise-uLyVQGSa.js +22 -0
  54. package/dist/qunit-CGut-G_3.js +23 -0
  55. package/dist/qwik-CSE-ydoQ.js +23 -0
  56. package/dist/react-DwOfoJ5v.js +238 -0
  57. package/dist/regexp-C5Mt8Vt1.js +19 -0
  58. package/dist/security-K1j49Qbg.js +19 -0
  59. package/dist/shared-CjK2SSQm.js +163 -0
  60. package/dist/solid-DFFYo2kB.js +24 -0
  61. package/dist/sonar-i6RwbYTO.js +28 -0
  62. package/dist/storybook-Dnevld2C.js +20 -0
  63. package/dist/svelte-IexC5os1.js +71 -0
  64. package/dist/tailwind-DGPH66UZ.js +40 -0
  65. package/dist/tanstack-query-C5mBd_2E.js +16 -0
  66. package/dist/testing-library-B-Lni31b.js +49 -0
  67. package/dist/toml-CNAA7_2c.js +30 -0
  68. package/dist/ts-ByImKELq.js +451 -0
  69. package/dist/turbo-D20dzRT0.js +17 -0
  70. package/dist/unicorn-V52iQY8k.js +25 -0
  71. package/dist/unused-imports-C-W5w88w.js +21 -0
  72. package/dist/vitest-DvFjyQsm.js +40 -0
  73. package/dist/vue-VVN9O93f.js +161 -0
  74. package/dist/web-components-BUdAzFGR.js +17 -0
  75. package/dist/yaml-DRDyOsl2.js +29 -0
  76. package/dist/you-dont-need-lodash-underscore-DsPbh8fD.js +98 -0
  77. package/node_modules/@pkgr/core/index.d.cts +3 -0
  78. package/node_modules/@pkgr/core/lib/constants.d.ts +8 -0
  79. package/node_modules/@pkgr/core/lib/constants.js +9 -0
  80. package/node_modules/@pkgr/core/lib/constants.js.map +1 -0
  81. package/node_modules/@pkgr/core/lib/helpers.d.ts +5 -0
  82. package/node_modules/@pkgr/core/lib/helpers.js +45 -0
  83. package/node_modules/@pkgr/core/lib/helpers.js.map +1 -0
  84. package/node_modules/@pkgr/core/lib/index.cjs +65 -0
  85. package/node_modules/@pkgr/core/lib/index.d.ts +2 -0
  86. package/node_modules/@pkgr/core/lib/index.js +3 -0
  87. package/node_modules/@pkgr/core/lib/index.js.map +1 -0
  88. package/node_modules/@pkgr/core/package.json +38 -0
  89. package/node_modules/eslint-plugin-no-type-assertion/LICENSE +21 -0
  90. package/node_modules/eslint-plugin-no-type-assertion/README.md +61 -0
  91. package/node_modules/eslint-plugin-no-type-assertion/lib/index.js +3 -0
  92. package/node_modules/eslint-plugin-no-type-assertion/lib/rules/no-type-assertion.js +55 -0
  93. package/node_modules/eslint-plugin-no-type-assertion/package.json +35 -0
  94. package/node_modules/eslint-plugin-prettier/LICENSE.md +24 -0
  95. package/node_modules/eslint-plugin-prettier/README.md +202 -0
  96. package/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.d.ts +5 -0
  97. package/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js +309 -0
  98. package/node_modules/eslint-plugin-prettier/package.json +60 -0
  99. package/node_modules/eslint-plugin-prettier/recommended.d.ts +12 -0
  100. package/node_modules/eslint-plugin-prettier/recommended.js +18 -0
  101. package/node_modules/eslint-plugin-prettier/worker.mjs +191 -0
  102. package/node_modules/fast-diff/LICENSE +201 -0
  103. package/node_modules/fast-diff/README.md +24 -0
  104. package/node_modules/fast-diff/diff.d.ts +21 -0
  105. package/node_modules/fast-diff/diff.js +1138 -0
  106. package/node_modules/fast-diff/package.json +30 -0
  107. package/node_modules/prettier-linter-helpers/.editorconfig +15 -0
  108. package/node_modules/prettier-linter-helpers/.eslintignore +2 -0
  109. package/node_modules/prettier-linter-helpers/.eslintrc.js +6 -0
  110. package/node_modules/prettier-linter-helpers/.github/CONTRIBUTING.md +41 -0
  111. package/node_modules/prettier-linter-helpers/.prettierignore +1 -0
  112. package/node_modules/prettier-linter-helpers/.prettierrc +6 -0
  113. package/node_modules/prettier-linter-helpers/.vscode/settings.json +12 -0
  114. package/node_modules/prettier-linter-helpers/LICENSE.md +24 -0
  115. package/node_modules/prettier-linter-helpers/README.md +14 -0
  116. package/node_modules/prettier-linter-helpers/index.js +145 -0
  117. package/node_modules/prettier-linter-helpers/package.json +38 -0
  118. package/node_modules/prettier-linter-helpers/test/index.test.js +29 -0
  119. package/node_modules/synckit/LICENSE +21 -0
  120. package/node_modules/synckit/README.md +256 -0
  121. package/node_modules/synckit/lib/common.d.ts +5 -0
  122. package/node_modules/synckit/lib/common.js +22 -0
  123. package/node_modules/synckit/lib/common.js.map +1 -0
  124. package/node_modules/synckit/lib/constants.d.ts +38 -0
  125. package/node_modules/synckit/lib/constants.js +54 -0
  126. package/node_modules/synckit/lib/constants.js.map +1 -0
  127. package/node_modules/synckit/lib/helpers.d.ts +27 -0
  128. package/node_modules/synckit/lib/helpers.js +413 -0
  129. package/node_modules/synckit/lib/helpers.js.map +1 -0
  130. package/node_modules/synckit/lib/index.cjs +590 -0
  131. package/node_modules/synckit/lib/index.d.cts +138 -0
  132. package/node_modules/synckit/lib/index.d.ts +7 -0
  133. package/node_modules/synckit/lib/index.js +73 -0
  134. package/node_modules/synckit/lib/index.js.map +1 -0
  135. package/node_modules/synckit/lib/types.d.ts +48 -0
  136. package/node_modules/synckit/lib/types.js +2 -0
  137. package/node_modules/synckit/lib/types.js.map +1 -0
  138. package/node_modules/synckit/package.json +45 -0
  139. package/package.json +279 -78
  140. package/deps/angular-eslint-eslint-plugin-18.4.3.tgz +0 -0
  141. package/deps/angular-eslint-eslint-plugin-template-17.5.3.tgz +0 -0
  142. package/dist/angular-I35S5TJH.js +0 -310
  143. package/dist/astro-MLSGY523.js +0 -79
  144. package/dist/ava-CAB2XAKV.js +0 -42
  145. package/dist/better-tailwind-NA5OXT2H.js +0 -61
  146. package/dist/case-police-KMZSDSFQ.js +0 -29
  147. package/dist/chunk-FGAYX7NU.js +0 -267
  148. package/dist/chunk-HKH2EDN6.js +0 -137
  149. package/dist/chunk-L7NY4DIR.js +0 -938
  150. package/dist/chunk-MCOXOJTL.js +0 -261
  151. package/dist/chunk-RRWPVU6R.js +0 -96
  152. package/dist/cli-7VWSINFJ.js +0 -37
  153. package/dist/cloudfront-functions-J3ZL2G7J.js +0 -195
  154. package/dist/cspell-KNSKMNWV.js +0 -30
  155. package/dist/css-4C5B5QF6.js +0 -57
  156. package/dist/css-in-js-ABBJATKZ.js +0 -45
  157. package/dist/cypress-45S7U2IO.js +0 -35
  158. package/dist/de-morgan-JZ4JTOTR.js +0 -20
  159. package/dist/depend-XWLM6SPV.js +0 -33
  160. package/dist/ember-JM7X4YIN.js +0 -66
  161. package/dist/erasable-syntax-only-VFSUE2CS.js +0 -29
  162. package/dist/es-ZQWFEZ5B.js +0 -7
  163. package/dist/eslint-comments-GGQMOKBE.js +0 -37
  164. package/dist/eslint-plugin-KK6S5YF2.js +0 -54
  165. package/dist/file-progress-PXQ5E6ZB.js +0 -29
  166. package/dist/graphql-PQYKHC4Z.js +0 -150
  167. package/dist/html-OLR7NJPB.js +0 -45
  168. package/dist/import-EVB7KBNB.js +0 -80
  169. package/dist/jest-4SOUHP7H.js +0 -132
  170. package/dist/js-WGUYBQB5.js +0 -87
  171. package/dist/js-inline-SF6EL5O2.js +0 -91
  172. package/dist/jsdoc-KMLZKKGT.js +0 -70
  173. package/dist/json-schema-validator-RWRUMTWK.js +0 -80
  174. package/dist/jsonc-EHTQMHF3.js +0 -55
  175. package/dist/jsx-a11y-XJXMXHQT.js +0 -7
  176. package/dist/markdown-RIUVNCJH.js +0 -167
  177. package/dist/math-D7C3M6DY.js +0 -28
  178. package/dist/mdx-CQMRG7EH.js +0 -127
  179. package/dist/nextjs-O3ZBLJKX.js +0 -38
  180. package/dist/no-stylistic-rules-TDZMA2QP.js +0 -7044
  181. package/dist/no-unsanitized-RCDGAB3H.js +0 -20
  182. package/dist/node-4R37GFKD.js +0 -60
  183. package/dist/node-dependencies-P66DDLRP.js +0 -40
  184. package/dist/package-json-EY64FXUV.js +0 -9
  185. package/dist/perfectionist-TYM4X3IE.js +0 -115
  186. package/dist/pnpm-GNIQAYQ2.js +0 -63
  187. package/dist/prefer-arrow-functions-GE7ETKBL.js +0 -26
  188. package/dist/promise-W4IRNE3V.js +0 -22
  189. package/dist/qwik-ONACLAWX.js +0 -37
  190. package/dist/react-M2OHKXEL.js +0 -521
  191. package/dist/regexp-5P5WG6DD.js +0 -22
  192. package/dist/security-BOD7G3FC.js +0 -22
  193. package/dist/solid-ODNLS7SN.js +0 -43
  194. package/dist/sonar-Z6F7MNH6.js +0 -35
  195. package/dist/storybook-FTCC76IN.js +0 -36
  196. package/dist/svelte-GPW3LGHY.js +0 -122
  197. package/dist/tailwind-M2454UPC.js +0 -50
  198. package/dist/tanstack-query-GD4D2UDP.js +0 -20
  199. package/dist/testing-library-HFSYANBY.js +0 -108
  200. package/dist/toml-2WTWKMRI.js +0 -53
  201. package/dist/ts-KLDZ6EFW.js +0 -703
  202. package/dist/turbo-MJMSZ63M.js +0 -25
  203. package/dist/unicorn-XZ6MBR47.js +0 -24
  204. package/dist/unused-imports-7MBVNHIW.js +0 -35
  205. package/dist/vitest-DRRMX77G.js +0 -81
  206. package/dist/vue-TE4ETXYZ.js +0 -368
  207. package/dist/yaml-H3HW2OFQ.js +0 -62
package/README.md CHANGED
@@ -31,32 +31,71 @@ and many more;
31
31
  ## Installation
32
32
 
33
33
  Minimum supported versions:
34
- - NodeJS: ^20.10 or >=21.2
34
+ - NodeJS: ^20.12 or >=21.7
35
35
  - ESLint: ^9.15.0 (peer dependency)
36
36
 
37
37
  ```shell
38
38
  npm i -D eslint-config-un eslint@latest
39
39
  pnpm i -D eslint-config-un eslint@latest
40
- yarn add -D eslint-config-un eslint@latest
40
+ yarn add -D eslint-config-un eslint@latest # Yarn Berry only (v2+)
41
41
  ```
42
42
 
43
- Almost all the used plugins are direct dependencies of this package, you don't need to install them separately. We aim to update the dependencies within 1 month after their release.
43
+ Commonly used plugins are direct dependencies of this package, you don't need to install them separately. We aim to update the dependencies within 1 month after their release.
44
44
 
45
- Certain plugins are optional peer dependencies, which means that you need to install them manually if they are end up being used.
45
+ Certain plugins (usually framework/library specific ones) are optional peer dependencies, which means that you need to install them manually if they are end up being used. You need to run ESLint with our config once to find out which plugins should be installed manually.
46
46
 
47
47
  <details>
48
- <summary>Optional peer dependencies & reason</summary>
49
-
50
- The reason for making these plugins not coming with this package is because they have heavy non-optional peer dependencies, such as `graphql`, `storybook` and `tailwindcss`. Not only that they're heavy, but having those peer dependencies installed would make this package think that the corresponding config is used.
51
-
52
- | Default plugin prefix | Package name | Reason |
53
- | --------------------- | ------------ | ------ |
54
- | `graphql` | `@graphql-eslint/eslint-plugin` | Heavy dependency `graphql` |
55
- | `betterTailwindcss` | `eslint-plugin-better-tailwindcss` | Heavy dependency `tailwindcss` |
56
- | `storybook` | `eslint-plugin-storybook` | Heavy dependency `storybook` |
57
- | `tailwindcss` | `eslint-plugin-tailwindcss` | Heavy dependency `tailwindcss` |
58
- | `turbo` | `eslint-plugin-turbo` | Heavy dependency `turbo` |
59
- | `eslintPlugin` | `eslint-plugin-eslint-plugin` | Very specific plugin |
48
+ <summary>Installation with Yarn Classic (v1)</summary>
49
+
50
+ Yarn Classic (v1) does not support installing packages by npm name that have dependencies referenced by `file:` protocol - which we're using in this package. It fails with "Tarball is not in network and can not be located in cache" error. Installing directly from the tarball do work:
51
+
52
+ ```shell
53
+ yarn add -D https://registry.npmjs.org/eslint-config-un/-/eslint-config-un-<VERSION>.tgz eslint@latest
54
+ ```
55
+ </details>
56
+
57
+ <details>
58
+ <summary>List of optional peer dependencies</summary>
59
+
60
+ | Default plugin prefix | Package name |
61
+ | -------------------------- | ---------------------------------------- |
62
+ | `@angular-eslint` | `@angular-eslint/eslint-plugin` |
63
+ | `@angular-eslint/template` | `@angular-eslint/eslint-plugin-template` |
64
+ | `@cspell` | `@cspell/eslint-plugin` |
65
+ | `@eslint-react` | `@eslint-react/eslint-plugin` |
66
+ | `@next/next` | `@next/eslint-plugin-next` |
67
+ | `@tanstack/query` | `@tanstack/eslint-plugin-query` |
68
+ | `astro` | `eslint-plugin-astro` |
69
+ | `ava` | `eslint-plugin-ava` |
70
+ | `better-tailwindcss` | `eslint-plugin-better-tailwindcss` |
71
+ | `case-police` | `eslint-plugin-case-police` |
72
+ | `de-morgan` | `eslint-plugin-de-morgan` |
73
+ | `ember` | `eslint-plugin-ember` |
74
+ | `erasable-syntax-only` | `eslint-plugin-erasable-syntax-only` |
75
+ | `es` | `eslint-plugin-es-x` |
76
+ | `eslint-plugin` | `eslint-plugin-eslint-plugin` |
77
+ | `graphql` | `@graphql-eslint/eslint-plugin` |
78
+ | `jest-extended` | `eslint-plugin-jest-extended` |
79
+ | `jest` | `eslint-plugin-jest` |
80
+ | `perfectionist` | `eslint-plugin-perfectionist` |
81
+ | `pinia` | `eslint-plugin-pinia` |
82
+ | `playwright` | `eslint-plugin-playwright` |
83
+ | `prefer-arrow-functions` | `eslint-plugin-prefer-arrow-functions` |
84
+ | `qunit` | `eslint-plugin-qunit` |
85
+ | `qwik` | `eslint-plugin-qwik` |
86
+ | `react-compiler` | `eslint-plugin-react-compiler` |
87
+ | `react-hooks` | `eslint-plugin-react-hooks` |
88
+ | `react-refresh` | `eslint-plugin-react-refresh` |
89
+ | `react` | `eslint-plugin-react` |
90
+ | `solid` | `eslint-plugin-solid` |
91
+ | `storybook` | `eslint-plugin-storybook` |
92
+ | `svelte` | `eslint-plugin-svelte` |
93
+ | `tailwindcss` | `eslint-plugin-tailwindcss` |
94
+ | `testing-library` | `eslint-plugin-testing-library` |
95
+ | `turbo` | `eslint-plugin-turbo` |
96
+ | `vitest` | `@vitest/eslint-plugin` |
97
+ | `vue` | `eslint-plugin-vue` |
98
+ | `vuejs-accessibility` | `eslint-plugin-vuejs-accessibility` |
60
99
  </details>
61
100
 
62
101
  ### Usage
@@ -162,6 +201,7 @@ Sub-config is a Config located within Config's options. If the parent config is
162
201
  | ![ReactJS](./assets/devicon-react.svg) `react/dom` | ✅ (`react-dom` is installed) | [@eslint-react/eslint-plugin](https://npmjs.com/package/@eslint-react/eslint-plugin) (`@eslint-react`)<br>[eslint-plugin-react](https://npmjs.com/eslint-plugin-react) | Includes rules with `@eslint-react/dom` prefix from `@eslint-react/eslint-plugin` and DOM related rules from `eslint-plugin-react` |
163
202
  | ![ReactJS](./assets/devicon-react.svg) `react/refresh` | ✅ | [eslint-plugin-react-refresh](https://npmjs.com/eslint-plugin-react-refresh) (`react-refresh`) | - |
164
203
  | ![ReactJS](./assets/devicon-react.svg) `react/compiler` | ✅ (if React version is at least 19) | [eslint-plugin-react-compiler](https://npmjs.com/eslint-plugin-react-compiler) (`react-compiler`) | - |
204
+ | ![ReactJS](./assets/devicon-react.svg) `react/youMightNotNeedAnEffect` | ✅ | [eslint-plugin-react-you-might-not-need-an-effect](https://npmjs.com/eslint-plugin-react-you-might-not-need-an-effect) (`react-you-might-not-need-an-effect`) | Since v1.0.0 |
165
205
  | ![ReactJS](./assets/devicon-react.svg) `react/allowDefaultExportsInJsxFiles` | ✅ | - | Config that allows default exports in all JSX files |
166
206
  | ![NextJS](./assets/devicon-nextjs.svg) `nextJs` | ✅ (`next` is installed) | [@next/eslint-plugin-next](https://npmjs.com/package/@next/eslint-plugin-next) (`@next/next`) | Since v0.9.0 |
167
207
  | ![SolidJS](./assets/devicon-solidjs.svg) `solid` | ✅ (`solid-js` is installed) | [eslint-plugin-solid](https://npmjs.com/eslint-plugin-solid) (`solid`) | Since v0.10.0 |
@@ -170,6 +210,10 @@ Sub-config is a Config located within Config's options. If the parent config is
170
210
  | ![Astro](./assets/devicon-astro.svg) `astro/jsxA11y` | ✅ | ^ | Only A11Y rules from `eslint-plugin-astro` |
171
211
  | ![Svelte](./assets/devicon-svelte.svg) `svelte` | ✅ (`svelte` is installed) | [eslint-plugin-svelte](https://npmjs.com/eslint-plugin-svelte) (`svelte`) | Since v0.10.0 |
172
212
  | ![Ember](./assets/devicon-ember.svg) `ember` | ✅ (`ember-source` is installed) | [eslint-plugin-ember](https://npmjs.com/eslint-plugin-ember) (`ember`) | Since v1.0.0 |
213
+ | ![Ember](./assets/devicon-ember.svg) `ember/testFiles` | ✅ | ^ | Since v1.0.0 |
214
+ | ![Ember](./assets/devicon-ember.svg) `ember/testFiles/noOnlyTests` | ✅ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
215
+ | ![Lit](./assets/logos-lit-icon.svg) `lit` | ✅ (`lit` is installed) | [eslint-plugin-lit](https://npmjs.com/eslint-plugin-lit) (`lit`) | Since v1.0.0 |
216
+ | ![Lit](./assets/logos-lit-icon.svg) `lit/a11y` | ✅ | [eslint-plugin-lit-a11y](https://npmjs.com/eslint-plugin-lit-a11y) (`lit-a11y`) | Since v1.0.0 |
173
217
  | ![TailwindCSS](./assets/devicon-tailwindcss.svg) `betterTailwind` | ✅ (`tailwindcss` is installed) | [eslint-plugin-better-tailwindcss](https://npmjs.com/eslint-plugin-better-tailwindcss) (`better-tailwindcss`) | Since v1.0.0<br>Supports v4 and v3 |
174
218
  | ![TailwindCSS](./assets/devicon-tailwindcss.svg) `tailwind` | ❌ | [eslint-plugin-tailwindcss](https://npmjs.com/eslint-plugin-tailwindcss) (`tailwindcss`) | Only supports v3 |
175
219
 
@@ -224,18 +268,36 @@ Sub-config is a Config located within Config's options. If the parent config is
224
268
 
225
269
  ### Libraries
226
270
 
227
- | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
228
- | -------------- | ------------------------------------------- | ------------------------------------ | ----------------- |
229
- | `jest` | ✅ (`jest` is installed) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Since v0.3.0 |
230
- | `jest/extended` | ✅ (`jest-extended` is installed) | [eslint-plugin-jest-extended](https://npmjs.com/eslint-plugin-jest-extended) (`jest-extended`) | - |
231
- | `jest/typescript` | ✅ (`ts` config is enabled) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Only TypeScript-specific rules from `eslint-plugin-jest` |
232
- | `vitest` | (`vitest` is installed) | [@vitest/eslint-plugin](https://npmjs.com/package/@vitest/eslint-plugin) (`vitest`) | Since v0.3.0 |
233
- | `ava` | ✅ (`ava` is installed) | [eslint-plugin-ava](https://npmjs.com/eslint-plugin-ava) (`ava`) | Since v1.0.0 |
234
- | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary` | (`@testing-library/dom` is installed) | [eslint-plugin-testing-library](https://npmjs.com/eslint-plugin-testing-library) (`testing-library`) | Since v1.0.0 |
235
- | `tanstackQuery` | ✅ (`@tanstack/query-core` is installed) | [@tanstack/eslint-plugin-query](https://npmjs.com/package/@tanstack/eslint-plugin-query) (`@tanstack/query`) | Since v1.0.0 |
236
- | ![Storybook](./assets/logos-storybook-icon.svg) `storybook` | (`storybook` is installed) | [eslint-plugin-storybook](https://npmjs.com/eslint-plugin-storybook) (`storybook`) | Since v1.0.0 |
237
- | ![Cypress](./assets/vscode-icons-file-type-light-cypress.svg) `cypress` | ✅ (`cypress` is installed) | [eslint-plugin-cypress](https://npmjs.com/eslint-plugin-cypress) (`cypress`) | Since v1.0.0 |
238
- | ![Turborepo](./assets/material-icon-theme-turborepo.svg) `turbo` | (`turbo` is installed) | [eslint-plugin-turbo](https://npmjs.com/eslint-plugin-turbo) (`turbo`) | Since v1.0.0 |
271
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
272
+ | -------------- | -------------------------------------------------------------------- | ------------------------------------ | ----------------- |
273
+ | `jest` | ✅ (`jest` is installed) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Since v0.3.0 |
274
+ | `jest/extended` | ✅ (`jest-extended` is installed) | [eslint-plugin-jest-extended](https://npmjs.com/eslint-plugin-jest-extended) (`jest-extended`) | - |
275
+ | `jest/typescript` | ✅ (`ts` config is enabled) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Only TypeScript-specific rules from `eslint-plugin-jest` |
276
+ | `jest/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
277
+ | `vitest` | ✅ (`vitest` is installed) | [@vitest/eslint-plugin](https://npmjs.com/package/@vitest/eslint-plugin) (`vitest`) | Since v0.3.0 |
278
+ | `vitest/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
279
+ | `ava` | ✅ (`ava` is installed) | [eslint-plugin-ava](https://npmjs.com/eslint-plugin-ava) (`ava`) | Since v1.0.0 |
280
+ | `ava/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
281
+ | `qunit` | ✅ (`qunit` is installed) | [eslint-plugin-qunit](https://npmjs.com/eslint-plugin-qunit) (`qunit`) | Since v1.0.0 |
282
+ | `qunit/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
283
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary` | ✅ (`@testing-library/dom` is installed) | [eslint-plugin-testing-library](https://npmjs.com/eslint-plugin-testing-library) (`testing-library`) | Since v1.0.0 |
284
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/angular` | ✅ (`angular` config is enabled) | ^ | Since v1.0.0 |
285
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/marko` | ✅ (`marko` is installed) | ^ | Since v1.0.0 |
286
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/react` | ✅ (`react` config is enabled) | ^ | Since v1.0.0 |
287
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/svelte` | ✅ (`svelte` config is enabled) | ^ | Since v1.0.0 |
288
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/vue` | ✅ (`vue` config is enabled) | ^ | Since v1.0.0 |
289
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/*/noOnlyTests` | ✅ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
290
+ | `noOnlyTests` | ❌ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
291
+ | `tanstackQuery` | ✅ (`@tanstack/query-core` is installed) | [@tanstack/eslint-plugin-query](https://npmjs.com/package/@tanstack/eslint-plugin-query) (`@tanstack/query`) | Since v1.0.0 |
292
+ | ![Storybook](./assets/logos-storybook-icon.svg) `storybook` | ✅ (`storybook` is installed) | [eslint-plugin-storybook](https://npmjs.com/eslint-plugin-storybook) (`storybook`) | Since v1.0.0 |
293
+ | ![Cypress](./assets/vscode-icons-file-type-light-cypress.svg) `cypress` | ✅ (`cypress` is installed) | [eslint-plugin-cypress](https://npmjs.com/eslint-plugin-cypress) (`cypress`) | Since v1.0.0 |
294
+ | ![Cypress](./assets/vscode-icons-file-type-light-cypress.svg) `cypress/noOnlyTests` | ✅ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
295
+ | ![Mocha](./assets/devicon-mocha.svg) `mocha` | ✅ (`mocha` is installed) | [eslint-plugin-mocha](https://npmjs.com/eslint-plugin-mocha) (`mocha`) | Since v1.0.0 |
296
+ | ![Mocha](./assets/devicon-mocha.svg) `mocha/noOnlyTests` | ✅ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
297
+ | ![Turborepo](./assets/material-icon-theme-turborepo.svg) `turbo` | ✅ (`turbo` is installed) | [eslint-plugin-turbo](https://npmjs.com/eslint-plugin-turbo) (`turbo`) | Since v1.0.0 |
298
+ | ![Playwright](./assets/devicon-playwright.svg) `playwright` | ✅ (`playwright` is installed) | [eslint-plugin-playwright](https://npmjs.com/eslint-plugin-playwright) (`playwright`) | Since v1.0.0 |
299
+ | ![Playwright](./assets/devicon-playwright.svg) `playwright/noOnlyTests` | ❌ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
300
+ | ![Lodash](./assets/devicon-plain-lodash.svg) `youDontNeedLodashUnderscore` | ✅ (`lodash`, `lodash-es` or `lodash.*` is installed) | [eslint-plugin-you-dont-need-lodash-underscore](https://npmjs.com/eslint-plugin-you-dont-need-lodash-underscore) (`you-dont-need-lodash-underscore`) | Since v1.0.0 |
239
301
 
240
302
  ### Miscellaneous
241
303
 
@@ -247,6 +309,8 @@ Sub-config is a Config located within Config's options. If the parent config is
247
309
  | ![CSpell](./assets/vscode-icons-file-type-cspell.svg) `cspell` | ❌ | [@cspell/eslint-plugin](https://npmjs.com/package/@cspell/eslint-plugin) (`@cspell`) | Since v1.0.0 |
248
310
  | ![ESLint](./assets/devicon-eslint.svg) `eslintPlugin` | ❌ | [eslint-plugin-eslint-plugin](https://npmjs.com/eslint-plugin-eslint-plugin) (`eslint-plugin`) | Since v1.0.0<br>For linting ESLint plugins |
249
311
  | `fileProgress` | ❌ | [eslint-plugin-file-progress](https://npmjs.com/eslint-plugin-file-progress) (`file-progress`) | Since v1.0.0<br>An ESlint plugin to print file progress |
312
+ | `compat` | ❌ | [eslint-plugin-compat](https://npmjs.com/eslint-plugin-compat) (`compat`) | Since v1.0.0 |
313
+ | `webComponents` | ❌ | [eslint-plugin-wc](https://npmjs.com/eslint-plugin-wc) (`wc`) | Since v1.0.0 |
250
314
 
251
315
  ## How to use
252
316
 
@@ -382,9 +446,7 @@ By default, TypeScript rules will be enabled in `.vue` files if `enforceTypescri
382
446
 
383
447
  #### Angular
384
448
 
385
- We support Angular versions from 13 to 19, all at once. This is achieved by generating an ESLint plugin specifically for the detected Angular version. Internally, `@angular-eslint/eslint-plugin` of versions 19 and 18, and `@angular-eslint/eslint-plugin-template` of versions 17 and 19 are used. We smartly enable the appropriate rules for each Angular version.
386
-
387
- With this approach, we offer a unique ability to port the rules added in newer versions of `@angular-eslint/eslint-plugin*` and use them with older rules on older Angular codebases. Use `portRules` option to control which rules will be ported.
449
+ We support Angular versions from 13 to 20, all at once. You are expected to install `@angular-eslint/eslint-plugin` and `@angular-eslint/eslint-plugin-template` packages of the same major version as your Angular version, but installing a greater version would also likely work. With the latter, you can use the rules added in newer versions of `@angular-eslint/eslint-plugin*` on older Angular codebases.
388
450
 
389
451
  #### React
390
452
 
@@ -0,0 +1,102 @@
1
+ import { ERROR, GLOB_HTML, GLOB_JS_TS_X, OFF, WARNING, assignDefaults, cloneDeep, createConfigBuilder, fetchPackageInfo, interopDefault, pluginsLoaders } from "./eslint-CA-T1mGF.js";
2
+
3
+ //#region src/configs/angular.ts
4
+ const SUPPORTED_ANGULAR_VERSIONS = [
5
+ 13,
6
+ 14,
7
+ 15,
8
+ 16,
9
+ 17,
10
+ 18,
11
+ 19,
12
+ 20
13
+ ];
14
+ const LATEST_SUPPORTED_ANGULAR_VERSION = SUPPORTED_ANGULAR_VERSIONS.at(-1);
15
+ const angularUnConfig = async (context) => {
16
+ const optionsRaw = context.rootOptions.configs?.angular;
17
+ const optionsResolved = assignDefaults(optionsRaw, {
18
+ configTemplate: true,
19
+ processInlineTemplates: true,
20
+ componentClassSuffixes: ["Component"],
21
+ componentSelector: true,
22
+ componentStylesStyle: true,
23
+ directiveClassSuffixes: ["Directive"],
24
+ directiveSelector: true,
25
+ disallowedInputPrefixes: ["on"],
26
+ disallowAttributeDecorator: false,
27
+ disallowForwardRef: false
28
+ });
29
+ const angularVersion = optionsResolved.angularVersion ?? (() => {
30
+ const majorVersion = context.packagesInfo["@angular/core"]?.versions.major;
31
+ if (majorVersion != null && majorVersion >= SUPPORTED_ANGULAR_VERSIONS[0] && majorVersion <= LATEST_SUPPORTED_ANGULAR_VERSION) return majorVersion;
32
+ return optionsRaw === true ? LATEST_SUPPORTED_ANGULAR_VERSION : null;
33
+ })();
34
+ if (angularVersion == null) return null;
35
+ const { configTemplate, processInlineTemplates, componentClassSuffixes, componentSelector, componentStylesStyle, directiveClassSuffixes, directiveSelector, disallowedInputPrefixes, disallowAttributeDecorator, disallowForwardRef, pipePrefixes } = optionsResolved;
36
+ optionsResolved.preferStandaloneComponents ??= angularVersion >= 19;
37
+ const { preferStandaloneComponents } = optionsResolved;
38
+ const forbiddenMetadataProperties = {
39
+ inputs: true,
40
+ outputs: true,
41
+ queries: true,
42
+ ...optionsResolved.forbiddenMetadataProperties
43
+ };
44
+ const configBuilderGeneral = createConfigBuilder(context, optionsResolved, "@angular-eslint");
45
+ const [angularEslintPlugin, angularEslintPluginPackageInfo, angularTemplateEslintPlugin, angularTemplateEslintPluginPackageInfo, angularTemplateParserPackageInfo, extractInlineHtmlProcessor] = await Promise.all([
46
+ pluginsLoaders["@angular-eslint"](context).then(({ module }) => module),
47
+ fetchPackageInfo("@angular-eslint/eslint-plugin"),
48
+ pluginsLoaders["@angular-eslint/template"](context).then(({ module }) => module),
49
+ fetchPackageInfo("@angular-eslint/eslint-plugin-template"),
50
+ fetchPackageInfo("@angular-eslint/template-parser"),
51
+ interopDefault(import("@angular-eslint/eslint-plugin-template")).then((m) => m.processors["extract-inline-html"]).then((processor) => {
52
+ const fixedProcessor = cloneDeep(processor);
53
+ fixedProcessor.meta ||= { name: "extract-inline-html" };
54
+ return fixedProcessor;
55
+ })
56
+ ]);
57
+ [
58
+ [angularEslintPluginPackageInfo, "@angular-eslint/eslint-plugin"],
59
+ [angularTemplateEslintPluginPackageInfo, "@angular-eslint/eslint-plugin-template"],
60
+ [angularTemplateParserPackageInfo, "@angular-eslint/template-parser"]
61
+ ].forEach(([packageInfo, packageName]) => {
62
+ if (packageInfo?.versions.major != null && packageInfo.versions.major !== angularVersion) context.logger.warn(`Your \`${packageName}\` major version (${packageInfo.versions.major}) might not be compatible with the configured (or detected) Angular major version (${angularVersion}).`);
63
+ });
64
+ const angularEslintPluginRules = Object.keys(angularEslintPlugin?.rules || {});
65
+ const getAngularEslintPluginRuleSeverity = (ruleName, severity) => [ruleName, angularEslintPlugin && !angularEslintPluginRules.includes(ruleName) ? OFF : severity];
66
+ configBuilderGeneral?.addConfig(["angular/general", {
67
+ includeDefaultFilesAndIgnores: true,
68
+ filesFallback: [GLOB_JS_TS_X]
69
+ }], { ...processInlineTemplates && { processor: extractInlineHtmlProcessor } }).addRule(...getAngularEslintPluginRuleSeverity("component-class-suffix", componentClassSuffixes.length === 0 ? OFF : ERROR), [{ ...componentClassSuffixes.length > 0 && { suffixes: componentClassSuffixes } }]).addRule(...getAngularEslintPluginRuleSeverity("component-max-inline-declarations", OFF)).addRule(...getAngularEslintPluginRuleSeverity("component-selector", componentSelector === false ? OFF : ERROR), [{
70
+ type: ["element"],
71
+ style: "kebab-case",
72
+ ...typeof componentSelector === "object" && componentSelector
73
+ }]).addRule(...getAngularEslintPluginRuleSeverity("consistent-component-styles", componentStylesStyle === false ? OFF : ERROR), [typeof componentStylesStyle === "string" ? componentStylesStyle : "string"]).addRule(...getAngularEslintPluginRuleSeverity("contextual-decorator", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("contextual-lifecycle", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("directive-class-suffix", directiveClassSuffixes.length === 0 ? OFF : ERROR), [{ ...directiveClassSuffixes.length > 0 && { suffixes: directiveClassSuffixes } }]).addRule(...getAngularEslintPluginRuleSeverity("directive-selector", directiveSelector === false ? OFF : ERROR), [{
74
+ type: ["attribute"],
75
+ style: "camelCase",
76
+ ...typeof directiveSelector === "object" && directiveSelector
77
+ }]).addRule(...getAngularEslintPluginRuleSeverity("no-async-lifecycle-method", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-attribute-decorator", disallowAttributeDecorator ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("no-conflicting-lifecycle", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-developer-preview", WARNING)).addRule(...getAngularEslintPluginRuleSeverity("no-duplicates-in-metadata-arrays", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-empty-lifecycle-method", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-experimental", WARNING)).addRule(...getAngularEslintPluginRuleSeverity("no-forward-ref", disallowForwardRef ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("no-host-metadata-property", forbiddenMetadataProperties.host ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("prefer-output-emitter-ref", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-input-prefix", ERROR), [{ prefixes: disallowedInputPrefixes }]).addRule(...getAngularEslintPluginRuleSeverity("no-input-rename", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-inputs-metadata-property", forbiddenMetadataProperties.inputs ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("no-lifecycle-call", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-output-native", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-output-on-prefix", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-output-rename", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-outputs-metadata-property", forbiddenMetadataProperties.outputs ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("no-pipe-impure", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("no-queries-metadata-property", forbiddenMetadataProperties.queries ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("no-uncalled-signals", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("pipe-prefix", ERROR), [{ prefixes: pipePrefixes }]).addRule(...getAngularEslintPluginRuleSeverity("prefer-inject", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("prefer-on-push-component-change-detection", OFF)).addRule(...getAngularEslintPluginRuleSeverity("prefer-output-readonly", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("prefer-signals", OFF)).addRule(...getAngularEslintPluginRuleSeverity("prefer-standalone", preferStandaloneComponents && angularVersion >= 17 ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("prefer-standalone-component", preferStandaloneComponents && angularVersion < 17 ? ERROR : OFF)).addRule(...getAngularEslintPluginRuleSeverity("relative-url-prefix", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("require-lifecycle-on-prototype", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("require-localize-metadata", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("runtime-localize", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("sort-keys-in-type-decorator", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("sort-lifecycle-methods", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("sort-ngmodule-metadata-arrays", OFF)).addRule(...getAngularEslintPluginRuleSeverity("use-component-selector", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("use-component-view-encapsulation", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("use-injectable-provided-in", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("use-lifecycle-interface", ERROR)).addRule(...getAngularEslintPluginRuleSeverity("use-pipe-transform-interface", ERROR)).addOverrides();
78
+ const angularTemplateEslintPluginRules = Object.keys(angularTemplateEslintPlugin?.rules || {});
79
+ const getAngularEslintTemplatePluginRuleSeverity = (ruleName, severity) => [ruleName, angularTemplateEslintPlugin && !angularTemplateEslintPluginRules.includes(ruleName) ? OFF : severity];
80
+ const configTemplateOptions = assignDefaults(configTemplate, {
81
+ a11yRules: true,
82
+ preferControlFlow: angularVersion >= 19,
83
+ preferNgSrc: false,
84
+ requireLoopIndexes: false
85
+ });
86
+ const { a11yRules, preferControlFlow, preferNgSrc, requireLoopIndexes } = configTemplateOptions;
87
+ const a11yRulesSeverity = a11yRules === true ? ERROR : a11yRules === "warn" ? WARNING : OFF;
88
+ const configBuilderTemplate = createConfigBuilder(context, configTemplate, "@angular-eslint/template");
89
+ configBuilderTemplate?.addConfig(["angular/template", {
90
+ includeDefaultFilesAndIgnores: true,
91
+ filesFallback: [GLOB_HTML],
92
+ parser: "@angular-eslint/template-parser",
93
+ doNotIgnoreHtml: true
94
+ }]).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-alt-text", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-elements-content", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-interactive-supports-focus", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-label-for", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-label-has-associated-control", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-role-has-required-aria", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-table-scope", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("accessibility-valid-aria", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("alt-text", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("attributes-order", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("banana-in-box", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("button-has-type", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("click-events-have-key-events", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("conditional-complexity", OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("cyclomatic-complexity", OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("elements-content", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("eqeqeq", ERROR), [{ allowNullOrUndefined: true }]).addRule(...getAngularEslintTemplatePluginRuleSeverity("i18n", OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("interactive-supports-focus", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("label-has-associated-control", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("mouse-events-have-key-events", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-any", WARNING)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-autofocus", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-call-expression", OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-distracting-elements", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-duplicate-attributes", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-inline-styles", OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-interpolation-in-attributes", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-negated-async", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-nested-tags", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("no-positive-tabindex", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-at-empty", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-contextual-for-variables", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-control-flow", preferControlFlow ? ERROR : OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-ngsrc", preferNgSrc ? ERROR : OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-template-literal", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-self-closing-tags", OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("prefer-static-string-properties", ERROR)).addRule(...getAngularEslintTemplatePluginRuleSeverity("role-has-required-aria", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("table-scope", a11yRulesSeverity)).addRule(...getAngularEslintTemplatePluginRuleSeverity("use-track-by-function", requireLoopIndexes ? ERROR : OFF)).addRule(...getAngularEslintTemplatePluginRuleSeverity("valid-aria", a11yRulesSeverity)).addOverrides();
95
+ return {
96
+ configs: [configBuilderGeneral, configBuilderTemplate],
97
+ optionsResolved
98
+ };
99
+ };
100
+
101
+ //#endregion
102
+ export { angularUnConfig };
@@ -0,0 +1,51 @@
1
+ import { ERROR, GLOB_ASTRO, OFF, WARNING, assignDefaults, createConfigBuilder, interopDefault, pluginsLoaders } from "./eslint-CA-T1mGF.js";
2
+
3
+ //#region src/configs/astro.ts
4
+ const DEFAULT_ASTRO_FILES = [GLOB_ASTRO];
5
+ const astroUnConfig = async (context) => {
6
+ const [eslintPluginAstro, { parser: typescriptEslintParser }] = await Promise.all([pluginsLoaders.astro(context).then(({ module }) => module), interopDefault(import("typescript-eslint"))]);
7
+ if (!eslintPluginAstro) return null;
8
+ const optionsRaw = context.rootOptions.configs?.astro;
9
+ const optionsResolved = assignDefaults(optionsRaw, {
10
+ files: DEFAULT_ASTRO_FILES,
11
+ configJsxA11y: true
12
+ });
13
+ const { files: parentConfigFiles, ignores: parentConfigIgnores, configJsxA11y } = optionsResolved;
14
+ const configBuilder = createConfigBuilder(context, optionsResolved, "astro");
15
+ const isTypescriptEnabled = context.configsMeta.ts.enabled;
16
+ configBuilder?.addConfig(["astro/setup", {
17
+ filesFallback: [...DEFAULT_ASTRO_FILES, ...parentConfigFiles],
18
+ doNotIgnoreMarkdown: true,
19
+ parser: "astro-eslint-parser"
20
+ }], {
21
+ languageOptions: {
22
+ globals: eslintPluginAstro.environments.astro.globals,
23
+ parserOptions: { parser: isTypescriptEnabled ? typescriptEslintParser : void 0 },
24
+ sourceType: "module"
25
+ },
26
+ ...isTypescriptEnabled && { processor: eslintPluginAstro.processors["client-side-ts"] }
27
+ });
28
+ configBuilder?.addConfig(["astro", {
29
+ doNotIgnoreMarkdown: true,
30
+ includeDefaultFilesAndIgnores: true,
31
+ filesFallback: DEFAULT_ASTRO_FILES
32
+ }]).addRule("missing-client-only-directive-value", ERROR).addRule("no-conflict-set-directives", ERROR).addRule("no-deprecated-astro-canonicalurl", ERROR).addRule("no-deprecated-astro-fetchcontent", ERROR).addRule("no-deprecated-astro-resolve", ERROR).addRule("no-deprecated-getentrybyslug", ERROR).addRule("no-exports-from-components", ERROR).addRule("no-unused-define-vars-in-style", ERROR).addRule("valid-compile", ERROR).addRule("no-set-html-directive", ERROR).addRule("no-set-text-directive", OFF).addRule("no-unused-css-selector", WARNING).addRule("prefer-class-list-directive", ERROR).addRule("prefer-object-class-list", ERROR).addRule("prefer-split-class-list", ERROR).addRule("sort-attributes", ERROR).addRule("semi", OFF).addOverrides();
33
+ return {
34
+ configs: [configBuilder, ...configJsxA11y === false ? [] : await (async () => {
35
+ const { jsxA11yUnConfig } = await import("./jsx-a11y-V0-wCeTY.js");
36
+ const result = await jsxA11yUnConfig(context, {
37
+ prefix: "astro",
38
+ options: {
39
+ files: parentConfigFiles,
40
+ ignores: parentConfigIgnores,
41
+ ...typeof configJsxA11y === "object" && configJsxA11y
42
+ }
43
+ });
44
+ return result?.configs || [];
45
+ })()],
46
+ optionsResolved
47
+ };
48
+ };
49
+
50
+ //#endregion
51
+ export { astroUnConfig };
@@ -0,0 +1,23 @@
1
+ import { ERROR, GLOB_JS_TS_X_EXTENSION, OFF, WARNING, assignDefaults, createConfigBuilder } from "./eslint-CA-T1mGF.js";
2
+ import { RULES_TO_DISABLE_IN_TEST_FILES, generateConfigNoOnlyTestsBuilder, generateDefaultTestFiles } from "./shared-CjK2SSQm.js";
3
+
4
+ //#region src/configs/ava.ts
5
+ const avaUnConfig = (context) => {
6
+ const optionsRaw = context.rootOptions.configs?.ava;
7
+ const optionsResolved = assignDefaults(optionsRaw, { configNoOnlyTests: false });
8
+ const { configNoOnlyTests, enforceAssertionMessage, enforceMaxAssertions } = optionsResolved;
9
+ const configBuilder = createConfigBuilder(context, optionsResolved, "ava");
10
+ const configFilesFallback = generateDefaultTestFiles(GLOB_JS_TS_X_EXTENSION);
11
+ configBuilder?.addConfig(["ava", {
12
+ includeDefaultFilesAndIgnores: true,
13
+ filesFallback: configFilesFallback
14
+ }]).addRule("assertion-arguments", ERROR, enforceAssertionMessage == null ? [] : [{ message: enforceAssertionMessage ? "always" : "never" }]).addRule("hooks-order", ERROR).addRule("max-asserts", enforceMaxAssertions == null ? OFF : ERROR, enforceMaxAssertions == null ? [] : [enforceMaxAssertions]).addRule("no-async-fn-without-await", ERROR).addRule("no-duplicate-modifiers", ERROR).addRule("no-identical-title", ERROR).addRule("no-ignored-test-files", ERROR).addRule("no-import-test-files", ERROR).addRule("no-incorrect-deep-equal", ERROR).addRule("no-inline-assertions", ERROR).addRule("no-nested-tests", ERROR).addRule("no-only-test", ERROR).addRule("no-skip-assert", ERROR).addRule("no-skip-test", ERROR).addRule("no-todo-implementation", ERROR).addRule("no-todo-test", WARNING).addRule("no-unknown-modifiers", ERROR).addRule("prefer-async-await", ERROR).addRule("prefer-power-assert", OFF).addRule("prefer-t-regex", ERROR).addRule("test-title", ERROR).addRule("test-title-format", OFF).addRule("use-t", ERROR).addRule("use-t-throws-async-well", ERROR).addRule("use-t-well", ERROR).addRule("use-test", ERROR).addRule("use-true-false", ERROR).disableBulkRules(RULES_TO_DISABLE_IN_TEST_FILES).addOverrides();
15
+ const configBuilderNoOnlyTests = generateConfigNoOnlyTestsBuilder(context, "ava", configNoOnlyTests, optionsResolved, { filesFallback: configFilesFallback });
16
+ return {
17
+ configs: [configBuilder, configBuilderNoOnlyTests],
18
+ optionsResolved
19
+ };
20
+ };
21
+
22
+ //#endregion
23
+ export { avaUnConfig };
@@ -0,0 +1,22 @@
1
+ import { ERROR, OFF, WARNING, assignDefaults, createConfigBuilder } from "./eslint-CA-T1mGF.js";
2
+
3
+ //#region src/configs/better-tailwind.ts
4
+ const betterTailwindUnConfig = (context) => {
5
+ const optionsRaw = context.rootOptions.configs?.betterTailwind;
6
+ const optionsResolved = assignDefaults(optionsRaw, {});
7
+ const { settings: pluginSettings, breakUpClassesIntoMultipleLines, restrictedClasses } = optionsResolved;
8
+ const tailwindPackageInfo = context.packagesInfo.tailwindcss;
9
+ const tailwindRealMajorVersion = tailwindPackageInfo?.versions.major;
10
+ const tailwindMajorVersion = tailwindRealMajorVersion === 3 ? 3 : 4;
11
+ if (tailwindRealMajorVersion === 4 && !pluginSettings?.entryPoint) context.logger.warn("[betterTailwind] You haven't specified `settings.entryPoint` option which is required for `eslint-plugin-better-tailwindcss` to work properly with Tailwind 4");
12
+ if (tailwindRealMajorVersion != null && (tailwindRealMajorVersion < 3 || tailwindRealMajorVersion > 4)) context.logger.warn("[betterTailwind] The detected Tailwind version is not supported by `eslint-plugin-better-tailwindcss`");
13
+ const configBuilder = createConfigBuilder(context, optionsResolved, "better-tailwindcss");
14
+ configBuilder?.addConfig(["better-tailwindcss", { includeDefaultFilesAndIgnores: true }], { ...pluginSettings && { settings: { "better-tailwindcss": pluginSettings } } }).addRule("enforce-consistent-variable-syntax", tailwindMajorVersion === 3 ? OFF : WARNING).addRule("enforce-consistent-line-wrapping", breakUpClassesIntoMultipleLines ? WARNING : OFF, breakUpClassesIntoMultipleLines ? [breakUpClassesIntoMultipleLines] : []).addRule("no-duplicate-classes", WARNING).addRule("no-unnecessary-whitespace", WARNING).addRule("enforce-consistent-class-order", WARNING).addRule("no-conflicting-classes", ERROR).addRule("no-restricted-classes", restrictedClasses?.length ? ERROR : OFF, restrictedClasses?.length ? [{ restrict: restrictedClasses }] : []).addRule("no-unregistered-classes", OFF).addOverrides();
15
+ return {
16
+ configs: [configBuilder],
17
+ optionsResolved
18
+ };
19
+ };
20
+
21
+ //#endregion
22
+ export { betterTailwindUnConfig };
@@ -0,0 +1,22 @@
1
+ import { ERROR, assignDefaults, createConfigBuilder } from "./eslint-CA-T1mGF.js";
2
+
3
+ //#region src/configs/case-police.ts
4
+ const casePoliceUnConfig = (context) => {
5
+ const optionsRaw = context.rootOptions.configs?.casePolice;
6
+ const optionsResolved = assignDefaults(optionsRaw, {});
7
+ const configBuilder = createConfigBuilder(context, optionsResolved, "case-police");
8
+ configBuilder?.addConfig(["case-police", {
9
+ includeDefaultFilesAndIgnores: true,
10
+ doNotIgnoreCss: true,
11
+ doNotIgnoreHtml: true,
12
+ doNotIgnoreMarkdown: true,
13
+ doNotIgnoreMdx: true
14
+ }]).addRule("string-check", ERROR, [], { disableAutofix: true }).addOverrides();
15
+ return {
16
+ configs: [configBuilder],
17
+ optionsResolved
18
+ };
19
+ };
20
+
21
+ //#endregion
22
+ export { casePoliceUnConfig };
@@ -0,0 +1,26 @@
1
+ import { ERROR, GLOB_JS_TS_EXTENSION, assignDefaults, createConfigBuilder } from "./eslint-CA-T1mGF.js";
2
+
3
+ //#region src/configs/extra/cli.ts
4
+ const DEFAULT_CLI_DIRS = [
5
+ "bin",
6
+ "scripts",
7
+ "cli"
8
+ ];
9
+ const DEFAULT_CLI_FILES = ["cli"];
10
+ const cliUnConfig = (context) => {
11
+ const optionsRaw = context.rootOptions.configs?.cli;
12
+ const optionsResolved = assignDefaults(optionsRaw, {});
13
+ const { onlyTopLevelDirs } = optionsResolved;
14
+ const configBuilder = createConfigBuilder(context, optionsResolved, null);
15
+ configBuilder?.addConfig(["cli", {
16
+ includeDefaultFilesAndIgnores: true,
17
+ filesFallback: [...DEFAULT_CLI_DIRS.map((dir) => `${onlyTopLevelDirs ? "" : "**/"}${dir}/**/*.${GLOB_JS_TS_EXTENSION}`), ...DEFAULT_CLI_FILES.map((file) => `${onlyTopLevelDirs ? "" : "**/"}${file}.${GLOB_JS_TS_EXTENSION}`)]
18
+ }]).disableAnyRule("node", "hashbang").disableAnyRule("node", "no-process-exit").disableAnyRule("unicorn", "no-process-exit").disableAnyRule("", "no-await-in-loop").disableAnyRule("", "no-console").disableAnyRule("import", "no-extraneous-dependencies").addAnyRule("unicorn", "prefer-top-level-await", ERROR).disableAnyRule("node", "no-top-level-await").addOverrides();
19
+ return {
20
+ configs: [configBuilder],
21
+ optionsResolved
22
+ };
23
+ };
24
+
25
+ //#endregion
26
+ export { cliUnConfig };
@@ -0,0 +1,155 @@
1
+ import { ERROR, OFF, assignDefaults, createConfigBuilder } from "./eslint-CA-T1mGF.js";
2
+ import { esUnConfig } from "./es-CvoaEvOg.js";
3
+
4
+ //#region src/configs/extra/cloudfront-functions.ts
5
+ const genSyntaxNotAllowedErrorMessage = (syntax, isPlural = false) => `${syntax} ${isPlural ? "are" : "is"} not allowed in CloudFront functions`;
6
+ const getAllowedImports = (isV2 = true) => [
7
+ "querystring",
8
+ "crypto",
9
+ isV2 && "cloudfront"
10
+ ].filter((v) => typeof v === "string");
11
+ const cloudfrontFunctionsEslintConfig = async (context) => {
12
+ const optionsRaw = context.rootOptions.configs?.cloudfrontFunctions;
13
+ const optionsResolved = assignDefaults(optionsRaw, {});
14
+ const configs = await Promise.all([[1, optionsResolved.configV1 || {}], [2, optionsResolved]].map(async ([runtimeVersion, options]) => {
15
+ const isV2 = runtimeVersion === 2;
16
+ const { files, ignores } = options;
17
+ if (!files?.length && !ignores?.length) return [];
18
+ const configsEs = (await esUnConfig(context, {
19
+ prefix: `cloudfront-functions/v${runtimeVersion}/es-features`,
20
+ options: {
21
+ files,
22
+ ignores,
23
+ ecmaVersion: 5,
24
+ ecmaFeatures: {
25
+ 5: {},
26
+ 2015: {
27
+ arrowFunctions: true,
28
+ blockScopedVariables: isV2,
29
+ modules: true,
30
+ restParameters: true,
31
+ templateLiterals: true,
32
+ objectAssign: true,
33
+ objectIs: true,
34
+ objectSetPrototypeOf: true,
35
+ stringFromCodePoint: true,
36
+ stringPrototypeCodePointAt: true,
37
+ stringPrototypeEndsWith: true,
38
+ stringPrototypeIncludes: true,
39
+ stringPrototypeRepeat: true,
40
+ stringPrototypeStartsWith: true,
41
+ numberEpsilon: true,
42
+ numberIsFinite: true,
43
+ numberIsInteger: true,
44
+ numberIsNan: true,
45
+ numberIsSafeInteger: true,
46
+ numberMaxSafeInteger: true,
47
+ numberMinSafeInteger: true,
48
+ numberParseFloat: true,
49
+ numberParseInt: true,
50
+ mathAcosh: true,
51
+ mathAsinh: true,
52
+ mathAtanh: true,
53
+ mathCbrt: true,
54
+ mathClz32: true,
55
+ mathCosh: true,
56
+ mathExpm1: true,
57
+ mathFround: true,
58
+ mathHypot: true,
59
+ mathImul: true,
60
+ mathLog10: true,
61
+ mathLog1p: true,
62
+ mathLog2: true,
63
+ mathSign: true,
64
+ mathSinh: true,
65
+ mathTanh: true,
66
+ mathTrunc: true,
67
+ arrayOf: true,
68
+ arrayPrototypeCopyWithin: true,
69
+ arrayPrototypeFill: true,
70
+ arrayPrototypeFind: true,
71
+ arrayPrototypeFindIndex: true,
72
+ promise: true,
73
+ regexpPrototypeFlags: isV2,
74
+ typedArrays: true
75
+ },
76
+ 2016: { arrayPrototypeIncludes: true },
77
+ 2017: {
78
+ asyncFunctions: isV2,
79
+ objectEntries: true,
80
+ objectValues: true,
81
+ stringPrototypePadStartPadEnd: true
82
+ },
83
+ 2018: {
84
+ regexpSFlag: isV2,
85
+ promisePrototypeFinally: true
86
+ },
87
+ 2019: { stringPrototypeTrimStartTrimEnd: true },
88
+ 2020: { promiseAllSettled: isV2 },
89
+ 2021: {
90
+ stringPrototypeReplaceAll: isV2,
91
+ numericSeparators: isV2,
92
+ promiseAny: isV2
93
+ }
94
+ }
95
+ }
96
+ }))?.configs || [];
97
+ const allowedImports = getAllowedImports(isV2);
98
+ const configBuilder = createConfigBuilder(context, options, "");
99
+ configBuilder?.addConfig([`cloudfront-functions/v${runtimeVersion}`, { includeDefaultFilesAndIgnores: true }]).addAnyRule("", "no-unused-vars", ERROR, [{ varsIgnorePattern: "^handler$" }]).addRule("no-var", isV2 ? null : OFF).addRule("prefer-destructuring", OFF).addRule("prefer-object-has-own", OFF).addRule("vars-on-top", isV2 ? null : OFF).addAnyRule("unicorn", "prefer-logical-operator-over-ternary", OFF).addAnyRule("node", "prefer-node-protocol", OFF).addRule("no-restricted-syntax", ERROR, [
100
+ {
101
+ selector: "ExportNamedDeclaration",
102
+ message: genSyntaxNotAllowedErrorMessage("Named export statements", true)
103
+ },
104
+ {
105
+ selector: "ExportDefaultDeclaration",
106
+ message: genSyntaxNotAllowedErrorMessage("Default export statements", true)
107
+ },
108
+ {
109
+ selector: "ExportAllDeclaration",
110
+ message: genSyntaxNotAllowedErrorMessage("Re-export statements (export * from ...)", true)
111
+ },
112
+ {
113
+ selector: "CallExpression[callee.name='eval']",
114
+ message: genSyntaxNotAllowedErrorMessage("Use of `eval`")
115
+ },
116
+ {
117
+ selector: "NewExpression[callee.name='Function']",
118
+ message: genSyntaxNotAllowedErrorMessage("Use of `new Function()`")
119
+ },
120
+ {
121
+ selector: `ImportDeclaration:${allowedImports.map((module) => `not([source.value='${module}'])`).join(":")}`,
122
+ message: `Only specific modules are allowed to be imported in CloudFront functions: ${allowedImports.map((module) => `\`${module}\``).join(", ")}.`
123
+ },
124
+ {
125
+ selector: `CallExpression[callee.name='require']:${allowedImports.map((module) => `not([arguments.0.value='${module}'])`).join(":")}`,
126
+ message: `Only specific modules are allowed to be required in CloudFront functions: ${allowedImports.map((module) => `\`${module}\``).join(", ")}.`
127
+ }
128
+ ]).addRule("no-restricted-globals", ERROR, [
129
+ {
130
+ name: "setTimeout",
131
+ message: genSyntaxNotAllowedErrorMessage("`setTimeout`")
132
+ },
133
+ {
134
+ name: "clearTimeout",
135
+ message: genSyntaxNotAllowedErrorMessage("`clearTimeout`")
136
+ },
137
+ {
138
+ name: "setImmediate",
139
+ message: genSyntaxNotAllowedErrorMessage("`setImmediate`")
140
+ },
141
+ {
142
+ name: "process",
143
+ message: genSyntaxNotAllowedErrorMessage("Use of the `process` global")
144
+ }
145
+ ]).addAnyRule("node", "no-missing-import", ERROR, [{ allowModules: allowedImports }]).addAnyRule("node", "no-missing-require", ERROR, [{ allowModules: allowedImports }]).addOverrides();
146
+ return [...configsEs, configBuilder];
147
+ }));
148
+ return {
149
+ configs: configs.flat(),
150
+ optionsResolved
151
+ };
152
+ };
153
+
154
+ //#endregion
155
+ export { cloudfrontFunctionsEslintConfig };