eslint-plugin-stylelint-2 1.1.2 → 1.1.4

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 (137) hide show
  1. package/CHANGELOG.md +13 -35
  2. package/README.md +62 -67
  3. package/dist/_internal/stylelint-config-boolean-option-rule.d.ts.map +1 -1
  4. package/dist/_internal/stylelint-config-boolean-option-rule.js +18 -11
  5. package/dist/_internal/stylelint-config-boolean-option-rule.js.map +1 -1
  6. package/dist/_internal/stylelint-config-disallowed-option-rule.d.ts +4 -0
  7. package/dist/_internal/stylelint-config-disallowed-option-rule.d.ts.map +1 -1
  8. package/dist/_internal/stylelint-config-disallowed-option-rule.js +7 -9
  9. package/dist/_internal/stylelint-config-disallowed-option-rule.js.map +1 -1
  10. package/dist/_internal/stylelint-config-object.d.ts +2 -4
  11. package/dist/_internal/stylelint-config-object.d.ts.map +1 -1
  12. package/dist/_internal/stylelint-config-object.js +25 -10
  13. package/dist/_internal/stylelint-config-object.js.map +1 -1
  14. package/dist/_internal/stylelint-config-package-option-rule.d.ts +4 -0
  15. package/dist/_internal/stylelint-config-package-option-rule.d.ts.map +1 -1
  16. package/dist/_internal/stylelint-config-package-option-rule.js +2 -2
  17. package/dist/_internal/stylelint-config-package-option-rule.js.map +1 -1
  18. package/dist/_internal/stylelint-config-rules-object.d.ts +0 -4
  19. package/dist/_internal/stylelint-config-rules-object.d.ts.map +1 -1
  20. package/dist/_internal/stylelint-config-rules-object.js +11 -6
  21. package/dist/_internal/stylelint-config-rules-object.js.map +1 -1
  22. package/dist/_internal/stylelint-config-string-array-option-rule.d.ts.map +1 -1
  23. package/dist/_internal/stylelint-config-string-array-option-rule.js +7 -13
  24. package/dist/_internal/stylelint-config-string-array-option-rule.js.map +1 -1
  25. package/dist/_internal/stylelint-config-string-array-option.d.ts +0 -4
  26. package/dist/_internal/stylelint-config-string-array-option.d.ts.map +1 -1
  27. package/dist/_internal/stylelint-config-string-array-option.js +16 -8
  28. package/dist/_internal/stylelint-config-string-array-option.js.map +1 -1
  29. package/dist/_internal/stylelint-package-dependencies.d.ts.map +1 -1
  30. package/dist/_internal/stylelint-package-dependencies.js +10 -8
  31. package/dist/_internal/stylelint-package-dependencies.js.map +1 -1
  32. package/dist/_internal/stylelint-runner.d.ts.map +1 -1
  33. package/dist/_internal/stylelint-runner.js +7 -5
  34. package/dist/_internal/stylelint-runner.js.map +1 -1
  35. package/dist/_internal/stylelint-worker.js +26 -30
  36. package/dist/_internal/stylelint-worker.js.map +1 -1
  37. package/dist/_internal/stylelint2-config-references.d.ts +3 -2
  38. package/dist/_internal/stylelint2-config-references.d.ts.map +1 -1
  39. package/dist/_internal/stylelint2-config-references.js +1 -1
  40. package/dist/_internal/stylelint2-config-references.js.map +1 -1
  41. package/dist/_internal/typed-rule.d.ts.map +1 -1
  42. package/dist/_internal/typed-rule.js +1 -0
  43. package/dist/_internal/typed-rule.js.map +1 -1
  44. package/dist/plugin.d.ts +0 -1
  45. package/dist/plugin.d.ts.map +1 -1
  46. package/dist/plugin.js +15 -7
  47. package/dist/plugin.js.map +1 -1
  48. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.d.ts.map +1 -1
  49. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.js +17 -12
  50. package/dist/rules/disallow-stylelint-duplicate-rule-option-values.js.map +1 -1
  51. package/dist/rules/disallow-stylelint-empty-rules-object.d.ts.map +1 -1
  52. package/dist/rules/disallow-stylelint-empty-rules-object.js +12 -7
  53. package/dist/rules/disallow-stylelint-empty-rules-object.js.map +1 -1
  54. package/dist/rules/disallow-stylelint-null-rule-config.d.ts.map +1 -1
  55. package/dist/rules/disallow-stylelint-null-rule-config.js +14 -9
  56. package/dist/rules/disallow-stylelint-null-rule-config.js.map +1 -1
  57. package/dist/rules/disallow-stylelint-overrides-runtime-options.d.ts.map +1 -1
  58. package/dist/rules/disallow-stylelint-overrides-runtime-options.js +28 -27
  59. package/dist/rules/disallow-stylelint-overrides-runtime-options.js.map +1 -1
  60. package/dist/rules/prefer-stylelint-define-config.d.ts.map +1 -1
  61. package/dist/rules/prefer-stylelint-define-config.js +12 -7
  62. package/dist/rules/prefer-stylelint-define-config.js.map +1 -1
  63. package/dist/rules/prefer-stylelint-fix.d.ts.map +1 -1
  64. package/dist/rules/prefer-stylelint-fix.js +14 -11
  65. package/dist/rules/prefer-stylelint-fix.js.map +1 -1
  66. package/dist/rules/prefer-stylelint-formatter.d.ts.map +1 -1
  67. package/dist/rules/prefer-stylelint-formatter.js +12 -7
  68. package/dist/rules/prefer-stylelint-formatter.js.map +1 -1
  69. package/dist/rules/require-stylelint-config-file-naming-convention.js +1 -1
  70. package/dist/rules/require-stylelint-custom-syntax-in-overrides.d.ts.map +1 -1
  71. package/dist/rules/require-stylelint-custom-syntax-in-overrides.js +14 -9
  72. package/dist/rules/require-stylelint-custom-syntax-in-overrides.js.map +1 -1
  73. package/dist/rules/require-stylelint-overrides-configuration.d.ts.map +1 -1
  74. package/dist/rules/require-stylelint-overrides-configuration.js +16 -11
  75. package/dist/rules/require-stylelint-overrides-configuration.js.map +1 -1
  76. package/dist/rules/require-stylelint-overrides-files-array.d.ts.map +1 -1
  77. package/dist/rules/require-stylelint-overrides-files-array.js +16 -10
  78. package/dist/rules/require-stylelint-overrides-files-array.js.map +1 -1
  79. package/dist/rules/require-stylelint-overrides-files.d.ts.map +1 -1
  80. package/dist/rules/require-stylelint-overrides-files.js +17 -11
  81. package/dist/rules/require-stylelint-overrides-files.js.map +1 -1
  82. package/dist/rules/require-stylelint-rules-object.d.ts.map +1 -1
  83. package/dist/rules/require-stylelint-rules-object.js +3 -3
  84. package/dist/rules/require-stylelint-rules-object.js.map +1 -1
  85. package/dist/rules/sort-stylelint-rule-keys.d.ts.map +1 -1
  86. package/dist/rules/sort-stylelint-rule-keys.js +9 -4
  87. package/dist/rules/sort-stylelint-rule-keys.js.map +1 -1
  88. package/dist/rules/stylelint.d.ts.map +1 -1
  89. package/dist/rules/stylelint.js +79 -83
  90. package/dist/rules/stylelint.js.map +1 -1
  91. package/docs/rules/disallow-stylelint-allow-empty-input.md +3 -3
  92. package/docs/rules/disallow-stylelint-configuration-comment.md +3 -3
  93. package/docs/rules/disallow-stylelint-custom-syntax.md +10 -10
  94. package/docs/rules/disallow-stylelint-default-severity.md +6 -6
  95. package/docs/rules/disallow-stylelint-duplicate-extends.md +4 -4
  96. package/docs/rules/disallow-stylelint-duplicate-plugins.md +4 -4
  97. package/docs/rules/disallow-stylelint-duplicate-rule-option-values.md +16 -16
  98. package/docs/rules/disallow-stylelint-empty-rules-object.md +4 -4
  99. package/docs/rules/disallow-stylelint-ignore-disables.md +6 -8
  100. package/docs/rules/disallow-stylelint-ignore-files.md +3 -3
  101. package/docs/rules/disallow-stylelint-null-rule-config.md +6 -6
  102. package/docs/rules/disallow-stylelint-overrides-runtime-options.md +17 -17
  103. package/docs/rules/disallow-stylelint-processors.md +3 -3
  104. package/docs/rules/disallow-stylelint-relative-extends-paths.md +4 -4
  105. package/docs/rules/disallow-stylelint-relative-plugin-paths.md +4 -4
  106. package/docs/rules/guides/faq.md +1 -1
  107. package/docs/rules/guides/getting-started.md +6 -6
  108. package/docs/rules/prefer-stylelint-cache.md +6 -6
  109. package/docs/rules/prefer-stylelint-define-config.md +10 -12
  110. package/docs/rules/prefer-stylelint-extends-array.md +4 -4
  111. package/docs/rules/prefer-stylelint-fix.md +6 -6
  112. package/docs/rules/prefer-stylelint-formatter.md +6 -8
  113. package/docs/rules/prefer-stylelint-plugins-array.md +4 -4
  114. package/docs/rules/prefer-stylelint-report-descriptionless-disables.md +9 -11
  115. package/docs/rules/prefer-stylelint-report-invalid-scope-disables.md +9 -11
  116. package/docs/rules/prefer-stylelint-report-needless-disables.md +9 -11
  117. package/docs/rules/prefer-stylelint-report-unscoped-disables.md +9 -11
  118. package/docs/rules/presets/all.md +12 -14
  119. package/docs/rules/presets/configs.md +11 -13
  120. package/docs/rules/presets/configuration.md +11 -13
  121. package/docs/rules/presets/index.md +46 -44
  122. package/docs/rules/presets/recommended.md +7 -9
  123. package/docs/rules/presets/stylelint-only.md +2 -4
  124. package/docs/rules/require-stylelint-config-file-naming-convention.md +2 -2
  125. package/docs/rules/require-stylelint-custom-syntax-in-overrides.md +17 -17
  126. package/docs/rules/require-stylelint-extends-packages-installed.md +4 -4
  127. package/docs/rules/require-stylelint-overrides-configuration.md +21 -21
  128. package/docs/rules/require-stylelint-overrides-files-array.md +16 -16
  129. package/docs/rules/require-stylelint-overrides-files.md +21 -21
  130. package/docs/rules/require-stylelint-plugins-packages-installed.md +4 -4
  131. package/docs/rules/require-stylelint-report-disables.md +5 -5
  132. package/docs/rules/require-stylelint-rules-object.md +3 -3
  133. package/docs/rules/sort-stylelint-extends.md +4 -4
  134. package/docs/rules/sort-stylelint-plugins.md +4 -4
  135. package/docs/rules/sort-stylelint-rule-keys.md +8 -8
  136. package/docs/rules/stylelint.md +13 -15
  137. package/package.json +66 -60
