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

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 (209) hide show
  1. package/README.md +98 -31
  2. package/dist/angular-DLww0Y26.js +102 -0
  3. package/dist/astro-D8AZOhD0.js +51 -0
  4. package/dist/ava-BYX2fcQY.js +23 -0
  5. package/dist/better-tailwind-LB2ljC-O.js +22 -0
  6. package/dist/case-police-D13FaTSd.js +22 -0
  7. package/dist/cli-CcfEmvXz.js +26 -0
  8. package/dist/cloudfront-functions-cQwLXILe.js +155 -0
  9. package/dist/compat-C20wxEDx.js +17 -0
  10. package/dist/cspell-k2hge3_L.js +23 -0
  11. package/dist/css-DnjE8VYB.js +36 -0
  12. package/dist/css-in-js-2f-NPkCZ.js +22 -0
  13. package/dist/cypress-dTklacpF.js +23 -0
  14. package/dist/de-morgan-CkTTseh9.js +19 -0
  15. package/dist/depend-DF_bzszc.js +22 -0
  16. package/dist/ember-D-f7y64Z.js +40 -0
  17. package/dist/erasable-syntax-only-DO7IYLUE.js +20 -0
  18. package/dist/es-B8Qglwrl.js +4 -0
  19. package/dist/es-D5FpQ6s2.js +51 -0
  20. package/dist/eslint-EtXkypa0.js +832 -0
  21. package/dist/eslint-comments-B2NDQ6Kh.js +21 -0
  22. package/dist/eslint-plugin-BFVOS_CU.js +25 -0
  23. package/dist/file-progress-DKuRv3KA.js +17 -0
  24. package/dist/graphql-CLSJvIBB.js +103 -0
  25. package/dist/header-vBG1QPuB.js +22 -0
  26. package/dist/headers-_T6ZZ792.js +17 -0
  27. package/dist/html-DvowoBtt.js +25 -0
  28. package/dist/import-BNB3_kr8.js +60 -0
  29. package/dist/index.d.ts +34864 -36246
  30. package/dist/index.js +514 -568
  31. package/dist/jest-DXuBRg2K.js +61 -0
  32. package/dist/js-inline-DHgBTs8h.js +60 -0
  33. package/dist/js-n4mP1pir.js +86 -0
  34. package/dist/jsdoc-BC7BXZYT.js +36 -0
  35. package/dist/json-schema-validator-BxmD6Vz6.js +28 -0
  36. package/dist/jsonc-D6R1JIdW.js +48 -0
  37. package/dist/jsx-a11y-Bh20kYfb.js +204 -0
  38. package/dist/lit-CUt2rqE7.js +30 -0
  39. package/dist/markdown-CGmZKpwf.js +74 -0
  40. package/dist/math-CJAXFvhL.js +17 -0
  41. package/dist/mdx-DId9JwCi.js +61 -0
  42. package/dist/mocha-B8H-483k.js +30 -0
  43. package/dist/nextjs-B-EHoXRb.js +20 -0
  44. package/dist/no-only-tests-DbqqmDPO.js +20 -0
  45. package/dist/no-stylistic-rules-C99vLoel.js +4101 -0
  46. package/dist/no-unsanitized-BFbI_1Hg.js +16 -0
  47. package/dist/node-dependencies-BbirEtUQ.js +25 -0
  48. package/dist/node-m7t6KkNy.js +24 -0
  49. package/dist/package-json-DRCBe_2x.js +4 -0
  50. package/dist/package-json-DgJi0RBN.js +60 -0
  51. package/dist/perfectionist-Dj33PTfD.js +67 -0
  52. package/dist/playwright--uPmQewp.js +23 -0
  53. package/dist/pnpm-CTgl-IZK.js +35 -0
  54. package/dist/prefer-arrow-functions-CTTOlwMn.js +19 -0
  55. package/dist/promise-CzfqFGAu.js +22 -0
  56. package/dist/qunit-DABfK18H.js +23 -0
  57. package/dist/qwik-CPtk4AmI.js +23 -0
  58. package/dist/react-BtoK89g2.js +238 -0
  59. package/dist/regexp-wD1bWyBG.js +19 -0
  60. package/dist/security-D5_Gp8kh.js +19 -0
  61. package/dist/shared-CH_yLc7K.js +163 -0
  62. package/dist/solid-B1O3gGSb.js +24 -0
  63. package/dist/sonar-DSLDNNZ0.js +28 -0
  64. package/dist/storybook-BjLNx6eG.js +20 -0
  65. package/dist/svelte-CZM7IxKh.js +71 -0
  66. package/dist/tailwind-lrOEqaW1.js +40 -0
  67. package/dist/tanstack-query-1XofMMVk.js +16 -0
  68. package/dist/testing-library-Cp9_qES-.js +49 -0
  69. package/dist/toml-BE1KCWVS.js +30 -0
  70. package/dist/ts-B2ArqOV5.js +451 -0
  71. package/dist/turbo-QGclpMqa.js +17 -0
  72. package/dist/unicorn-D8gfj0uM.js +25 -0
  73. package/dist/unused-imports-BeJkq73w.js +21 -0
  74. package/dist/vitest-DaczRodo.js +40 -0
  75. package/dist/vue-BI-r9DOJ.js +174 -0
  76. package/dist/web-components-BOXrki7A.js +17 -0
  77. package/dist/yaml-Bo9gZVkB.js +29 -0
  78. package/dist/you-dont-need-lodash-underscore-CdLskd-k.js +100 -0
  79. package/node_modules/@pkgr/core/index.d.cts +3 -0
  80. package/node_modules/@pkgr/core/lib/constants.d.ts +8 -0
  81. package/node_modules/@pkgr/core/lib/constants.js +9 -0
  82. package/node_modules/@pkgr/core/lib/constants.js.map +1 -0
  83. package/node_modules/@pkgr/core/lib/helpers.d.ts +5 -0
  84. package/node_modules/@pkgr/core/lib/helpers.js +45 -0
  85. package/node_modules/@pkgr/core/lib/helpers.js.map +1 -0
  86. package/node_modules/@pkgr/core/lib/index.cjs +65 -0
  87. package/node_modules/@pkgr/core/lib/index.d.ts +2 -0
  88. package/node_modules/@pkgr/core/lib/index.js +3 -0
  89. package/node_modules/@pkgr/core/lib/index.js.map +1 -0
  90. package/node_modules/@pkgr/core/package.json +38 -0
  91. package/node_modules/eslint-plugin-no-type-assertion/LICENSE +21 -0
  92. package/node_modules/eslint-plugin-no-type-assertion/README.md +61 -0
  93. package/node_modules/eslint-plugin-no-type-assertion/lib/index.js +3 -0
  94. package/node_modules/eslint-plugin-no-type-assertion/lib/rules/no-type-assertion.js +55 -0
  95. package/node_modules/eslint-plugin-no-type-assertion/package.json +35 -0
  96. package/node_modules/eslint-plugin-prettier/LICENSE.md +24 -0
  97. package/node_modules/eslint-plugin-prettier/README.md +202 -0
  98. package/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.d.ts +5 -0
  99. package/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js +309 -0
  100. package/node_modules/eslint-plugin-prettier/package.json +60 -0
  101. package/node_modules/eslint-plugin-prettier/recommended.d.ts +12 -0
  102. package/node_modules/eslint-plugin-prettier/recommended.js +18 -0
  103. package/node_modules/eslint-plugin-prettier/worker.mjs +191 -0
  104. package/node_modules/fast-diff/LICENSE +201 -0
  105. package/node_modules/fast-diff/README.md +24 -0
  106. package/node_modules/fast-diff/diff.d.ts +21 -0
  107. package/node_modules/fast-diff/diff.js +1138 -0
  108. package/node_modules/fast-diff/package.json +30 -0
  109. package/node_modules/prettier-linter-helpers/.editorconfig +15 -0
  110. package/node_modules/prettier-linter-helpers/.eslintignore +2 -0
  111. package/node_modules/prettier-linter-helpers/.eslintrc.js +6 -0
  112. package/node_modules/prettier-linter-helpers/.github/CONTRIBUTING.md +41 -0
  113. package/node_modules/prettier-linter-helpers/.prettierignore +1 -0
  114. package/node_modules/prettier-linter-helpers/.prettierrc +6 -0
  115. package/node_modules/prettier-linter-helpers/.vscode/settings.json +12 -0
  116. package/node_modules/prettier-linter-helpers/LICENSE.md +24 -0
  117. package/node_modules/prettier-linter-helpers/README.md +14 -0
  118. package/node_modules/prettier-linter-helpers/index.js +145 -0
  119. package/node_modules/prettier-linter-helpers/package.json +38 -0
  120. package/node_modules/prettier-linter-helpers/test/index.test.js +29 -0
  121. package/node_modules/synckit/LICENSE +21 -0
  122. package/node_modules/synckit/README.md +256 -0
  123. package/node_modules/synckit/lib/common.d.ts +5 -0
  124. package/node_modules/synckit/lib/common.js +22 -0
  125. package/node_modules/synckit/lib/common.js.map +1 -0
  126. package/node_modules/synckit/lib/constants.d.ts +38 -0
  127. package/node_modules/synckit/lib/constants.js +54 -0
  128. package/node_modules/synckit/lib/constants.js.map +1 -0
  129. package/node_modules/synckit/lib/helpers.d.ts +27 -0
  130. package/node_modules/synckit/lib/helpers.js +413 -0
  131. package/node_modules/synckit/lib/helpers.js.map +1 -0
  132. package/node_modules/synckit/lib/index.cjs +590 -0
  133. package/node_modules/synckit/lib/index.d.cts +138 -0
  134. package/node_modules/synckit/lib/index.d.ts +7 -0
  135. package/node_modules/synckit/lib/index.js +73 -0
  136. package/node_modules/synckit/lib/index.js.map +1 -0
  137. package/node_modules/synckit/lib/types.d.ts +48 -0
  138. package/node_modules/synckit/lib/types.js +2 -0
  139. package/node_modules/synckit/lib/types.js.map +1 -0
  140. package/node_modules/synckit/package.json +45 -0
  141. package/package.json +294 -78
  142. package/deps/angular-eslint-eslint-plugin-18.4.3.tgz +0 -0
  143. package/deps/angular-eslint-eslint-plugin-template-17.5.3.tgz +0 -0
  144. package/dist/angular-I35S5TJH.js +0 -310
  145. package/dist/astro-MLSGY523.js +0 -79
  146. package/dist/ava-CAB2XAKV.js +0 -42
  147. package/dist/better-tailwind-NA5OXT2H.js +0 -61
  148. package/dist/case-police-KMZSDSFQ.js +0 -29
  149. package/dist/chunk-FGAYX7NU.js +0 -267
  150. package/dist/chunk-HKH2EDN6.js +0 -137
  151. package/dist/chunk-L7NY4DIR.js +0 -938
  152. package/dist/chunk-MCOXOJTL.js +0 -261
  153. package/dist/chunk-RRWPVU6R.js +0 -96
  154. package/dist/cli-7VWSINFJ.js +0 -37
  155. package/dist/cloudfront-functions-J3ZL2G7J.js +0 -195
  156. package/dist/cspell-KNSKMNWV.js +0 -30
  157. package/dist/css-4C5B5QF6.js +0 -57
  158. package/dist/css-in-js-ABBJATKZ.js +0 -45
  159. package/dist/cypress-45S7U2IO.js +0 -35
  160. package/dist/de-morgan-JZ4JTOTR.js +0 -20
  161. package/dist/depend-XWLM6SPV.js +0 -33
  162. package/dist/ember-JM7X4YIN.js +0 -66
  163. package/dist/erasable-syntax-only-VFSUE2CS.js +0 -29
  164. package/dist/es-ZQWFEZ5B.js +0 -7
  165. package/dist/eslint-comments-GGQMOKBE.js +0 -37
  166. package/dist/eslint-plugin-KK6S5YF2.js +0 -54
  167. package/dist/file-progress-PXQ5E6ZB.js +0 -29
  168. package/dist/graphql-PQYKHC4Z.js +0 -150
  169. package/dist/html-OLR7NJPB.js +0 -45
  170. package/dist/import-EVB7KBNB.js +0 -80
  171. package/dist/jest-4SOUHP7H.js +0 -132
  172. package/dist/js-WGUYBQB5.js +0 -87
  173. package/dist/js-inline-SF6EL5O2.js +0 -91
  174. package/dist/jsdoc-KMLZKKGT.js +0 -70
  175. package/dist/json-schema-validator-RWRUMTWK.js +0 -80
  176. package/dist/jsonc-EHTQMHF3.js +0 -55
  177. package/dist/jsx-a11y-XJXMXHQT.js +0 -7
  178. package/dist/markdown-RIUVNCJH.js +0 -167
  179. package/dist/math-D7C3M6DY.js +0 -28
  180. package/dist/mdx-CQMRG7EH.js +0 -127
  181. package/dist/nextjs-O3ZBLJKX.js +0 -38
  182. package/dist/no-stylistic-rules-TDZMA2QP.js +0 -7044
  183. package/dist/no-unsanitized-RCDGAB3H.js +0 -20
  184. package/dist/node-4R37GFKD.js +0 -60
  185. package/dist/node-dependencies-P66DDLRP.js +0 -40
  186. package/dist/package-json-EY64FXUV.js +0 -9
  187. package/dist/perfectionist-TYM4X3IE.js +0 -115
  188. package/dist/pnpm-GNIQAYQ2.js +0 -63
  189. package/dist/prefer-arrow-functions-GE7ETKBL.js +0 -26
  190. package/dist/promise-W4IRNE3V.js +0 -22
  191. package/dist/qwik-ONACLAWX.js +0 -37
  192. package/dist/react-M2OHKXEL.js +0 -521
  193. package/dist/regexp-5P5WG6DD.js +0 -22
  194. package/dist/security-BOD7G3FC.js +0 -22
  195. package/dist/solid-ODNLS7SN.js +0 -43
  196. package/dist/sonar-Z6F7MNH6.js +0 -35
  197. package/dist/storybook-FTCC76IN.js +0 -36
  198. package/dist/svelte-GPW3LGHY.js +0 -122
  199. package/dist/tailwind-M2454UPC.js +0 -50
  200. package/dist/tanstack-query-GD4D2UDP.js +0 -20
  201. package/dist/testing-library-HFSYANBY.js +0 -108
  202. package/dist/toml-2WTWKMRI.js +0 -53
  203. package/dist/ts-KLDZ6EFW.js +0 -703
  204. package/dist/turbo-MJMSZ63M.js +0 -25
  205. package/dist/unicorn-XZ6MBR47.js +0 -24
  206. package/dist/unused-imports-7MBVNHIW.js +0 -35
  207. package/dist/vitest-DRRMX77G.js +0 -81
  208. package/dist/vue-TE4ETXYZ.js +0 -368
  209. package/dist/yaml-H3HW2OFQ.js +0 -62
