eslint-plugin-stylelint-2 1.0.9

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 (268) hide show
  1. package/CHANGELOG.md +329 -0
  2. package/LICENSE +21 -0
  3. package/README.md +174 -0
  4. package/dist/_internal/rule-docs-url.d.ts +15 -0
  5. package/dist/_internal/rule-docs-url.d.ts.map +1 -0
  6. package/dist/_internal/rule-docs-url.js +15 -0
  7. package/dist/_internal/rule-docs-url.js.map +1 -0
  8. package/dist/_internal/rules-registry.d.ts +88 -0
  9. package/dist/_internal/rules-registry.d.ts.map +1 -0
  10. package/dist/_internal/rules-registry.js +85 -0
  11. package/dist/_internal/rules-registry.js.map +1 -0
  12. package/dist/_internal/stylelint-config-boolean-option-rule.d.ts +17 -0
  13. package/dist/_internal/stylelint-config-boolean-option-rule.d.ts.map +1 -0
  14. package/dist/_internal/stylelint-config-boolean-option-rule.js +90 -0
  15. package/dist/_internal/stylelint-config-boolean-option-rule.js.map +1 -0
  16. package/dist/_internal/stylelint-config-disallowed-option-rule.d.ts +16 -0
  17. package/dist/_internal/stylelint-config-disallowed-option-rule.d.ts.map +1 -0
  18. package/dist/_internal/stylelint-config-disallowed-option-rule.js +48 -0
  19. package/dist/_internal/stylelint-config-disallowed-option-rule.js.map +1 -0
  20. package/dist/_internal/stylelint-config-object.d.ts +62 -0
  21. package/dist/_internal/stylelint-config-object.d.ts.map +1 -0
  22. package/dist/_internal/stylelint-config-object.js +114 -0
  23. package/dist/_internal/stylelint-config-object.js.map +1 -0
  24. package/dist/_internal/stylelint-config-package-option-rule.d.ts +12 -0
  25. package/dist/_internal/stylelint-config-package-option-rule.d.ts.map +1 -0
  26. package/dist/_internal/stylelint-config-package-option-rule.js +66 -0
  27. package/dist/_internal/stylelint-config-package-option-rule.js.map +1 -0
  28. package/dist/_internal/stylelint-config-rules-object.d.ts +23 -0
  29. package/dist/_internal/stylelint-config-rules-object.d.ts.map +1 -0
  30. package/dist/_internal/stylelint-config-rules-object.js +47 -0
  31. package/dist/_internal/stylelint-config-rules-object.js.map +1 -0
  32. package/dist/_internal/stylelint-config-string-array-option-rule.d.ts +27 -0
  33. package/dist/_internal/stylelint-config-string-array-option-rule.d.ts.map +1 -0
  34. package/dist/_internal/stylelint-config-string-array-option-rule.js +234 -0
  35. package/dist/_internal/stylelint-config-string-array-option-rule.js.map +1 -0
  36. package/dist/_internal/stylelint-config-string-array-option.d.ts +32 -0
  37. package/dist/_internal/stylelint-config-string-array-option.d.ts.map +1 -0
  38. package/dist/_internal/stylelint-config-string-array-option.js +55 -0
  39. package/dist/_internal/stylelint-config-string-array-option.js.map +1 -0
  40. package/dist/_internal/stylelint-package-dependencies.d.ts +18 -0
  41. package/dist/_internal/stylelint-package-dependencies.d.ts.map +1 -0
  42. package/dist/_internal/stylelint-package-dependencies.js +107 -0
  43. package/dist/_internal/stylelint-package-dependencies.js.map +1 -0
  44. package/dist/_internal/stylelint-runner.d.ts +4 -0
  45. package/dist/_internal/stylelint-runner.d.ts.map +1 -0
  46. package/dist/_internal/stylelint-runner.js +93 -0
  47. package/dist/_internal/stylelint-runner.js.map +1 -0
  48. package/dist/_internal/stylelint-worker-types.d.ts +70 -0
  49. package/dist/_internal/stylelint-worker-types.d.ts.map +1 -0
  50. package/dist/_internal/stylelint-worker-types.js +2 -0
  51. package/dist/_internal/stylelint-worker-types.js.map +1 -0
  52. package/dist/_internal/stylelint-worker.d.ts +2 -0
  53. package/dist/_internal/stylelint-worker.d.ts.map +1 -0
  54. package/dist/_internal/stylelint-worker.js +113 -0
  55. package/dist/_internal/stylelint-worker.js.map +1 -0
  56. package/dist/_internal/stylelint2-config-references.d.ts +32 -0
  57. package/dist/_internal/stylelint2-config-references.d.ts.map +1 -0
  58. package/dist/_internal/stylelint2-config-references.js +65 -0
  59. package/dist/_internal/stylelint2-config-references.js.map +1 -0
  60. package/dist/_internal/typed-rule.d.ts +42 -0
  61. package/dist/_internal/typed-rule.d.ts.map +1 -0
  62. package/dist/_internal/typed-rule.js +53 -0
  63. package/dist/_internal/typed-rule.js.map +1 -0
  64. package/dist/plugin.cjs +1 -0
  65. package/dist/plugin.d.cts +10 -0
  66. package/dist/plugin.d.ts +36 -0
  67. package/dist/plugin.d.ts.map +1 -0
  68. package/dist/plugin.js +183 -0
  69. package/dist/plugin.js.map +1 -0
  70. package/dist/rules/disallow-stylelint-allow-empty-input.d.ts +9 -0
  71. package/dist/rules/disallow-stylelint-allow-empty-input.d.ts.map +1 -0
  72. package/dist/rules/disallow-stylelint-allow-empty-input.js +29 -0
  73. package/dist/rules/disallow-stylelint-allow-empty-input.js.map +1 -0
  74. package/dist/rules/disallow-stylelint-configuration-comment.d.ts +9 -0
  75. package/dist/rules/disallow-stylelint-configuration-comment.d.ts.map +1 -0
  76. package/dist/rules/disallow-stylelint-configuration-comment.js +29 -0
  77. package/dist/rules/disallow-stylelint-configuration-comment.js.map +1 -0
  78. package/dist/rules/disallow-stylelint-custom-syntax.d.ts +12 -0
  79. package/dist/rules/disallow-stylelint-custom-syntax.d.ts.map +1 -0
  80. package/dist/rules/disallow-stylelint-custom-syntax.js +32 -0
  81. package/dist/rules/disallow-stylelint-custom-syntax.js.map +1 -0
  82. package/dist/rules/disallow-stylelint-default-severity.d.ts +9 -0
  83. package/dist/rules/disallow-stylelint-default-severity.d.ts.map +1 -0
  84. package/dist/rules/disallow-stylelint-default-severity.js +28 -0
  85. package/dist/rules/disallow-stylelint-default-severity.js.map +1 -0
  86. package/dist/rules/disallow-stylelint-duplicate-extends.d.ts +9 -0
  87. package/dist/rules/disallow-stylelint-duplicate-extends.d.ts.map +1 -0
  88. package/dist/rules/disallow-stylelint-duplicate-extends.js +29 -0
  89. package/dist/rules/disallow-stylelint-duplicate-extends.js.map +1 -0
  90. package/dist/rules/disallow-stylelint-duplicate-plugins.d.ts +9 -0
  91. package/dist/rules/disallow-stylelint-duplicate-plugins.d.ts.map +1 -0
  92. package/dist/rules/disallow-stylelint-duplicate-plugins.js +29 -0
  93. package/dist/rules/disallow-stylelint-duplicate-plugins.js.map +1 -0
  94. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.d.ts +10 -0
  95. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.d.ts.map +1 -0
  96. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.js +171 -0
  97. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.js.map +1 -0
  98. package/dist/rules/disallow-stylelint-empty-rules-object.d.ts +7 -0
  99. package/dist/rules/disallow-stylelint-empty-rules-object.d.ts.map +1 -0
  100. package/dist/rules/disallow-stylelint-empty-rules-object.js +65 -0
  101. package/dist/rules/disallow-stylelint-empty-rules-object.js.map +1 -0
  102. package/dist/rules/disallow-stylelint-ignore-disables.d.ts +9 -0
  103. package/dist/rules/disallow-stylelint-ignore-disables.d.ts.map +1 -0
  104. package/dist/rules/disallow-stylelint-ignore-disables.js +28 -0
  105. package/dist/rules/disallow-stylelint-ignore-disables.js.map +1 -0
  106. package/dist/rules/disallow-stylelint-ignore-files.d.ts +9 -0
  107. package/dist/rules/disallow-stylelint-ignore-files.d.ts.map +1 -0
  108. package/dist/rules/disallow-stylelint-ignore-files.js +28 -0
  109. package/dist/rules/disallow-stylelint-ignore-files.js.map +1 -0
  110. package/dist/rules/disallow-stylelint-null-rule-config.d.ts +7 -0
  111. package/dist/rules/disallow-stylelint-null-rule-config.d.ts.map +1 -0
  112. package/dist/rules/disallow-stylelint-null-rule-config.js +86 -0
  113. package/dist/rules/disallow-stylelint-null-rule-config.js.map +1 -0
  114. package/dist/rules/disallow-stylelint-overrides-runtime-options.d.ts +7 -0
  115. package/dist/rules/disallow-stylelint-overrides-runtime-options.d.ts.map +1 -0
  116. package/dist/rules/disallow-stylelint-overrides-runtime-options.js +124 -0
  117. package/dist/rules/disallow-stylelint-overrides-runtime-options.js.map +1 -0
  118. package/dist/rules/disallow-stylelint-processors.d.ts +9 -0
  119. package/dist/rules/disallow-stylelint-processors.d.ts.map +1 -0
  120. package/dist/rules/disallow-stylelint-processors.js +29 -0
  121. package/dist/rules/disallow-stylelint-processors.js.map +1 -0
  122. package/dist/rules/disallow-stylelint-relative-extends-paths.d.ts +9 -0
  123. package/dist/rules/disallow-stylelint-relative-extends-paths.d.ts.map +1 -0
  124. package/dist/rules/disallow-stylelint-relative-extends-paths.js +28 -0
  125. package/dist/rules/disallow-stylelint-relative-extends-paths.js.map +1 -0
  126. package/dist/rules/disallow-stylelint-relative-plugin-paths.d.ts +9 -0
  127. package/dist/rules/disallow-stylelint-relative-plugin-paths.d.ts.map +1 -0
  128. package/dist/rules/disallow-stylelint-relative-plugin-paths.js +28 -0
  129. package/dist/rules/disallow-stylelint-relative-plugin-paths.js.map +1 -0
  130. package/dist/rules/prefer-stylelint-cache.d.ts +9 -0
  131. package/dist/rules/prefer-stylelint-cache.d.ts.map +1 -0
  132. package/dist/rules/prefer-stylelint-cache.js +28 -0
  133. package/dist/rules/prefer-stylelint-cache.js.map +1 -0
  134. package/dist/rules/prefer-stylelint-define-config.d.ts +7 -0
  135. package/dist/rules/prefer-stylelint-define-config.d.ts.map +1 -0
  136. package/dist/rules/prefer-stylelint-define-config.js +82 -0
  137. package/dist/rules/prefer-stylelint-define-config.js.map +1 -0
  138. package/dist/rules/prefer-stylelint-extends-array.d.ts +9 -0
  139. package/dist/rules/prefer-stylelint-extends-array.d.ts.map +1 -0
  140. package/dist/rules/prefer-stylelint-extends-array.js +29 -0
  141. package/dist/rules/prefer-stylelint-extends-array.js.map +1 -0
  142. package/dist/rules/prefer-stylelint-fix.d.ts +7 -0
  143. package/dist/rules/prefer-stylelint-fix.d.ts.map +1 -0
  144. package/dist/rules/prefer-stylelint-fix.js +90 -0
  145. package/dist/rules/prefer-stylelint-fix.js.map +1 -0
  146. package/dist/rules/prefer-stylelint-formatter.d.ts +10 -0
  147. package/dist/rules/prefer-stylelint-formatter.d.ts.map +1 -0
  148. package/dist/rules/prefer-stylelint-formatter.js +77 -0
  149. package/dist/rules/prefer-stylelint-formatter.js.map +1 -0
  150. package/dist/rules/prefer-stylelint-plugins-array.d.ts +9 -0
  151. package/dist/rules/prefer-stylelint-plugins-array.d.ts.map +1 -0
  152. package/dist/rules/prefer-stylelint-plugins-array.js +29 -0
  153. package/dist/rules/prefer-stylelint-plugins-array.js.map +1 -0
  154. package/dist/rules/prefer-stylelint-report-descriptionless-disables.d.ts +12 -0
  155. package/dist/rules/prefer-stylelint-report-descriptionless-disables.d.ts.map +1 -0
  156. package/dist/rules/prefer-stylelint-report-descriptionless-disables.js +32 -0
  157. package/dist/rules/prefer-stylelint-report-descriptionless-disables.js.map +1 -0
  158. package/dist/rules/prefer-stylelint-report-invalid-scope-disables.d.ts +12 -0
  159. package/dist/rules/prefer-stylelint-report-invalid-scope-disables.d.ts.map +1 -0
  160. package/dist/rules/prefer-stylelint-report-invalid-scope-disables.js +32 -0
  161. package/dist/rules/prefer-stylelint-report-invalid-scope-disables.js.map +1 -0
  162. package/dist/rules/prefer-stylelint-report-needless-disables.d.ts +9 -0
  163. package/dist/rules/prefer-stylelint-report-needless-disables.d.ts.map +1 -0
  164. package/dist/rules/prefer-stylelint-report-needless-disables.js +29 -0
  165. package/dist/rules/prefer-stylelint-report-needless-disables.js.map +1 -0
  166. package/dist/rules/prefer-stylelint-report-unscoped-disables.d.ts +9 -0
  167. package/dist/rules/prefer-stylelint-report-unscoped-disables.d.ts.map +1 -0
  168. package/dist/rules/prefer-stylelint-report-unscoped-disables.js +29 -0
  169. package/dist/rules/prefer-stylelint-report-unscoped-disables.js.map +1 -0
  170. package/dist/rules/require-stylelint-config-file-naming-convention.d.ts +13 -0
  171. package/dist/rules/require-stylelint-config-file-naming-convention.d.ts.map +1 -0
  172. package/dist/rules/require-stylelint-config-file-naming-convention.js +58 -0
  173. package/dist/rules/require-stylelint-config-file-naming-convention.js.map +1 -0
  174. package/dist/rules/require-stylelint-custom-syntax-in-overrides.d.ts +7 -0
  175. package/dist/rules/require-stylelint-custom-syntax-in-overrides.d.ts.map +1 -0
  176. package/dist/rules/require-stylelint-custom-syntax-in-overrides.js +100 -0
  177. package/dist/rules/require-stylelint-custom-syntax-in-overrides.js.map +1 -0
  178. package/dist/rules/require-stylelint-extends-packages-installed.d.ts +12 -0
  179. package/dist/rules/require-stylelint-extends-packages-installed.d.ts.map +1 -0
  180. package/dist/rules/require-stylelint-extends-packages-installed.js +31 -0
  181. package/dist/rules/require-stylelint-extends-packages-installed.js.map +1 -0
  182. package/dist/rules/require-stylelint-overrides-configuration.d.ts +7 -0
  183. package/dist/rules/require-stylelint-overrides-configuration.d.ts.map +1 -0
  184. package/dist/rules/require-stylelint-overrides-configuration.js +100 -0
  185. package/dist/rules/require-stylelint-overrides-configuration.js.map +1 -0
  186. package/dist/rules/require-stylelint-overrides-files-array.d.ts +7 -0
  187. package/dist/rules/require-stylelint-overrides-files-array.d.ts.map +1 -0
  188. package/dist/rules/require-stylelint-overrides-files-array.js +99 -0
  189. package/dist/rules/require-stylelint-overrides-files-array.js.map +1 -0
  190. package/dist/rules/require-stylelint-overrides-files.d.ts +7 -0
  191. package/dist/rules/require-stylelint-overrides-files.d.ts.map +1 -0
  192. package/dist/rules/require-stylelint-overrides-files.js +104 -0
  193. package/dist/rules/require-stylelint-overrides-files.js.map +1 -0
  194. package/dist/rules/require-stylelint-plugins-packages-installed.d.ts +12 -0
  195. package/dist/rules/require-stylelint-plugins-packages-installed.d.ts.map +1 -0
  196. package/dist/rules/require-stylelint-plugins-packages-installed.js +31 -0
  197. package/dist/rules/require-stylelint-plugins-packages-installed.js.map +1 -0
  198. package/dist/rules/require-stylelint-report-disables.d.ts +9 -0
  199. package/dist/rules/require-stylelint-report-disables.d.ts.map +1 -0
  200. package/dist/rules/require-stylelint-report-disables.js +29 -0
  201. package/dist/rules/require-stylelint-report-disables.js.map +1 -0
  202. package/dist/rules/require-stylelint-rules-object.d.ts +7 -0
  203. package/dist/rules/require-stylelint-rules-object.d.ts.map +1 -0
  204. package/dist/rules/require-stylelint-rules-object.js +65 -0
  205. package/dist/rules/require-stylelint-rules-object.js.map +1 -0
  206. package/dist/rules/sort-stylelint-extends.d.ts +9 -0
  207. package/dist/rules/sort-stylelint-extends.d.ts.map +1 -0
  208. package/dist/rules/sort-stylelint-extends.js +28 -0
  209. package/dist/rules/sort-stylelint-extends.js.map +1 -0
  210. package/dist/rules/sort-stylelint-plugins.d.ts +9 -0
  211. package/dist/rules/sort-stylelint-plugins.d.ts.map +1 -0
  212. package/dist/rules/sort-stylelint-plugins.js +28 -0
  213. package/dist/rules/sort-stylelint-plugins.js.map +1 -0
  214. package/dist/rules/sort-stylelint-rule-keys.d.ts +7 -0
  215. package/dist/rules/sort-stylelint-rule-keys.d.ts.map +1 -0
  216. package/dist/rules/sort-stylelint-rule-keys.js +129 -0
  217. package/dist/rules/sort-stylelint-rule-keys.js.map +1 -0
  218. package/dist/rules/stylelint.d.ts +15 -0
  219. package/dist/rules/stylelint.d.ts.map +1 -0
  220. package/dist/rules/stylelint.js +157 -0
  221. package/dist/rules/stylelint.js.map +1 -0
  222. package/docs/rules/disallow-stylelint-allow-empty-input.md +62 -0
  223. package/docs/rules/disallow-stylelint-configuration-comment.md +62 -0
  224. package/docs/rules/disallow-stylelint-custom-syntax.md +70 -0
  225. package/docs/rules/disallow-stylelint-default-severity.md +77 -0
  226. package/docs/rules/disallow-stylelint-duplicate-extends.md +61 -0
  227. package/docs/rules/disallow-stylelint-duplicate-plugins.md +61 -0
  228. package/docs/rules/disallow-stylelint-duplicate-rule-option-values.md +73 -0
  229. package/docs/rules/disallow-stylelint-empty-rules-object.md +62 -0
  230. package/docs/rules/disallow-stylelint-ignore-disables.md +78 -0
  231. package/docs/rules/disallow-stylelint-ignore-files.md +78 -0
  232. package/docs/rules/disallow-stylelint-null-rule-config.md +63 -0
  233. package/docs/rules/disallow-stylelint-overrides-runtime-options.md +82 -0
  234. package/docs/rules/disallow-stylelint-processors.md +62 -0
  235. package/docs/rules/disallow-stylelint-relative-extends-paths.md +61 -0
  236. package/docs/rules/disallow-stylelint-relative-plugin-paths.md +61 -0
  237. package/docs/rules/getting-started.md +130 -0
  238. package/docs/rules/overview.md +99 -0
  239. package/docs/rules/prefer-stylelint-cache.md +79 -0
  240. package/docs/rules/prefer-stylelint-define-config.md +90 -0
  241. package/docs/rules/prefer-stylelint-extends-array.md +61 -0
  242. package/docs/rules/prefer-stylelint-fix.md +79 -0
  243. package/docs/rules/prefer-stylelint-formatter.md +80 -0
  244. package/docs/rules/prefer-stylelint-plugins-array.md +61 -0
  245. package/docs/rules/prefer-stylelint-report-descriptionless-disables.md +85 -0
  246. package/docs/rules/prefer-stylelint-report-invalid-scope-disables.md +83 -0
  247. package/docs/rules/prefer-stylelint-report-needless-disables.md +83 -0
  248. package/docs/rules/prefer-stylelint-report-unscoped-disables.md +83 -0
  249. package/docs/rules/presets/all.md +39 -0
  250. package/docs/rules/presets/configs.md +40 -0
  251. package/docs/rules/presets/configuration.md +64 -0
  252. package/docs/rules/presets/index.md +82 -0
  253. package/docs/rules/presets/recommended.md +40 -0
  254. package/docs/rules/presets/stylelint-only.md +42 -0
  255. package/docs/rules/require-stylelint-config-file-naming-convention.md +61 -0
  256. package/docs/rules/require-stylelint-custom-syntax-in-overrides.md +77 -0
  257. package/docs/rules/require-stylelint-extends-packages-installed.md +61 -0
  258. package/docs/rules/require-stylelint-overrides-configuration.md +80 -0
  259. package/docs/rules/require-stylelint-overrides-files-array.md +78 -0
  260. package/docs/rules/require-stylelint-overrides-files.md +83 -0
  261. package/docs/rules/require-stylelint-plugins-packages-installed.md +61 -0
  262. package/docs/rules/require-stylelint-report-disables.md +67 -0
  263. package/docs/rules/require-stylelint-rules-object.md +61 -0
  264. package/docs/rules/sort-stylelint-extends.md +61 -0
  265. package/docs/rules/sort-stylelint-plugins.md +61 -0
  266. package/docs/rules/sort-stylelint-rule-keys.md +65 -0
  267. package/docs/rules/stylelint.md +100 -0
  268. package/package.json +577 -0