package/CHANGELOG.md CHANGED
@@ -1,15 +1,14 @@
1
1
  <!-- markdownlint-disable -->
2
2
  <!-- eslint-disable markdown/no-missing-label-refs -->
3
+
3
4
  # Changelog
4
5
 
5
6
  All notable changes to this project will be documented in this file.
6
7
 
7
8
  ## [Unreleased]
8
9
 
9
-
10
10
  [a030a19...2266a76](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/compare/a030a19ab6f6c3c50eb7d22f53e2ccbd6cc9eb4c...2266a76345f8ea7c233c7ecebbe34500f52f33d5)
11
11
 
12
-
13
12
  ### ✨ Features
14
13
 
15
14
  - [`2266a76`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/2266a76345f8ea7c233c7ecebbe34500f52f33d5) — ✨ [feat] Enhance HomepageFeatures with new icons and improved styles
@@ -19,13 +18,12 @@ All notable changes to this project will be documented in this file.
19
18
  - Update styles for card components, including hover effects and transitions
20
19
 
21
20
  - Refactor feature structure to improve clarity and maintainability
22
- 🧪 [test] Update configs test to include new rules for duplicate extends and plugins
21
+ 🧪 [test] Update configs test to include new rules for duplicate extends and plugins
23
22
 
24
23
  - Add tests for "disallow-stylelint-duplicate-extends" and "disallow-stylelint-duplicate-plugins"