package/README.md CHANGED
@@ -31,32 +31,74 @@ 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
+ | `@intlify/vue-i18n` | `@intlify/eslint-plugin-vue-i18n` |
67
+ | `@next/next` | `@next/eslint-plugin-next` |
68
+ | `@tanstack/query` | `@tanstack/eslint-plugin-query` |
69
+ | `astro` | `eslint-plugin-astro` |
70
+ | `ava` | `eslint-plugin-ava` |
71
+ | `better-tailwindcss` | `eslint-plugin-better-tailwindcss` |
72
+ | `case-police` | `eslint-plugin-case-police` |
73
+ | `de-morgan` | `eslint-plugin-de-morgan` |
74
+ | `ember` | `eslint-plugin-ember` |
75
+ | `erasable-syntax-only` | `eslint-plugin-erasable-syntax-only` |
76
+ | `es` | `eslint-plugin-es-x` |
77
+ | `eslint-plugin` | `eslint-plugin-eslint-plugin` |
78
+ | `graphql` | `@graphql-eslint/eslint-plugin` |
79
+ | `header` | `eslint-plugin-header` |
80
+ | `headers` | `eslint-plugin-headers` |
81
+ | `jest-extended` | `eslint-plugin-jest-extended` |
82
+ | `jest` | `eslint-plugin-jest` |
83
+ | `perfectionist` | `eslint-plugin-perfectionist` |
84
+ | `pinia` | `eslint-plugin-pinia` |
85
+ | `playwright` | `eslint-plugin-playwright` |
86
+ | `prefer-arrow-functions` | `eslint-plugin-prefer-arrow-functions` |
87
+ | `qunit` | `eslint-plugin-qunit` |
88
+ | `qwik` | `eslint-plugin-qwik` |
89
+ | `react-compiler` | `eslint-plugin-react-compiler` |
90
+ | `react-hooks` | `eslint-plugin-react-hooks` |
91
+ | `react-refresh` | `eslint-plugin-react-refresh` |
92
+ | `react` | `eslint-plugin-react` |
93
+ | `solid` | `eslint-plugin-solid` |
94
+ | `storybook` | `eslint-plugin-storybook` |
95
+ | `svelte` | `eslint-plugin-svelte` |
96
+ | `tailwindcss` | `eslint-plugin-tailwindcss` |
97
+ | `testing-library` | `eslint-plugin-testing-library` |
98
+ | `turbo` | `eslint-plugin-turbo` |
99
+ | `vitest` | `@vitest/eslint-plugin` |
100
+ | `vue` | `eslint-plugin-vue` |
101
+ | `vuejs-accessibility` | `eslint-plugin-vuejs-accessibility` |
60
102
  </details>