@@ -0,0 +1,61 @@
1
+ # require-stylelint-config-file-naming-convention
2
+
3
+ Require canonical `stylelint.config.*` naming for shared Stylelint config files.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ Reports Stylelint config files that are valid config targets but do not follow canonical `stylelint.config.*` naming.
14
+
15
+ ## Why this rule exists
16
+
17
+ Canonical filenames improve discoverability in editors, scripts, and monorepos. Mixed `.stylelintrc*` and `stylelint.config.*` naming increases operational drift.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```js
22
+ // .stylelintrc.js
23
+ export default {
24
+ rules: {},
25
+ };
26
+ ```
27
+
28
+ ## ✅ Correct
29
+
30
+ ```ts
31
+ // stylelint.config.ts
32
+ export default {
33
+ rules: {},
34
+ };
35
+ ```
36
+
37
+ ## Behavior and migration notes
38
+
39
+ This rule reports non-canonical filenames and does not auto-fix because file renaming is outside safe text-fixer scope.
40
+
41
+ ## ESLint flat config example
42
+
43
+ ```ts
44
+ import stylelint2 from "eslint-plugin-stylelint-2";
45
+
46
+ export default [stylelint2.configs.configuration];
47
+ ```
48
+
49
+ ## When not to use it
50
+
51
+ Do not use this rule if your repository intentionally standardizes on `.stylelintrc*` filenames.
52
+
53
+ ## Package documentation
54
+
55
+ Stylelint package documentation:
56
+
57
+ > **Rule catalog ID:** R035
58
+
59
+ ## Further reading
60
+
61
+ - [Stylelint config formats](https://stylelint.io/user-guide/configure/)
@@ -0,0 +1,77 @@
1
+ # require-stylelint-custom-syntax-in-overrides
2
+
3
+ Require top-level `customSyntax` usage to be moved into scoped `overrides` entries.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ This rule reports top-level `customSyntax` declarations that are not mirrored by at least one override entry with a concrete `customSyntax` value.
14
+
15
+ ## Why this rule exists
16
+
17
+ Global syntax declarations can accidentally affect unrelated file types. Declaring syntax inside overrides keeps parser behavior explicit and file-scoped.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ customSyntax: "postcss-scss",
24
+ rules: {
25
+ "color-no-invalid-hex": true,
26
+ },
27
+ };
28
+ ```
29
+
30
+ ## ✅ Correct
31
+
32
+ ```ts
33
+ export default {
34
+ customSyntax: "postcss-scss",
35
+ overrides: [
36
+ {
37
+ customSyntax: "postcss-scss",
38
+ files: ["**/*.scss"],
39
+ rules: {
40
+ "at-rule-no-unknown": null,
41
+ },
42
+ },
43
+ ],
44
+ rules: {
45
+ "color-no-invalid-hex": true,
46
+ },
47
+ };
48
+ ```
49
+
50
+ ## Behavior and migration notes
51
+
52
+ - This rule reports unscoped top-level `customSyntax` usage.
53
+ - It does not auto-fix because correct override file patterns are repository-specific.
54
+ - Pair this with `disallow-stylelint-custom-syntax` for stricter top-level policy.
55
+
56
+ ## ESLint flat config example
57
+
58
+ ```ts
59
+ import stylelint2 from "eslint-plugin-stylelint-2";
60
+
61
+ export default [stylelint2.configs.configuration];
62
+ ```
63
+
64
+ ## When not to use it
65
+
66
+ Do not use this rule if your repository intentionally applies one global syntax for all linted files.
67
+
68
+ ## Package documentation
69
+
70
+ Stylelint package documentation:
71
+
72
+ > **Rule catalog ID:** R020
73
+
74
+ ## Further reading
75
+
76
+ - [Stylelint customSyntax](https://stylelint.io/user-guide/configure/#customsyntax)
77
+ - [Stylelint overrides](https://stylelint.io/user-guide/configure/#overrides)
@@ -0,0 +1,61 @@
1
+ # require-stylelint-extends-packages-installed
2
+
3
+ Require top-level Stylelint `extends` package specifiers to be listed in workspace dependencies.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ Reports package-backed `extends` entries that do not resolve to a declared dependency in the nearest workspace package.json.
14
+
15
+ ## Why this rule exists
16
+
17
+ Shared Stylelint configs should reference installed packages explicitly. Missing dependency declarations create non-reproducible lint behavior across machines and CI jobs.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ extends: ["stylelint-config-does-not-exist"],
24
+ rules: {},
25
+ };
26
+ ```
27
+
28
+ ## ✅ Correct
29
+
30
+ ```ts
31
+ export default {
32
+ extends: ["stylelint-config-standard"],
33
+ rules: {},
34
+ };
35
+ ```
36
+
37
+ ## Behavior and migration notes
38
+
39
+ This rule reports unresolved package references and does not auto-fix because dependency installation strategy is repository-specific.
40
+
41
+ ## ESLint flat config example
42
+
43
+ ```ts
44
+ import stylelint2 from "eslint-plugin-stylelint-2";
45
+
46
+ export default [stylelint2.configs.configuration];
47
+ ```
48
+
49
+ ## When not to use it
50
+
51
+ Do not use this rule if your repository intentionally resolves `extends` packages through non-package-manager mechanisms.
52
+
53
+ ## Package documentation
54
+
55
+ Stylelint package documentation:
56
+
57
+ > **Rule catalog ID:** R033
58
+
59
+ ## Further reading
60
+
61
+ - [Stylelint extends](https://stylelint.io/user-guide/configure/#extends)
@@ -0,0 +1,80 @@
1
+ # require-stylelint-overrides-configuration
2
+
3
+ Require each Stylelint `overrides` entry to include effective configuration content beyond `files` and optional `name`.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ This rule reports override entries that only contain structural fields (`files` and optional `name`) and no effective config payload (for example `rules`, `customSyntax`, `extends`, `plugins`).
14
+
15
+ ## Why this rule exists
16
+
17
+ Stylelint override entries are intended to apply specific configuration changes to a file subset. Entries without effective config content are misleading and increase maintenance noise.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ overrides: [
24
+ {
25
+ files: ["**/*.scss"],
26
+ name: "SCSS files",
27
+ },
28
+ ],
29
+ rules: {
30
+ "color-no-invalid-hex": true,
31
+ },
32
+ };
33
+ ```
34
+
35
+ ## ✅ Correct
36
+
37
+ ```ts
38
+ export default {
39
+ overrides: [
40
+ {
41
+ files: ["**/*.scss"],
42
+ customSyntax: "postcss-scss",
43
+ rules: {
44
+ "at-rule-no-unknown": null,
45
+ },
46
+ },
47
+ ],
48
+ rules: {
49
+ "color-no-invalid-hex": true,
50
+ },
51
+ };
52
+ ```
53
+
54
+ ## Behavior and migration notes
55
+
56
+ - This rule reports override entries that contain no effective config payload.
57
+ - It intentionally skips entries with spread elements (`...foo`) because static analysis cannot safely prove whether effective config content is present.
58
+ - It does not auto-fix because the correct override payload is repository-specific.
59
+
60
+ ## ESLint flat config example
61
+
62
+ ```ts
63
+ import stylelint2 from "eslint-plugin-stylelint-2";
64
+
65
+ export default [stylelint2.configs.configuration];
66
+ ```
67
+
68
+ ## When not to use it
69
+
70
+ Do not use this rule if your repository intentionally keeps placeholder override entries as an intermediate migration step.
71
+
72
+ ## Package documentation
73
+
74
+ Stylelint package documentation:
75
+
76
+ > **Rule catalog ID:** R037
77
+
78
+ ## Further reading
79
+
80
+ - [Stylelint `overrides`](https://stylelint.io/user-guide/configure/#overrides)
@@ -0,0 +1,78 @@
1
+ # require-stylelint-overrides-files-array
2
+
3
+ Require each Stylelint `overrides` entry `files` value to be an explicit non-empty array of glob strings.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ This rule reports override `files` values that are not explicit non-empty string arrays, including:
14
+
15
+ - scalar strings (`files: "**/*.scss"`)
16
+ - empty arrays (`files: []`)
17
+ - arrays containing non-string or empty elements
18
+
19
+ ## Why this rule exists
20
+
21
+ Stylelint documents `overrides.files` as an array of glob patterns. Enforcing explicit arrays makes override scope predictable and easier to review at scale.
22
+
23
+ ## ❌ Incorrect
24
+
25
+ ```ts
26
+ export default {
27
+ overrides: [
28
+ {
29
+ files: "**/*.scss",
30
+ rules: {
31
+ "at-rule-no-unknown": null,
32
+ },
33
+ },
34
+ ],
35
+ };
36
+ ```
37
+
38
+ ## ✅ Correct
39
+
40
+ ```ts
41
+ export default {
42
+ overrides: [
43
+ {
44
+ files: ["**/*.scss"],
45
+ rules: {
46
+ "at-rule-no-unknown": null,
47
+ },
48
+ },
49
+ ],
50
+ };
51
+ ```
52
+
53
+ ## Behavior and migration notes
54
+
55
+ - This rule reports invalid `overrides.files` array shape.
56
+ - It does not auto-fix because converting dynamic patterns to explicit globs requires repository-specific intent.
57
+
58
+ ## ESLint flat config example
59
+
60
+ ```ts
61
+ import stylelint2 from "eslint-plugin-stylelint-2";
62
+
63
+ export default [stylelint2.configs.configuration];
64
+ ```
65
+
66
+ ## When not to use it
67
+
68
+ Do not use this rule if your repository intentionally allows dynamic glob expressions for override matching.
69
+
70
+ ## Package documentation
71
+
72
+ Stylelint package documentation:
73
+
74
+ > **Rule catalog ID:** R038
75
+
76
+ ## Further reading
77
+
78
+ - [Stylelint `overrides`](https://stylelint.io/user-guide/configure/#overrides)
@@ -0,0 +1,83 @@
1
+ # require-stylelint-overrides-files
2
+
3
+ Require every Stylelint `overrides` entry to define a non-empty `files` matcher.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ This rule reports override entries that:
14
+
15
+ - omit `files`, or
16
+ - set `files` to an empty string, or
17
+ - set `files` to an empty array.
18
+
19
+ ## Why this rule exists
20
+
21
+ Overrides without explicit file scope are brittle and easy to misread. A non-empty `files` matcher makes override intent explicit and auditable.
22
+
23
+ ## ❌ Incorrect
24
+
25
+ ```ts
26
+ export default {
27
+ overrides: [
28
+ {
29
+ rules: {
30
+ "at-rule-no-unknown": null,
31
+ },
32
+ },
33
+ ],
34
+ rules: {
35
+ "color-no-invalid-hex": true,
36
+ },
37
+ };
38
+ ```
39
+
40
+ ## ✅ Correct
41
+
42
+ ```ts
43
+ export default {
44
+ overrides: [
45
+ {
46
+ files: ["**/*.scss"],
47
+ rules: {
48
+ "at-rule-no-unknown": null,
49
+ },
50
+ },
51
+ ],
52
+ rules: {
53
+ "color-no-invalid-hex": true,
54
+ },
55
+ };
56
+ ```
57
+
58
+ ## Behavior and migration notes
59
+
60
+ - This rule reports invalid or missing `files` in override entries.
61
+ - It does not auto-fix because correct glob scopes are repository-specific.
62
+
63
+ ## ESLint flat config example
64
+
65
+ ```ts
66
+ import stylelint2 from "eslint-plugin-stylelint-2";
67
+
68
+ export default [stylelint2.configs.configuration];
69
+ ```
70
+
71
+ ## When not to use it
72
+
73
+ Do not use this rule if your repository intentionally permits non-standard override objects without explicit file globs.
74
+
75
+ ## Package documentation
76
+
77
+ Stylelint package documentation:
78
+
79
+ > **Rule catalog ID:** R019
80
+
81
+ ## Further reading
82
+
83
+ - [Stylelint overrides](https://stylelint.io/user-guide/configure/#overrides)
@@ -0,0 +1,61 @@
1
+ # require-stylelint-plugins-packages-installed
2
+
3
+ Require top-level Stylelint `plugins` package specifiers to be listed in workspace dependencies.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ Reports package-backed `plugins` entries that do not resolve to a declared dependency in the nearest workspace package.json.
14
+
15
+ ## Why this rule exists
16
+
17
+ Plugin references in shared config should be reproducible across contributors and CI. Missing plugin dependency declarations are a common source of broken lint runs.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ plugins: ["stylelint-plugin-does-not-exist"],
24
+ rules: {},
25
+ };
26
+ ```
27
+
28
+ ## ✅ Correct
29
+
30
+ ```ts
31
+ export default {
32
+ plugins: ["stylelint-order"],
33
+ rules: {},
34
+ };
35
+ ```
36
+
37
+ ## Behavior and migration notes
38
+
39
+ This rule reports unresolved package references and does not auto-fix because dependency installation strategy is repository-specific.
40
+
41
+ ## ESLint flat config example
42
+
43
+ ```ts
44
+ import stylelint2 from "eslint-plugin-stylelint-2";
45
+
46
+ export default [stylelint2.configs.configuration];
47
+ ```
48
+
49
+ ## When not to use it
50
+
51
+ Do not use this rule if your repository intentionally loads plugins from non-standard dependency resolution paths.
52
+
53
+ ## Package documentation
54
+
55
+ Stylelint package documentation:
56
+
57
+ > **Rule catalog ID:** R034
58
+
59
+ ## Further reading
60
+
61
+ - [Stylelint plugins](https://stylelint.io/user-guide/configure/#plugins)
@@ -0,0 +1,67 @@
1
+ # require-stylelint-report-disables
2
+
3
+ Require `reportDisables: true` in authored Stylelint config files.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ Reports configs where `reportDisables` is missing or explicitly set to `false`.
14
+
15
+ ## Why this rule exists
16
+
17
+ Disable-comment usage should stay visible during lint runs. Enabling `reportDisables` improves governance and reviewability in shared lint policy.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ rules: {},
24
+ };
25
+ ```
26
+
27
+ ```ts
28
+ export default {
29
+ reportDisables: false,
30
+ rules: {},
31
+ };
32
+ ```
33
+
34
+ ## ✅ Correct
35
+
36
+ ```ts
37
+ export default {
38
+ reportDisables: true,
39
+ rules: {},
40
+ };
41
+ ```
42
+
43
+ ## Behavior and migration notes
44
+
45
+ This rule auto-fixes by inserting or setting `reportDisables: true`.
46
+
47
+ ## ESLint flat config example
48
+
49
+ ```ts
50
+ import stylelint2 from "eslint-plugin-stylelint-2";
51
+
52
+ export default [stylelint2.configs.configuration];
53
+ ```
54
+
55
+ ## When not to use it
56
+
57
+ Do not use this rule if your team intentionally suppresses disable-comment reporting.
58
+
59
+ ## Package documentation
60
+
61
+ Stylelint package documentation:
62
+
63
+ > **Rule catalog ID:** R029
64
+
65
+ ## Further reading
66
+
67
+ - [Stylelint reportDisables](https://stylelint.io/user-guide/configure/#reportdisables)
@@ -0,0 +1,61 @@
1
+ # require-stylelint-rules-object
2
+
3
+ Require a top-level `rules` object in authored Stylelint config files.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ This rule reports Stylelint config objects that do not define a top-level `rules` property.
14
+
15
+ ## Why this rule exists
16
+
17
+ A missing `rules` object often indicates partial or placeholder config exports that are hard to review and reason about. Requiring an explicit `rules` object keeps lint intent visible.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ reportDescriptionlessDisables: true,
24
+ };
25
+ ```
26
+
27
+ ## ✅ Correct
28
+
29
+ ```ts
30
+ export default {
31
+ reportDescriptionlessDisables: true,
32
+ rules: {},
33
+ };
34
+ ```
35
+
36
+ ## Behavior and migration notes
37
+
38
+ - This rule inserts `rules: {},` when missing.
39
+ - The fixer preserves surrounding object structure and formatting style.
40
+
41
+ ## ESLint flat config example
42
+
43
+ ```ts
44
+ import stylelint2 from "eslint-plugin-stylelint-2";
45
+
46
+ export default [stylelint2.configs.configuration];
47
+ ```
48
+
49
+ ## When not to use it
50
+
51
+ Do not use this rule if your team intentionally treats Stylelint config files as non-rule-only wrappers and does not want to enforce explicit `rules` declarations.
52
+
53
+ ## Package documentation
54
+
55
+ Stylelint package documentation:
56
+
57
+ > **Rule catalog ID:** R017
58
+
59
+ ## Further reading
60
+
61
+ - [Stylelint configuring guide](https://stylelint.io/user-guide/configure/)
@@ -0,0 +1,61 @@
1
+ # sort-stylelint-extends
2
+
3
+ Enforce sorted entries in top-level Stylelint `extends` declarations.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Stylelint config modules such as `stylelint.config.ts`, `stylelint.config.mjs`, and `.stylelintrc.js`.
8
+
9
+ It focuses on top-level exported config objects, including configs wrapped in `defineConfig(...)`.
10
+
11
+ ## What this rule reports
12
+
13
+ Reports `extends` arrays whose string entries are not in ascending lexical order.
14
+
15
+ ## Why this rule exists
16
+
17
+ Stable sorted arrays reduce diff noise and keep shared config layering predictable.
18
+
19
+ ## ❌ Incorrect
20
+
21
+ ```ts
22
+ export default {
23
+ extends: ["stylelint-config-standard", "stylelint-config-recommended"],
24
+ rules: {},
25
+ };
26
+ ```
27
+
28
+ ## ✅ Correct
29
+
30
+ ```ts
31
+ export default {
32
+ extends: ["stylelint-config-recommended", "stylelint-config-standard"],
33
+ rules: {},
34
+ };
35
+ ```
36
+
37
+ ## Behavior and migration notes
38
+
39
+ This rule auto-fixes by sorting `extends` entries lexically.
40
+
41
+ ## ESLint flat config example
42
+
43
+ ```ts
44
+ import stylelint2 from "eslint-plugin-stylelint-2";
45
+
46
+ export default [stylelint2.configs.configuration];
47
+ ```
48
+
49
+ ## When not to use it
50
+
51
+ Do not use this rule if your repository intentionally relies on non-lexical manual ordering for readability conventions.
52
+
53
+ ## Package documentation
54
+
55
+ Stylelint package documentation:
56
+
57
+ > **Rule catalog ID:** R025
58
+
59
+ ## Further reading
60
+
61
+ - [Stylelint extends](https://stylelint.io/user-guide/configure/#extends)