25
24
 
26
25
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
27
26
 
28
-
29
27
  - [`fab4f56`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/fab4f561cdaec2ac89495b5ed51c52a00d5887bc) — ✨ [feat] Add stylelint config hygiene rules and helpers
30
28
 
31
29
  ✨ [feat] Adds a broad new policy layer for stylelint config files:
@@ -52,12 +50,10 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
52
50
 
53
51
  🧪 [test] Adds test coverage for each new rule plus plugin config registry states.
54
52
 
55
-
56
53
  - Enables cleaner, deterministic config composition and auditability in stylelint authoring.
57
54
 
58
55
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
59
56
 
60
-
61
57
  - [`adf5e9c`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/adf5e9c268132c7195e1faaa0f224179a75ab727) — ✨ [feat] Add new Stylelint configuration rules for enhanced hygiene
62
58
 
63
59
  - Introduced `disallow-stylelint-allow-empty-input` to prevent empty input configurations.
@@ -75,7 +71,7 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
75
71
  - Implemented `require-stylelint-overrides-files` to ensure non-empty files matchers in overrides.
76
72
 
77
73
  - Added `require-stylelint-rules-object` to enforce the presence of a top-level rules object in Stylelint configs.
78
- 🧪 [test] Add tests for new Stylelint configuration rules
74
+ 🧪 [test] Add tests for new Stylelint configuration rules
79
75
 
80
76
  - Created tests for `disallow-stylelint-allow-empty-input` to validate empty input handling.
81
77
 
@@ -95,7 +91,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
95
91
 
96
92
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
97
93
 
98
-
99
94
  - [`b10b6bb`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/b10b6bb0afd81fc55d6c85dd5f7afc138f4038ce) — ✨ [feat] Add new rules to enhance Stylelint configuration hygiene
100
95
 
101
96
  - Introduced `disallow-stylelint-cache` to prevent cache configuration in Stylelint config files.
@@ -105,20 +100,19 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
105
100
  - Implemented `disallow-stylelint-fix` to prevent fix configuration in Stylelint config files.
106
101
 
107
102
  - Added `disallow-stylelint-ignore-files` to disallow ignore files configuration in Stylelint config files.
108
- 📝 [docs] Update documentation to reflect new rules
103
+ 📝 [docs] Update documentation to reflect new rules
109
104
 
110
105
  - Updated presets documentation to include new rules with descriptions and autofix capabilities.
111
106
 
112
107
  - Enhanced configuration documentation to include new rules in the flat config example.
113
108
 
114
109
  - Updated the rules matrix in the index documentation to include new rules and their respective preset keys.
115
- 🧪 [test] Add tests for new rules
110
+ 🧪 [test] Add tests for new rules
116
111
 
117
112
  - Created tests for `disallow-stylelint-cache`, `disallow-stylelint-default-severity`, `disallow-stylelint-fix`, and `disallow-stylelint-ignore-files` to ensure correct functionality and error reporting.
118
113
 
119
114
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
120
115
 
121
-
122
116
  - [`6903302`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/6903302e0e5a7b2a395036da6c197a5994877d73) — ✨ [feat] (homepage) Revamp homepage layout and content
123
117
 
124
118
  - Introduced hero badges to highlight key features of the ESLint plugin.
@@ -143,7 +137,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
143
137
 
144
138
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
145
139
 
146
-
147
140
  - [`e771060`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/e771060f1a84e8125d75dd646a313d76e7c130f2) — ✨ [feat] (presets) Introduce new configuration presets and update aliases
148
141
 
149
142
  - Introduced `stylelintOnly` preset for stylesheet linting only, replacing `stylesheets` alias.
@@ -155,14 +148,14 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
155
148
  - Updated all relevant code references to use new preset names.
156
149
 
157
150
  - Ensured backward compatibility for legacy aliases.
158
- 📝 [docs] (presets) Update documentation for new preset structure
151
+ 📝 [docs] (presets) Update documentation for new preset structure
159
152
 
160
153
  - Added detailed descriptions for `stylelintOnly` and `configuration` presets.
161
154
 
162
155
  - Updated related documentation links and examples across multiple files.
163
156
 
164
157
  - Enhanced clarity on the purpose and usage of each preset.
165
- 🧪 [test] (configs) Update tests to reflect new preset names and functionality
158
+ 🧪 [test] (configs) Update tests to reflect new preset names and functionality
166
159
 
167
160
  - Adjusted tests to verify the behavior of new `stylelintOnly` and `configuration` presets.
168
161
 
@@ -170,7 +163,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
170
163
 
171
164
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
172
165
 
173
-
174
166
  - [`6571c41`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/6571c418578d8d05f9470c3c18fe5a9df5570c58) — ✨ [feat] Update documentation links and configurations for eslint-plugin-stylelint-2
175
167
 
176
168
  - Updated robots.txt to point to the new sitemap for eslint-plugin-stylelint-2.
@@ -185,7 +177,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
185
177
 
186
178
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
187
179
 
188
-
189
180
  - [`e0a5b55`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/e0a5b558c0f488da9a91613afed207fb6887213e) — ✨ [feat] Add rules to disallow top-level Stylelint config options
190
181
 
191
182
  - Introduced `disallow-stylelint-formatter` rule to prevent configuring the `formatter` option in Stylelint config files.
@@ -204,7 +195,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
204
195
 
205
196
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
206
197
 
207
-
208
198
  - [`f6ee840`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/f6ee8401289f513d88857b05c753d7b075fe6846) — ✨ [feat] Add new Stylelint config hygiene rules
209
199
 
210
200
  - Introduced five new rules: `prefer-stylelint-report-descriptionless-disables`, `prefer-stylelint-report-invalid-scope-disables`, `prefer-stylelint-report-needless-disables`, `prefer-stylelint-report-unscoped-disables`, and `prefer-stylelint-define-config`.