61
103
 
62
104
  ### Usage
@@ -162,6 +204,7 @@ Sub-config is a Config located within Config's options. If the parent config is
162
204
  | ![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
205
  | ![ReactJS](./assets/devicon-react.svg) `react/refresh` | ✅ | [eslint-plugin-react-refresh](https://npmjs.com/eslint-plugin-react-refresh) (`react-refresh`) | - |
164
206
  | ![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`) | - |
207
+ | ![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
208
  | ![ReactJS](./assets/devicon-react.svg) `react/allowDefaultExportsInJsxFiles` | ✅ | - | Config that allows default exports in all JSX files |
166
209
  | ![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
210
  | ![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 +213,10 @@ Sub-config is a Config located within Config's options. If the parent config is
170
213
  | ![Astro](./assets/devicon-astro.svg) `astro/jsxA11y` | ✅ | ^ | Only A11Y rules from `eslint-plugin-astro` |
171
214
  | ![Svelte](./assets/devicon-svelte.svg) `svelte` | ✅ (`svelte` is installed) | [eslint-plugin-svelte](https://npmjs.com/eslint-plugin-svelte) (`svelte`) | Since v0.10.0 |
172
215
  | ![Ember](./assets/devicon-ember.svg) `ember` | ✅ (`ember-source` is installed) | [eslint-plugin-ember](https://npmjs.com/eslint-plugin-ember) (`ember`) | Since v1.0.0 |
216
+ | ![Ember](./assets/devicon-ember.svg) `ember/testFiles` | ✅ | ^ | Since v1.0.0 |
217
+ | ![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 |
218
+ | ![Lit](./assets/logos-lit-icon.svg) `lit` | ✅ (`lit` is installed) | [eslint-plugin-lit](https://npmjs.com/eslint-plugin-lit) (`lit`) | Since v1.0.0 |
219
+ | ![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
220
  | ![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
221
  | ![TailwindCSS](./assets/devicon-tailwindcss.svg) `tailwind` | ❌ | [eslint-plugin-tailwindcss](https://npmjs.com/eslint-plugin-tailwindcss) (`tailwindcss`) | Only supports v3 |
175
222
 
@@ -224,18 +271,36 @@ Sub-config is a Config located within Config's options. If the parent config is
224
271
 
225
272
  ### Libraries
226
273
 
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 |
274
+ | Un config name | Enabled by default?<br>(optional condition) | Primary plugin(s) (`default-prefix`) | Description/Notes |
275
+ | -------------- | -------------------------------------------------------------------- | ------------------------------------ | ----------------- |
276
+ | `jest` | ✅ (`jest` is installed) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Since v0.3.0 |
277
+ | `jest/extended` | ✅ (`jest-extended` is installed) | [eslint-plugin-jest-extended](https://npmjs.com/eslint-plugin-jest-extended) (`jest-extended`) | - |
278
+ | `jest/typescript` | ✅ (`ts` config is enabled) | [eslint-plugin-jest](https://npmjs.com/eslint-plugin-jest) (`jest`) | Only TypeScript-specific rules from `eslint-plugin-jest` |
279
+ | `jest/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
280
+ | `vitest` | ✅ (`vitest` is installed) | [@vitest/eslint-plugin](https://npmjs.com/package/@vitest/eslint-plugin) (`vitest`) | Since v0.3.0 |
281
+ | `vitest/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
282
+ | `ava` | ✅ (`ava` is installed) | [eslint-plugin-ava](https://npmjs.com/eslint-plugin-ava) (`ava`) | Since v1.0.0 |
283
+ | `ava/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
284
+ | `qunit` | ✅ (`qunit` is installed) | [eslint-plugin-qunit](https://npmjs.com/eslint-plugin-qunit) (`qunit`) | Since v1.0.0 |
285
+ | `qunit/noOnlyTests` | | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
286
+ | ![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 |
287
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/angular` | ✅ (`angular` config is enabled) | ^ | Since v1.0.0 |
288
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/marko` | ✅ (`marko` is installed) | ^ | Since v1.0.0 |
289
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/react` | ✅ (`react` config is enabled) | ^ | Since v1.0.0 |
290
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/svelte` | ✅ (`svelte` config is enabled) | ^ | Since v1.0.0 |
291
+ | ![Testing Library](./assets/logos-testing-library.svg) `testingLibrary/vue` | ✅ (`vue` config is enabled) | ^ | Since v1.0.0 |
292
+ | ![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 |
293
+ | `noOnlyTests` | ❌ | [eslint-plugin-no-only-tests](https://npmjs.com/eslint-plugin-no-only-tests) (`no-only-tests`) | Since v1.0.0 |
294
+ | `tanstackQuery` | ✅ (`@tanstack/query-core` is installed) | [@tanstack/eslint-plugin-query](https://npmjs.com/package/@tanstack/eslint-plugin-query) (`@tanstack/query`) | Since v1.0.0 |
295
+ | ![Storybook](./assets/logos-storybook-icon.svg) `storybook` | ✅ (`storybook` is installed) | [eslint-plugin-storybook](https://npmjs.com/eslint-plugin-storybook) (`storybook`) | Since v1.0.0 |
296
+ | ![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 |
297
+ | ![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 |
298
+ | ![Mocha](./assets/devicon-mocha.svg) `mocha` | ✅ (`mocha` is installed) | [eslint-plugin-mocha](https://npmjs.com/eslint-plugin-mocha) (`mocha`) | Since v1.0.0 |
299
+ | ![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 |
300
+ | ![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 |
301
+ | ![Playwright](./assets/devicon-playwright.svg) `playwright` | ✅ (`playwright` is installed) | [eslint-plugin-playwright](https://npmjs.com/eslint-plugin-playwright) (`playwright`) | Since v1.0.0 |
302
+ | ![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 |
303
+ | ![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
304
 
240
305
  ### Miscellaneous
241
306
 
@@ -247,6 +312,10 @@ Sub-config is a Config located within Config's options. If the parent config is
247
312
  | ![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
313
  | ![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
314
  | `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 |
315
+ | `compat` | ❌ | [eslint-plugin-compat](https://npmjs.com/eslint-plugin-compat) (`compat`) | Since v1.0.0 |
316
+ | `webComponents` | ❌ | [eslint-plugin-wc](https://npmjs.com/eslint-plugin-wc) (`wc`) | Since v1.0.0 |
317
+ | `header` | ❌ | [eslint-plugin-header](https://npmjs.com/eslint-plugin-header) (`header`) | Since v1.0.0 |
318
+ | `headers` | ❌ | [eslint-plugin-headers](https://npmjs.com/eslint-plugin-headers) (`headers`) | Since v1.0.0 |
250
319
 
251
320
  ## How to use
252
321
 
@@ -382,9 +451,7 @@ By default, TypeScript rules will be enabled in `.vue` files if `enforceTypescri
382
451
 
383
452
  #### Angular
384
453
 
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.
454
+ 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
455
 
389
456
  #### React
390
457
 
@@ -0,0 +1,102 @@
1
+ import { ERROR, GLOB_HTML, GLOB_JS_TS_X, OFF, WARNING, assignDefaults, cloneDeep, createConfigBuilder, fetchPackageInfo, interopDefault, pluginsLoaders } from "./eslint-EtXkypa0.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-EtXkypa0.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-Bh20kYfb.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-EtXkypa0.js";
2
+ import { RULES_TO_DISABLE_IN_TEST_FILES, generateConfigNoOnlyTestsBuilder, generateDefaultTestFiles } from "./shared-CH_yLc7K.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-EtXkypa0.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-EtXkypa0.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-EtXkypa0.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-EtXkypa0.js";
2
+ import { esUnConfig } from "./es-D5FpQ6s2.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 };