@@ -214,7 +204,7 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
214
204
  - Updated documentation to reflect the new rules and their usage.
215
205
 
216
206
  - Enhanced the rules matrix and presets to include the new rules, ensuring they are part of the recommended configurations.
217
- 🧪 [test] Add tests for new Stylelint config hygiene rules
207
+ 🧪 [test] Add tests for new Stylelint config hygiene rules
218
208
 
219
209
  - Created individual test files for each new rule to ensure proper functionality and adherence to expected behaviors.
220
210
 
@@ -222,7 +212,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
222
212
 
223
213
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
224
214
 
225
-
226
215
  - [`2b412a3`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/2b412a3bdd82f5a30e40b12af2e7091385b07451) — ✨ [feat] Enhance Stylelint integration and rule definitions
227
216
 
228
217
  - Introduced support for `ignoreDisables` option in Stylelint rules to allow ignoring disable comments during linting.
@@ -234,7 +223,7 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
234
223
  - Refactored rule definitions to ensure immutability and better type safety.
235
224
 
236
225
  - Enhanced documentation for rule options and configurations to provide clearer guidance.
237
- 🧪 [test] Expand test coverage for Stylelint rules and configurations
226
+ 🧪 [test] Expand test coverage for Stylelint rules and configurations
238
227
 
239
228
  - Added tests for new `ignoreDisables` option and its impact on linting results.
240
229
 
@@ -244,19 +233,14 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
244
233
 
245
234
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
246
235
 
247
-
248
-
249
236
  ### 🛠️ Other Changes
250
237
 
251
238
  - [`f717fc4`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/f717fc456256fa529f7ea4c1d294adc2b8629e96) — Initialize project with basic structure and dependencies
252
239
 
253
240
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
254
241
 
255
-
256
242
  - [`a030a19`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/a030a19ab6f6c3c50eb7d22f53e2ccbd6cc9eb4c) — Initial commit
257
243
 
258
-
259
-
260
244
  ### 🎨 Styling
261
245
 
262
246
  - [`6e86931`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/6e869319c881b41bf517eefdca5bb2f1645dc520) — 🎨 [style] Improve code formatting and documentation clarity
@@ -273,8 +257,6 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
273
257
 
274
258
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
275
259
 
276
-
277
-
278
260
  ### 🧹 Chores
279
261
 
280
262
  - [`69076c3`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/69076c3850dc19675f4aea033f0a4ce4cfde34d6) — 🔧 [chore] Update npm-package-json-lint to version 10.0.0
@@ -285,10 +267,8 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
285
267
 
286
268
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
287
269
 
288
-
289
270
  - [`7018ecb`](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/commit/7018ecba8ae1b47c5a3eb8369afa935a2ba0264c) — 🔧 [chore] Update dependencies in package.json
290
271
 
291
-
292
272
  - Upgrade "@stylistic/stylelint-plugin" from "^5.0.1" to "^5.1.0" for improved linting capabilities.
293
273
 
294
274
  - Upgrade "eslint-plugin-copilot" from "^1.0.5" to "^1.0.6" for better integration with GitHub Copilot.
@@ -317,13 +297,11 @@ Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
317
297
 
318
298
  Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
319
299
 
320
-
321
-
322
-
323
-
324
-
325
300
  ## Contributors
301
+
326
302
  Thanks to all the [contributors](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/graphs/contributors) for their hard work!
303
+
327
304
  ## License
305
+
328
306
  This project is licensed under the [MIT License](https://github.com/Nick2bad4u/eslint-plugin-stylelint-2/blob/main/LICENSE)
329
- *This changelog was automatically generated with [git-cliff](https://github.com/orhun/git-cliff).*
307
+ _This changelog was automatically generated with [git-cliff](https://github.com/orhun/git-cliff)._
package/README.md CHANGED
@@ -23,9 +23,7 @@ npm install --save-dev eslint-plugin-stylelint-2 eslint stylelint
23
23
  ```ts
24
24
  import stylelint2 from "eslint-plugin-stylelint-2";
25
25
 
26
- export default [
27
- ...stylelint2.configs.recommended,
28
- ];
26
+ export default [...stylelint2.configs.recommended];
29
27
  ```
30
28
 
31
29
  ## Presets
@@ -49,9 +47,7 @@ Legacy aliases remain available:
49
47
  ```ts
50
48
  import stylelint2 from "eslint-plugin-stylelint-2";
51
49
 
52
- export default [
53
- ...stylelint2.configs.recommended,
54
- ];
50
+ export default [...stylelint2.configs.recommended];
55
51
  ```
56
52
 
57
53
  ### Stylelint bridge only
@@ -59,9 +55,7 @@ export default [
59
55
  ```ts
60
56
  import stylelint2 from "eslint-plugin-stylelint-2";
61
57
 
62
- export default [
63
- stylelint2.configs.stylelintOnly,
64
- ];
58
+ export default [stylelint2.configs.stylelintOnly];
65
59
  ```
66
60
 
67
61
  ### Configuration only
@@ -69,9 +63,7 @@ export default [
69
63
  ```ts
70
64
  import stylelint2 from "eslint-plugin-stylelint-2";
71
65
 
72
- export default [
73
- stylelint2.configs.configuration,
74
- ];
66
+ export default [stylelint2.configs.configuration];
75
67
  ```
76
68
 
77
69
  That preset notably enables:
@@ -90,73 +82,76 @@ That preset notably enables:
90
82
  import stylelint2 from "eslint-plugin-stylelint-2";
91
83
 
92
84
  export default [
85
+ {
86
+ ...stylelint2.configs.stylelintOnly,
87
+ rules: {
88
+ "stylelint-2/stylelint": [
89
+ "error",
93
90
  {
94
- ...stylelint2.configs.stylelintOnly,
95
- rules: {
96
- "stylelint-2/stylelint": [
97
- "error",
98
- {
99
- configFile: "./stylelint.config.mjs",
100
- customSyntax: "postcss-scss",
101
- },
102
- ],
103
- },
91
+ configFile: "./stylelint.config.mjs",
92
+ customSyntax: "postcss-scss",
104
93
  },
94
+ ],
95
+ },
96
+ },
105
97
  ];
106
98
  ```
107
99
 
108
100
  ## Rules
109
101
 
110
102
  Fix legend:
103
+
111
104
  - `🔧` = autofixable
112
105
  - `—` = report only
113
106
 
114
107
  Preset key legend:
115
- - [`🟡`](./docs/rules/presets/recommended.md) — [`stylelint2.configs.recommended`](./docs/rules/presets/recommended.md)
116
- - [`🎨`](./docs/rules/presets/stylelint-only.md) — [`stylelint2.configs.stylelintOnly`](./docs/rules/presets/stylelint-only.md)
117
- - [`🔧`](./docs/rules/presets/configuration.md) — [`stylelint2.configs.configuration`](./docs/rules/presets/configuration.md)
118
- - [`🟣`](./docs/rules/presets/all.md) — [`stylelint2.configs.all`](./docs/rules/presets/all.md)
119
-
120
- | Rule | Fix | Preset key |
121
- | --- | :-: | :-- |
122
- | [`stylelint`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/stylelint) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🎨](./docs/rules/presets/stylelint-only.md) [🟣](./docs/rules/presets/all.md) |
123
- | [`disallow-stylelint-allow-empty-input`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-allow-empty-input) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
124
- | [`disallow-stylelint-configuration-comment`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-configuration-comment) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
125
- | [`disallow-stylelint-custom-syntax`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-custom-syntax) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
126
- | [`disallow-stylelint-default-severity`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-default-severity) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
127
- | [`disallow-stylelint-duplicate-extends`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-duplicate-extends) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
128
- | [`disallow-stylelint-duplicate-plugins`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-duplicate-plugins) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
129
- | [`disallow-stylelint-duplicate-rule-option-values`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-duplicate-rule-option-values) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
130
- | [`disallow-stylelint-empty-rules-object`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-empty-rules-object) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
131
- | [`disallow-stylelint-ignore-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-ignore-disables) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
132
- | [`disallow-stylelint-ignore-files`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-ignore-files) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
133
- | [`disallow-stylelint-null-rule-config`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-null-rule-config) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
134
- | [`disallow-stylelint-overrides-runtime-options`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-overrides-runtime-options) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
135
- | [`disallow-stylelint-processors`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-processors) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
136
- | [`disallow-stylelint-relative-extends-paths`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-relative-extends-paths) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
137
- | [`disallow-stylelint-relative-plugin-paths`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-relative-plugin-paths) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
138
- | [`prefer-stylelint-cache`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-cache) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
139
- | [`prefer-stylelint-define-config`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-define-config) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
140
- | [`prefer-stylelint-extends-array`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-extends-array) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
141
- | [`prefer-stylelint-fix`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-fix) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
142
- | [`prefer-stylelint-formatter`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-formatter) | | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
143
- | [`prefer-stylelint-plugins-array`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-plugins-array) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
144
- | [`prefer-stylelint-report-descriptionless-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-descriptionless-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
145
- | [`prefer-stylelint-report-invalid-scope-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-invalid-scope-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
146
- | [`prefer-stylelint-report-needless-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-needless-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
147
- | [`prefer-stylelint-report-unscoped-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-unscoped-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
148
- | [`require-stylelint-custom-syntax-in-overrides`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-custom-syntax-in-overrides) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
149
- | [`require-stylelint-config-file-naming-convention`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-config-file-naming-convention) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
150
- | [`require-stylelint-extends-packages-installed`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-extends-packages-installed) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
151
- | [`require-stylelint-overrides-configuration`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-overrides-configuration) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
152
- | [`require-stylelint-overrides-files-array`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-overrides-files-array) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
153
- | [`require-stylelint-overrides-files`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-overrides-files) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
154
- | [`require-stylelint-plugins-packages-installed`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-plugins-packages-installed) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
155
- | [`require-stylelint-report-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-report-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
156
- | [`require-stylelint-rules-object`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-rules-object) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
157
- | [`sort-stylelint-extends`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/sort-stylelint-extends) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
158
- | [`sort-stylelint-plugins`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/sort-stylelint-plugins) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
159
- | [`sort-stylelint-rule-keys`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/sort-stylelint-rule-keys) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
108
+
109
+ - [`🟡`](./docs/rules/presets/recommended.md) — [`stylelint2.configs.recommended`](./docs/rules/presets/recommended.md)
110
+ - [`🎨`](./docs/rules/presets/stylelint-only.md) — [`stylelint2.configs.stylelintOnly`](./docs/rules/presets/stylelint-only.md)
111
+ - [`🔧`](./docs/rules/presets/configuration.md) — [`stylelint2.configs.configuration`](./docs/rules/presets/configuration.md)
112
+ - [`🟣`](./docs/rules/presets/all.md) — [`stylelint2.configs.all`](./docs/rules/presets/all.md)
113
+
114
+ | Rule | Fix | Preset key |
115
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-: | :----------------------------------------------------------------------------------------------------------------------- |
116
+ | [`stylelint`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/stylelint) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🎨](./docs/rules/presets/stylelint-only.md) [🟣](./docs/rules/presets/all.md) |
117
+ | [`disallow-stylelint-allow-empty-input`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-allow-empty-input) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
118
+ | [`disallow-stylelint-configuration-comment`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-configuration-comment) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
119
+ | [`disallow-stylelint-custom-syntax`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-custom-syntax) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
120
+ | [`disallow-stylelint-default-severity`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-default-severity) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
121
+ | [`disallow-stylelint-duplicate-extends`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-duplicate-extends) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
122
+ | [`disallow-stylelint-duplicate-plugins`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-duplicate-plugins) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
123
+ | [`disallow-stylelint-duplicate-rule-option-values`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-duplicate-rule-option-values) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
124
+ | [`disallow-stylelint-empty-rules-object`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-empty-rules-object) || [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
125
+ | [`disallow-stylelint-ignore-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-ignore-disables) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
126
+ | [`disallow-stylelint-ignore-files`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-ignore-files) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
127
+ | [`disallow-stylelint-null-rule-config`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-null-rule-config) || [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
128
+ | [`disallow-stylelint-overrides-runtime-options`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-overrides-runtime-options) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
129
+ | [`disallow-stylelint-processors`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-processors) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
130
+ | [`disallow-stylelint-relative-extends-paths`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-relative-extends-paths) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
131
+ | [`disallow-stylelint-relative-plugin-paths`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/disallow-stylelint-relative-plugin-paths) || [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
132
+ | [`prefer-stylelint-cache`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-cache) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
133
+ | [`prefer-stylelint-define-config`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-define-config) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
134
+ | [`prefer-stylelint-extends-array`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-extends-array) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
135
+ | [`prefer-stylelint-fix`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-fix) | 🔧 | [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
136
+ | [`prefer-stylelint-formatter`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-formatter) || [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
137
+ | [`prefer-stylelint-plugins-array`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-plugins-array) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
138
+ | [`prefer-stylelint-report-descriptionless-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-descriptionless-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
139
+ | [`prefer-stylelint-report-invalid-scope-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-invalid-scope-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
140
+ | [`prefer-stylelint-report-needless-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-needless-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
141
+ | [`prefer-stylelint-report-unscoped-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/prefer-stylelint-report-unscoped-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
142
+ | [`require-stylelint-custom-syntax-in-overrides`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-custom-syntax-in-overrides) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
143
+ | [`require-stylelint-config-file-naming-convention`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-config-file-naming-convention) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
144
+ | [`require-stylelint-extends-packages-installed`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-extends-packages-installed) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
145
+ | [`require-stylelint-overrides-configuration`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-overrides-configuration) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
146
+ | [`require-stylelint-overrides-files-array`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-overrides-files-array) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
147
+ | [`require-stylelint-overrides-files`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-overrides-files) | | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
148
+ | [`require-stylelint-plugins-packages-installed`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-plugins-packages-installed) || [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
149
+ | [`require-stylelint-report-disables`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-report-disables) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
150
+ | [`require-stylelint-rules-object`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/require-stylelint-rules-object) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
151
+ | [`sort-stylelint-extends`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/sort-stylelint-extends) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
152
+ | [`sort-stylelint-plugins`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/sort-stylelint-plugins) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
153
+ | [`sort-stylelint-rule-keys`](https://nick2bad4u.github.io/eslint-plugin-stylelint-2/docs/rules/sort-stylelint-rule-keys) | 🔧 | [🟡](./docs/rules/presets/recommended.md) [🔧](./docs/rules/presets/configuration.md) [🟣](./docs/rules/presets/all.md) |
154
+
160
155
  ## Why use this plugin?
161
156
 
162
157
  Use this plugin when you want ESLint to become the single command and editor integration that reports:
@@ -1 +1 @@
1
- {"version":3,"file":"stylelint-config-boolean-option-rule.d.ts","sourceRoot":"","sources":["../../src/_internal/stylelint-config-boolean-option-rule.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AASxC,OAAO,EAEH,KAAK,kBAAkB,EAE1B,MAAM,iBAAiB,CAAC;AAEzB,KAAK,0BAA0B,GAAG,QAAQ,CACtC,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GAAG;IACxD,UAAU,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC;AACF,KAAK,UAAU,GAAG,qBAAqB,CAAC;AAExC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAmC3B;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC,GAC/C,YAAY,QAAQ,CAAC,0BAA0B,CAAC,KACjD,kBAAkB,CAAC,UAAU,EAAE,OAAO,CA8FxC,CAAC"}
1
+ {"version":3,"file":"stylelint-config-boolean-option-rule.d.ts","sourceRoot":"","sources":["../../src/_internal/stylelint-config-boolean-option-rule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAexC,OAAO,EAEH,KAAK,kBAAkB,EAE1B,MAAM,iBAAiB,CAAC;AAEzB,KAAK,0BAA0B,GAAG,QAAQ,CACtC,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GAAG;IACxD,UAAU,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC;AACF,KAAK,UAAU,GAAG,qBAAqB,CAAC;AAExC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAsC3B;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC,GAC/C,YAAY,QAAQ,CAAC,0BAA0B,CAAC,KACjD,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAgGxC,CAAC"}
@@ -1,23 +1,29 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Shared rule factory for requiring top-level boolean Stylelint config options.
4
+ */
5
+ import { AST_NODE_TYPES } from "@typescript-eslint/utils";
1
6
  import { arrayFirst, isPresent } from "ts-extras";
2
- import { getExportedStylelintConfigObject, getObjectPropertyByName, isStylelintConfigFile, } from "./stylelint-config-object.js";
7
+ import { getExportedStylelintConfigObject, getObjectPropertyByName, isExportDefaultDeclarationNode, isStylelintConfigFile, } from "./stylelint-config-object.js";
3
8
  import { createTypedRule, toRuleListener, } from "./typed-rule.js";
4
- const isPropertyExpressionValue = (value) => value.type !== "ArrayPattern" &&
5
- value.type !== "AssignmentPattern" &&
6
- value.type !== "ObjectPattern" &&
7
- value.type !== "TSEmptyBodyFunctionExpression";
8
- const isBooleanTrueLiteral = (node) => node.type === "Literal" && node.value === true;
9
+ const isPropertyExpressionValue = (value) => value.type !== AST_NODE_TYPES.ArrayPattern &&
10
+ value.type !== AST_NODE_TYPES.AssignmentPattern &&
11
+ value.type !== AST_NODE_TYPES.ObjectPattern &&
12
+ value.type !== AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
13
+ const isBooleanTrueLiteral = (node) => node.type === AST_NODE_TYPES.Literal && node.value === true;
9
14
  const isOptionEnabled = (value) => {
10
15
  if (isBooleanTrueLiteral(value)) {
11
16
  return true;
12
17
  }
13
- if (value.type !== "ArrayExpression") {
18
+ if (value.type !== AST_NODE_TYPES.ArrayExpression) {
14
19
  return false;
15
20
  }
16
21
  const [firstElement] = value.elements;
17
- return firstElement?.type === "Literal" && firstElement.value === true;
22
+ return (firstElement?.type === AST_NODE_TYPES.Literal &&
23
+ firstElement.value === true);
18
24
  };
19
25
  const getLineEnding = (text) => text.includes("\r\n") ? "\r\n" : "\n";
20
- const getIndentation = (node) => node === undefined ? " " : " ".repeat(node.loc.start.column);
26
+ const getIndentation = (node) => node === undefined ? " ".repeat(4) : " ".repeat(node.loc.start.column);
21
27
  /**
22
28
  * Create a rule that requires one top-level Stylelint boolean or report-style
23
29
  * option to be enabled.
@@ -38,7 +44,7 @@ export const createStylelintConfigBooleanOptionRule = (definition) => {
38
44
  const lineEnding = getLineEnding(sourceCode.text);
39
45
  return toRuleListener({
40
46
  ExportDefaultDeclaration(node) {
41
- if (node === null || typeof node !== "object") {
47
+ if (!isExportDefaultDeclarationNode(node)) {
42
48
  return;
43
49
  }
44
50
  const exportDefaultNode = node;
@@ -71,7 +77,8 @@ export const createStylelintConfigBooleanOptionRule = (definition) => {
71
77
  }
72
78
  context.report({
73
79
  fix(fixer) {
74
- if (propertyValue.type === "ArrayExpression") {
80
+ if (propertyValue.type ===
81
+ AST_NODE_TYPES.ArrayExpression) {
75
82
  const [firstElement] = propertyValue.elements;
76
83
  if (isPresent(firstElement)) {
77
84
  return fixer.replaceText(firstElement, "true");
@@ -1 +1 @@
1
- {"version":3,"file":"stylelint-config-boolean-option-rule.js","sourceRoot":"","sources":["../../src/_internal/stylelint-config-boolean-option-rule.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE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AAC,aAAa,CAAC,CAAC;gCAElC,OAAO,KAAK,CAAC,gBAAgB,CACzB,aAAa,EACb,GAAG,UAAU,UAAU,UAAU,GAAG,WAAW,EAAE,CACpD,CAAC;4BACN,CAAC;4BACD,SAAS,EAAE,qBAAqB;4BAChC,IAAI,EAAE,YAAY;yBACrB,CAAC,CAAC;wBACH,OAAO;oBACX,CAAC;oBAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC;oBAE7C,IAAI,CAAC,yBAAyB,CAAC,aAAa,CAAC,EAAE,CAAC;wBAC5C,OAAO;oBACX,CAAC;oBAED,IAAI,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;wBACjC,OAAO;oBACX,CAAC;oBAED,OAAO,CAAC,MAAM,CAAC;wBACX,GAAG,CAAC,KAAK;4BACL,IAAI,aAAa,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;gCAC3C,MAAM,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC;gCAE9C,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;oCAC1B,OAAO,KAAK,CAAC,WAAW,CACpB,YAAY,EACZ,MAAM,CACT,CAAC;gCACN,CAAC;4BACL,CAAC;4BAED,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;wBACpD,CAAC;wBACD,SAAS,EAAE,qBAAqB;wBAChC,IAAI,EAAE,gBAAgB;qBACzB,CAAC,CAAC;gBACP,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAmD,CAAC;AACzD,CAAC,CAAC"}
1
+ {"version":3,"file":"stylelint-config-boolean-option-rule.js","sourceRoot":"","sources":["../../src/_internal/stylelint-config-boolean-option-rule.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,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AAU,GAAG,CACzD,CAAC;gCACN,CAAC;gCAED,MAAM,WAAW,GACb,cAAc,CAAC,aAAa,CAAC,CAAC;gCAElC,OAAO,KAAK,CAAC,gBAAgB,CACzB,aAAa,EACb,GAAG,UAAU,UAAU,UAAU,GAAG,WAAW,EAAE,CACpD,CAAC;4BACN,CAAC;4BACD,SAAS,EAAE,qBAAqB;4BAChC,IAAI,EAAE,YAAY;yBACrB,CAAC,CAAC;wBACH,OAAO;oBACX,CAAC;oBAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC;oBAE7C,IAAI,CAAC,yBAAyB,CAAC,aAAa,CAAC,EAAE,CAAC;wBAC5C,OAAO;oBACX,CAAC;oBAED,IAAI,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;wBACjC,OAAO;oBACX,CAAC;oBAED,OAAO,CAAC,MAAM,CAAC;wBACX,GAAG,CAAC,KAAK;4BACL,IACI,aAAa,CAAC,IAAI;gCAClB,cAAc,CAAC,eAAe,EAChC,CAAC;gCACC,MAAM,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC;gCAE9C,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;oCAC1B,OAAO,KAAK,CAAC,WAAW,CACpB,YAAY,EACZ,MAAM,CACT,CAAC;gCACN,CAAC;4BACL,CAAC;4BAED,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;wBACpD,CAAC;wBACD,SAAS,EAAE,qBAAqB;wBAChC,IAAI,EAAE,gBAAgB;qBACzB,CAAC,CAAC;gBACP,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAmD,CAAC;AACzD,CAAC,CAAC"}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Shared rule factory for disallowing top-level Stylelint config options that are better handled elsewhere.
4
+ */
1
5
  import type { Except } from "type-fest";
2
6
  import { type RuleModuleWithDocs } from "./typed-rule.js";
3
7
  type ConfigOptionRuleDefinition = Readonly<Except<RuleModuleWithDocs<MessageIds, Options>, "create"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"stylelint-config-disallowed-option-rule.d.ts","sourceRoot":"","sources":["../../src/_internal/stylelint-config-disallowed-option-rule.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAQxC,OAAO,EAEH,KAAK,kBAAkB,EAE1B,MAAM,iBAAiB,CAAC;AAEzB,KAAK,0BAA0B,GAAG,QAAQ,CACtC,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GAAG;IACxD,UAAU,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC;AACF,KAAK,UAAU,GAAG,sBAAsB,CAAC;AAEzC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAE3B;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC,GAClD,YAAY,QAAQ,CAAC,0BAA0B,CAAC,KACjD,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAkDxC,CAAC"}
1
+ {"version":3,"file":"stylelint-config-disallowed-option-rule.d.ts","sourceRoot":"","sources":["../../src/_internal/stylelint-config-disallowed-option-rule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AASxC,OAAO,EAEH,KAAK,kBAAkB,EAE1B,MAAM,iBAAiB,CAAC;AAEzB,KAAK,0BAA0B,GAAG,QAAQ,CACtC,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GAAG;IACxD,UAAU,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC;AACF,KAAK,UAAU,GAAG,sBAAsB,CAAC;AAEzC,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAE3B;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC,GAClD,YAAY,QAAQ,CAAC,0BAA0B,CAAC,KACjD,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAgDxC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { createFixToRemoveObjectProperty, getExportedStylelintConfigObject, getObjectPropertyByName, isStylelintConfigFile, } from "./stylelint-config-object.js";
1
+ import { createFixToRemoveObjectProperty, getExportedStylelintConfigObject, getObjectPropertyByName, isExportDefaultDeclarationNode, isStylelintConfigFile, } from "./stylelint-config-object.js";
2
2
  import { createTypedRule, toRuleListener, } from "./typed-rule.js";
3
3
  /**
4
4
  * Create a rule that disallows one top-level Stylelint config option.
@@ -17,7 +17,7 @@ export const createStylelintConfigDisallowedOptionRule = (definition) => {
17
17
  }
18
18
  return toRuleListener({
19
19
  ExportDefaultDeclaration(node) {
20
- if (node === null || typeof node !== "object") {
20
+ if (!isExportDefaultDeclarationNode(node)) {
21
21
  return;
22
22
  }
23
23
  const exportDefaultNode = node;
@@ -30,13 +30,11 @@ export const createStylelintConfigDisallowedOptionRule = (definition) => {
30
30
  return;
31
31
  }
32
32
  context.report({
33
- fix(fixer) {
34
- return createFixToRemoveObjectProperty({
35
- fixer,
36
- objectExpression: configObject,
37
- property: existingProperty,
38
- });
39
- },
33
+ fix: (fixer) => createFixToRemoveObjectProperty({
34
+ fixer,
35
+ objectExpression: configObject,
36
+ property: existingProperty,
37
+ }),
40
38
  messageId: "disallowConfigOption",
41
39
  node: existingProperty,
42
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"stylelint-config-disallowed-option-rule.js","sourceRoot":"","sources":["../../src/_internal/stylelint-config-disallowed-option-rule.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,EACvB,qBAAqB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,eAAe,EAEf,cAAc,GACjB,MAAM,iBAAiB,CAAC;AAWzB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CACrD,UAAgD,EACT,EAAE;IACzC,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,GAAG,UAAU,CAAC;IAErD,OAAO,eAAe,CAAC;QACnB,GAAG,cAAc;QACjB,MAAM,CAAC,OAAO;YACV,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACnD,OAAO,EAAE,CAAC;YACd,CAAC;YAED,OAAO,cAAc,CAAC;gBAClB,wBAAwB,CAAC,IAAa;oBAClC,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;wBAC5C,OAAO;oBACX,CAAC;oBAED,MAAM,iBAAiB,GACnB,IAAyC,CAAC;oBAC9C,MAAM,YAAY,GAAG,gCAAgC,CACjD,iBAAiB,CAAC,WAAW,CAChC,CAAC;oBAEF,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;wBAC7B,OAAO;oBACX,CAAC;oBAED,MAAM,gBAAgB,GAAG,uBAAuB,CAC5C,YAAY,EACZ,UAAU,CACb,CAAC;oBAEF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;wBACjC,OAAO;oBACX,CAAC;oBAED,OAAO,CAAC,MAAM,CAAC;wBACX,GAAG,CAAC,KAAK;4BACL,OAAO,+BAA+B,CAAC;gCACnC,KAAK;gCACL,gBAAgB,EAAE,YAAY;gCAC9B,QAAQ,EAAE,gBAAgB;6BAC7B,CAAC,CAAC;wBACP,CAAC;wBACD,SAAS,EAAE,sBAAsB;wBACjC,IAAI,EAAE,gBAAgB;qBACzB,CAAC,CAAC;gBACP,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAmD,CAAC;AACzD,CAAC,CAAC"}
1
+ {"version":3,"file":"stylelint-config-disallowed-option-rule.js","sourceRoot":"","sources":["../../src/_internal/stylelint-config-disallowed-option-rule.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,EACvB,8BAA8B,EAC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
2
- * @packageDocumentation
3
- * Shared helpers for reading and rewriting Stylelint config objects.
4
- */
5
1
  import type { TSESLint, TSESTree } from "@typescript-eslint/utils";
6
2
  /**
7
3
  * Check whether a filename looks like a Stylelint config module.
@@ -29,6 +25,8 @@ export declare const isPropertyNamed: (property: Readonly<TSESTree.Property>, na
29
25
  * @returns Config object expression when the export is supported.
30
26
  */
31
27
  export declare const getExportedStylelintConfigObject: (declaration: Readonly<TSESTree.ExportDefaultDeclaration["declaration"]>) => TSESTree.ObjectExpression | undefined;
28
+ /** Type guard for unknown nodes entering generic rule listeners. */
29
+ export declare const isExportDefaultDeclarationNode: (node: unknown) => node is TSESTree.ExportDefaultDeclaration;
32
30
  /**
33
31
  * Find one named top-level object property.
34
32
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stylelint-config-object.d.ts","sourceRoot":"","sources":["../../src/_internal/stylelint-config-object.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQnE;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,KAAG,OACP,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GACxB,UAAU,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACrC,MAAM,MAAM,KACb,OAUF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,GACzC,aAAa,QAAQ,CAAC,QAAQ,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC,KACxE,QAAQ,CAAC,gBAAgB,GAAG,SAkB9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAChC,kBAAkB,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EACrD,MAAM,MAAM,KACb,QAAQ,CAAC,QAAQ,GAAG,SAYtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GA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