@alexlit/lint-kit 183.4.0 → 183.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/package.json +1 -1
  2. package/packages/config-eslint/package.json +4 -4
  3. package/packages/config-stylelint/node_modules/ansi-regex/index.d.ts +33 -0
  4. package/packages/config-stylelint/node_modules/ansi-regex/index.js +14 -0
  5. package/packages/config-stylelint/node_modules/ansi-regex/license +9 -0
  6. package/packages/config-stylelint/node_modules/ansi-regex/package.json +61 -0
  7. package/packages/config-stylelint/node_modules/ansi-regex/readme.md +66 -0
  8. package/packages/config-stylelint/node_modules/file-entry-cache/LICENSE +19 -0
  9. package/packages/config-stylelint/node_modules/file-entry-cache/README.md +630 -0
  10. package/packages/config-stylelint/node_modules/file-entry-cache/dist/index.cjs +559 -0
  11. package/packages/config-stylelint/node_modules/file-entry-cache/dist/index.d.cts +304 -0
  12. package/packages/config-stylelint/node_modules/file-entry-cache/dist/index.d.ts +304 -0
  13. package/packages/config-stylelint/node_modules/file-entry-cache/dist/index.js +525 -0
  14. package/packages/config-stylelint/node_modules/file-entry-cache/package.json +62 -0
  15. package/packages/config-stylelint/node_modules/flat-cache/LICENSE +19 -0
  16. package/packages/config-stylelint/node_modules/flat-cache/README.md +235 -0
  17. package/packages/config-stylelint/node_modules/flat-cache/dist/index.cjs +495 -0
  18. package/packages/config-stylelint/node_modules/flat-cache/dist/index.d.cts +255 -0
  19. package/packages/config-stylelint/node_modules/flat-cache/dist/index.d.ts +255 -0
  20. package/packages/config-stylelint/node_modules/flat-cache/dist/index.js +455 -0
  21. package/packages/config-stylelint/node_modules/flat-cache/package.json +81 -0
  22. package/packages/config-stylelint/node_modules/globby/ignore.js +337 -0
  23. package/packages/config-stylelint/node_modules/globby/index.d.ts +394 -0
  24. package/packages/config-stylelint/node_modules/globby/index.js +488 -0
  25. package/packages/config-stylelint/node_modules/globby/license +9 -0
  26. package/packages/config-stylelint/node_modules/globby/package.json +94 -0
  27. package/packages/config-stylelint/node_modules/globby/readme.md +388 -0
  28. package/packages/config-stylelint/node_modules/globby/utilities.js +382 -0
  29. package/packages/config-stylelint/node_modules/meow/build/dependencies.js +7347 -0
  30. package/packages/config-stylelint/node_modules/meow/build/index.d.ts +2684 -0
  31. package/packages/config-stylelint/node_modules/meow/build/index.js +185 -0
  32. package/packages/config-stylelint/node_modules/meow/build/licenses.md +1254 -0
  33. package/packages/config-stylelint/node_modules/meow/build/options.js +147 -0
  34. package/packages/config-stylelint/node_modules/meow/build/parser.js +113 -0
  35. package/packages/config-stylelint/node_modules/meow/build/utils.js +7 -0
  36. package/packages/config-stylelint/node_modules/meow/build/validate.js +145 -0
  37. package/packages/config-stylelint/node_modules/meow/license +9 -0
  38. package/packages/config-stylelint/node_modules/meow/package.json +103 -0
  39. package/packages/config-stylelint/node_modules/meow/readme.md +387 -0
  40. package/packages/config-stylelint/node_modules/postcss-safe-parser/LICENSE +20 -0
  41. package/packages/config-stylelint/node_modules/postcss-safe-parser/README.md +25 -0
  42. package/packages/config-stylelint/node_modules/postcss-safe-parser/lib/safe-parse.js +12 -0
  43. package/packages/config-stylelint/node_modules/postcss-safe-parser/lib/safe-parser.js +100 -0
  44. package/packages/config-stylelint/node_modules/postcss-safe-parser/package.json +36 -0
  45. package/packages/config-stylelint/node_modules/slash/index.d.ts +23 -0
  46. package/packages/config-stylelint/node_modules/slash/index.js +9 -0
  47. package/packages/config-stylelint/node_modules/slash/license +9 -0
  48. package/packages/config-stylelint/node_modules/slash/package.json +39 -0
  49. package/packages/config-stylelint/node_modules/slash/readme.md +36 -0
  50. package/packages/config-stylelint/node_modules/string-width/index.d.ts +39 -0
  51. package/packages/config-stylelint/node_modules/string-width/index.js +119 -0
  52. package/packages/config-stylelint/node_modules/string-width/license +9 -0
  53. package/packages/config-stylelint/node_modules/string-width/package.json +65 -0
  54. package/packages/config-stylelint/node_modules/string-width/readme.md +66 -0
  55. package/packages/config-stylelint/node_modules/strip-ansi/index.d.ts +15 -0
  56. package/packages/config-stylelint/node_modules/strip-ansi/index.js +19 -0
  57. package/packages/config-stylelint/node_modules/strip-ansi/license +9 -0
  58. package/packages/config-stylelint/node_modules/strip-ansi/package.json +59 -0
  59. package/packages/config-stylelint/node_modules/strip-ansi/readme.md +37 -0
  60. package/packages/config-stylelint/node_modules/stylelint/LICENSE +20 -0
  61. package/packages/config-stylelint/node_modules/stylelint/README.md +113 -0
  62. package/packages/config-stylelint/node_modules/stylelint/bin/stylelint.mjs +7 -0
  63. package/packages/config-stylelint/node_modules/stylelint/lib/assignDisabledRanges.mjs +483 -0
  64. package/packages/config-stylelint/node_modules/stylelint/lib/augmentConfig.mjs +586 -0
  65. package/packages/config-stylelint/node_modules/stylelint/lib/cli.mjs +746 -0
  66. package/packages/config-stylelint/node_modules/stylelint/lib/constants.mjs +25 -0
  67. package/packages/config-stylelint/node_modules/stylelint/lib/createPartialStylelintResult.mjs +114 -0
  68. package/packages/config-stylelint/node_modules/stylelint/lib/createPlugin.mjs +9 -0
  69. package/packages/config-stylelint/node_modules/stylelint/lib/createStylelint.mjs +37 -0
  70. package/packages/config-stylelint/node_modules/stylelint/lib/descriptionlessDisables.mjs +51 -0
  71. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/calcSeverityCounts.mjs +21 -0
  72. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/compactFormatter.mjs +23 -0
  73. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/index.mjs +23 -0
  74. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/jsonFormatter.mjs +10 -0
  75. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/preprocessWarnings.mjs +74 -0
  76. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/stringFormatter.mjs +308 -0
  77. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/tapFormatter.mjs +85 -0
  78. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/terminalLink.mjs +21 -0
  79. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/unixFormatter.mjs +32 -0
  80. package/packages/config-stylelint/node_modules/stylelint/lib/formatters/verboseFormatter.mjs +175 -0
  81. package/packages/config-stylelint/node_modules/stylelint/lib/getConfigForFile.mjs +110 -0
  82. package/packages/config-stylelint/node_modules/stylelint/lib/getPostcssResult.mjs +131 -0
  83. package/packages/config-stylelint/node_modules/stylelint/lib/index.mjs +38 -0
  84. package/packages/config-stylelint/node_modules/stylelint/lib/invalidScopeDisables.mjs +41 -0
  85. package/packages/config-stylelint/node_modules/stylelint/lib/isPathIgnored.mjs +48 -0
  86. package/packages/config-stylelint/node_modules/stylelint/lib/lintPostcssResult.mjs +172 -0
  87. package/packages/config-stylelint/node_modules/stylelint/lib/lintSource.mjs +135 -0
  88. package/packages/config-stylelint/node_modules/stylelint/lib/needlessDisables.mjs +91 -0
  89. package/packages/config-stylelint/node_modules/stylelint/lib/normalizeAllRuleSettings.mjs +29 -0
  90. package/packages/config-stylelint/node_modules/stylelint/lib/normalizeRuleSettings.mjs +56 -0
  91. package/packages/config-stylelint/node_modules/stylelint/lib/postcssPlugin.mjs +50 -0
  92. package/packages/config-stylelint/node_modules/stylelint/lib/prepareReturnValue.mjs +63 -0
  93. package/packages/config-stylelint/node_modules/stylelint/lib/printConfig.mjs +44 -0
  94. package/packages/config-stylelint/node_modules/stylelint/lib/reference/atKeywords.mjs +91 -0
  95. package/packages/config-stylelint/node_modules/stylelint/lib/reference/functions.mjs +100 -0
  96. package/packages/config-stylelint/node_modules/stylelint/lib/reference/keywords.mjs +663 -0
  97. package/packages/config-stylelint/node_modules/stylelint/lib/reference/mediaFeatures.mjs +115 -0
  98. package/packages/config-stylelint/node_modules/stylelint/lib/reference/mediaTypes.mjs +14 -0
  99. package/packages/config-stylelint/node_modules/stylelint/lib/reference/prefixes.mjs +17 -0
  100. package/packages/config-stylelint/node_modules/stylelint/lib/reference/properties.mjs +1111 -0
  101. package/packages/config-stylelint/node_modules/stylelint/lib/reference/selectors.mjs +472 -0
  102. package/packages/config-stylelint/node_modules/stylelint/lib/reference/units.mjs +82 -0
  103. package/packages/config-stylelint/node_modules/stylelint/lib/reportDisables.mjs +48 -0
  104. package/packages/config-stylelint/node_modules/stylelint/lib/reportUnknownRuleNames.mjs +76 -0
  105. package/packages/config-stylelint/node_modules/stylelint/lib/resolveConfig.mjs +43 -0
  106. package/packages/config-stylelint/node_modules/stylelint/lib/rules/alpha-value-notation/index.mjs +207 -0
  107. package/packages/config-stylelint/node_modules/stylelint/lib/rules/annotation-no-unknown/index.mjs +88 -0
  108. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.mjs +62 -0
  109. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-descriptor-no-unknown/index.mjs +108 -0
  110. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-descriptor-value-no-unknown/index.mjs +64 -0
  111. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.mjs +62 -0
  112. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.mjs +178 -0
  113. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-no-deprecated/index.mjs +86 -0
  114. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.mjs +80 -0
  115. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.mjs +82 -0
  116. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-prelude-no-invalid/index.mjs +76 -0
  117. package/packages/config-stylelint/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.mjs +92 -0
  118. package/packages/config-stylelint/node_modules/stylelint/lib/rules/block-no-empty/index.mjs +116 -0
  119. package/packages/config-stylelint/node_modules/stylelint/lib/rules/block-no-redundant-nested-style-rules/index.mjs +52 -0
  120. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-function-alias-notation/index.mjs +87 -0
  121. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-function-notation/index.mjs +168 -0
  122. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-hex-alpha/index.mjs +75 -0
  123. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-hex-length/index.mjs +128 -0
  124. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-named/colordUtils.mjs +109 -0
  125. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-named/index.mjs +183 -0
  126. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-no-hex/index.mjs +69 -0
  127. package/packages/config-stylelint/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.mjs +68 -0
  128. package/packages/config-stylelint/node_modules/stylelint/lib/rules/comment-empty-line-before/index.mjs +131 -0
  129. package/packages/config-stylelint/node_modules/stylelint/lib/rules/comment-no-empty/index.mjs +50 -0
  130. package/packages/config-stylelint/node_modules/stylelint/lib/rules/comment-pattern/index.mjs +51 -0
  131. package/packages/config-stylelint/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.mjs +149 -0
  132. package/packages/config-stylelint/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.mjs +63 -0
  133. package/packages/config-stylelint/node_modules/stylelint/lib/rules/container-name-pattern/index.mjs +107 -0
  134. package/packages/config-stylelint/node_modules/stylelint/lib/rules/custom-media-pattern/index.mjs +61 -0
  135. package/packages/config-stylelint/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.mjs +156 -0
  136. package/packages/config-stylelint/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.mjs +148 -0
  137. package/packages/config-stylelint/node_modules/stylelint/lib/rules/custom-property-pattern/index.mjs +100 -0
  138. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.mjs +82 -0
  139. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.mjs +301 -0
  140. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.mjs +411 -0
  141. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.mjs +74 -0
  142. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.mjs +62 -0
  143. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.mjs +160 -0
  144. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-no-important/index.mjs +51 -0
  145. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-max-values/index.mjs +79 -0
  146. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.mjs +108 -0
  147. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.mjs +94 -0
  148. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.mjs +66 -0
  149. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.mjs +66 -0
  150. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-value-keyword-no-deprecated/index.mjs +207 -0
  151. package/packages/config-stylelint/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.mjs +466 -0
  152. package/packages/config-stylelint/node_modules/stylelint/lib/rules/display-notation/index.mjs +225 -0
  153. package/packages/config-stylelint/node_modules/stylelint/lib/rules/font-family-name-quotes/index.mjs +243 -0
  154. package/packages/config-stylelint/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.mjs +122 -0
  155. package/packages/config-stylelint/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.mjs +122 -0
  156. package/packages/config-stylelint/node_modules/stylelint/lib/rules/font-weight-notation/index.mjs +221 -0
  157. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-allowed-list/index.mjs +114 -0
  158. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.mjs +589 -0
  159. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-disallowed-list/index.mjs +73 -0
  160. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.mjs +145 -0
  161. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-name-case/index.mjs +120 -0
  162. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-no-unknown/index.mjs +83 -0
  163. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.mjs +67 -0
  164. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-url-quotes/index.mjs +230 -0
  165. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.mjs +70 -0
  166. package/packages/config-stylelint/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.mjs +70 -0
  167. package/packages/config-stylelint/node_modules/stylelint/lib/rules/hue-degree-notation/index.mjs +123 -0
  168. package/packages/config-stylelint/node_modules/stylelint/lib/rules/import-notation/index.mjs +104 -0
  169. package/packages/config-stylelint/node_modules/stylelint/lib/rules/index.mjs +180 -0
  170. package/packages/config-stylelint/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.mjs +68 -0
  171. package/packages/config-stylelint/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.mjs +54 -0
  172. package/packages/config-stylelint/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.mjs +202 -0
  173. package/packages/config-stylelint/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.mjs +63 -0
  174. package/packages/config-stylelint/node_modules/stylelint/lib/rules/layer-name-pattern/index.mjs +91 -0
  175. package/packages/config-stylelint/node_modules/stylelint/lib/rules/length-zero-no-unit/index.mjs +221 -0
  176. package/packages/config-stylelint/node_modules/stylelint/lib/rules/lightness-notation/index.mjs +165 -0
  177. package/packages/config-stylelint/node_modules/stylelint/lib/rules/max-nesting-depth/index.mjs +195 -0
  178. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.mjs +67 -0
  179. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.mjs +67 -0
  180. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.mjs +79 -0
  181. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.mjs +94 -0
  182. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.mjs +110 -0
  183. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.mjs +100 -0
  184. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.mjs +296 -0
  185. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-feature-range-notation/index.mjs +187 -0
  186. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-query-no-invalid/index.mjs +193 -0
  187. package/packages/config-stylelint/node_modules/stylelint/lib/rules/media-type-no-deprecated/index.mjs +82 -0
  188. package/packages/config-stylelint/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.mjs +117 -0
  189. package/packages/config-stylelint/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.mjs +57 -0
  190. package/packages/config-stylelint/node_modules/stylelint/lib/rules/nesting-selector-no-missing-scoping-root/index.mjs +165 -0
  191. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-descending-specificity/index.mjs +200 -0
  192. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.mjs +156 -0
  193. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.mjs +218 -0
  194. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-empty-source/index.mjs +61 -0
  195. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.mjs +77 -0
  196. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.mjs +76 -0
  197. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-invalid-position-declaration/index.mjs +92 -0
  198. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.mjs +236 -0
  199. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-unknown-animations/index.mjs +71 -0
  200. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-unknown-custom-media/index.mjs +77 -0
  201. package/packages/config-stylelint/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.mjs +72 -0
  202. package/packages/config-stylelint/node_modules/stylelint/lib/rules/number-max-precision/index.mjs +209 -0
  203. package/packages/config-stylelint/node_modules/stylelint/lib/rules/property-allowed-list/index.mjs +58 -0
  204. package/packages/config-stylelint/node_modules/stylelint/lib/rules/property-disallowed-list/index.mjs +58 -0
  205. package/packages/config-stylelint/node_modules/stylelint/lib/rules/property-no-deprecated/index.mjs +143 -0
  206. package/packages/config-stylelint/node_modules/stylelint/lib/rules/property-no-unknown/index.mjs +126 -0
  207. package/packages/config-stylelint/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.mjs +100 -0
  208. package/packages/config-stylelint/node_modules/stylelint/lib/rules/rule-empty-line-before/index.mjs +156 -0
  209. package/packages/config-stylelint/node_modules/stylelint/lib/rules/rule-nesting-at-rule-required-list/index.mjs +85 -0
  210. package/packages/config-stylelint/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.mjs +119 -0
  211. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.mjs +121 -0
  212. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.mjs +69 -0
  213. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.mjs +70 -0
  214. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.mjs +70 -0
  215. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.mjs +107 -0
  216. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-class-pattern/index.mjs +71 -0
  217. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.mjs +81 -0
  218. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.mjs +81 -0
  219. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-disallowed-list/index.mjs +115 -0
  220. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-id-pattern/index.mjs +66 -0
  221. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-attribute/index.mjs +92 -0
  222. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-class/index.mjs +75 -0
  223. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-combinators/index.mjs +77 -0
  224. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.mjs +123 -0
  225. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-id/index.mjs +107 -0
  226. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.mjs +85 -0
  227. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-specificity/index.mjs +146 -0
  228. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-type/index.mjs +219 -0
  229. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-max-universal/index.mjs +95 -0
  230. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-nested-pattern/index.mjs +95 -0
  231. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.mjs +323 -0
  232. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.mjs +92 -0
  233. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-not-notation/index.mjs +217 -0
  234. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.mjs +84 -0
  235. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.mjs +84 -0
  236. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.mjs +179 -0
  237. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.mjs +75 -0
  238. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.mjs +93 -0
  239. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.mjs +74 -0
  240. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.mjs +91 -0
  241. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-type-case/index.mjs +118 -0
  242. package/packages/config-stylelint/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.mjs +148 -0
  243. package/packages/config-stylelint/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.mjs +359 -0
  244. package/packages/config-stylelint/node_modules/stylelint/lib/rules/string-no-newline/index.mjs +120 -0
  245. package/packages/config-stylelint/node_modules/stylelint/lib/rules/syntax-string-no-invalid/index.mjs +80 -0
  246. package/packages/config-stylelint/node_modules/stylelint/lib/rules/time-min-milliseconds/index.mjs +167 -0
  247. package/packages/config-stylelint/node_modules/stylelint/lib/rules/unit-allowed-list/index.mjs +116 -0
  248. package/packages/config-stylelint/node_modules/stylelint/lib/rules/unit-disallowed-list/index.mjs +211 -0
  249. package/packages/config-stylelint/node_modules/stylelint/lib/rules/unit-no-unknown/index.mjs +207 -0
  250. package/packages/config-stylelint/node_modules/stylelint/lib/rules/value-keyword-case/index.mjs +253 -0
  251. package/packages/config-stylelint/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.mjs +92 -0
  252. package/packages/config-stylelint/node_modules/stylelint/lib/standalone.mjs +383 -0
  253. package/packages/config-stylelint/node_modules/stylelint/lib/timing.mjs +134 -0
  254. package/packages/config-stylelint/node_modules/stylelint/lib/unscopedDisables.mjs +66 -0
  255. package/packages/config-stylelint/node_modules/stylelint/lib/utils/FileCache.mjs +115 -0
  256. package/packages/config-stylelint/node_modules/stylelint/lib/utils/addEmptyLineBefore.mjs +21 -0
  257. package/packages/config-stylelint/node_modules/stylelint/lib/utils/addSemicolonForEditInfo.mjs +35 -0
  258. package/packages/config-stylelint/node_modules/stylelint/lib/utils/appendRuleName.mjs +13 -0
  259. package/packages/config-stylelint/node_modules/stylelint/lib/utils/arrayEqual.mjs +14 -0
  260. package/packages/config-stylelint/node_modules/stylelint/lib/utils/beforeBlockString.mjs +28 -0
  261. package/packages/config-stylelint/node_modules/stylelint/lib/utils/blockString.mjs +19 -0
  262. package/packages/config-stylelint/node_modules/stylelint/lib/utils/blurInterpolation.mjs +8 -0
  263. package/packages/config-stylelint/node_modules/stylelint/lib/utils/cachedImport.mjs +68 -0
  264. package/packages/config-stylelint/node_modules/stylelint/lib/utils/checkAgainstRule.mjs +71 -0
  265. package/packages/config-stylelint/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.mjs +105 -0
  266. package/packages/config-stylelint/node_modules/stylelint/lib/utils/configurationComment.mjs +74 -0
  267. package/packages/config-stylelint/node_modules/stylelint/lib/utils/containsString.mjs +52 -0
  268. package/packages/config-stylelint/node_modules/stylelint/lib/utils/createMapWithSet.mjs +19 -0
  269. package/packages/config-stylelint/node_modules/stylelint/lib/utils/dynamicImport.mjs +13 -0
  270. package/packages/config-stylelint/node_modules/stylelint/lib/utils/eachDeclarationBlock.mjs +59 -0
  271. package/packages/config-stylelint/node_modules/stylelint/lib/utils/eachNodeUpToRoot.mjs +22 -0
  272. package/packages/config-stylelint/node_modules/stylelint/lib/utils/emitWarning.mjs +84 -0
  273. package/packages/config-stylelint/node_modules/stylelint/lib/utils/errors.mjs +55 -0
  274. package/packages/config-stylelint/node_modules/stylelint/lib/utils/filterFilePaths.mjs +17 -0
  275. package/packages/config-stylelint/node_modules/stylelint/lib/utils/findAnimationName.mjs +74 -0
  276. package/packages/config-stylelint/node_modules/stylelint/lib/utils/findAtRuleContext.mjs +27 -0
  277. package/packages/config-stylelint/node_modules/stylelint/lib/utils/findFontFamily.mjs +148 -0
  278. package/packages/config-stylelint/node_modules/stylelint/lib/utils/findMediaFeatureNames.mjs +151 -0
  279. package/packages/config-stylelint/node_modules/stylelint/lib/utils/findNodeUpToRoot.mjs +25 -0
  280. package/packages/config-stylelint/node_modules/stylelint/lib/utils/fixEmptyLinesBefore.mjs +26 -0
  281. package/packages/config-stylelint/node_modules/stylelint/lib/utils/functionArgumentsSearch.mjs +65 -0
  282. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getAtRuleParams.mjs +7 -0
  283. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getDeclarationValue.mjs +9 -0
  284. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getDimension.mjs +62 -0
  285. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getFileIgnorer.mjs +41 -0
  286. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getFormatter.mjs +43 -0
  287. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getFormatterOptionsText.mjs +12 -0
  288. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getImportantPosition.mjs +15 -0
  289. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getLexer.mjs +39 -0
  290. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getModulePath.mjs +35 -0
  291. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.mjs +34 -0
  292. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.mjs +36 -0
  293. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getRelativePath.mjs +12 -0
  294. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getRuleSelector.mjs +9 -0
  295. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getSchemeFromUrl.mjs +36 -0
  296. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getSelectorSourceIndex.mjs +12 -0
  297. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getStrippedSelectorSource.mjs +47 -0
  298. package/packages/config-stylelint/node_modules/stylelint/lib/utils/getStylelintRule.mjs +22 -0
  299. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasBlock.mjs +9 -0
  300. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasEmptyLine.mjs +13 -0
  301. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasInterpolation.mjs +24 -0
  302. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasLessInterpolation.mjs +11 -0
  303. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasPsvInterpolation.mjs +11 -0
  304. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasScssInterpolation.mjs +11 -0
  305. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hasTplInterpolation.mjs +11 -0
  306. package/packages/config-stylelint/node_modules/stylelint/lib/utils/hash.mjs +10 -0
  307. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isAfterBlock.mjs +15 -0
  308. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isAfterComment.mjs +15 -0
  309. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isAfterSingleLineComment.mjs +19 -0
  310. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.mjs +19 -0
  311. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isAutoprefixable.mjs +364 -0
  312. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.mjs +21 -0
  313. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.mjs +21 -0
  314. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.mjs +24 -0
  315. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.mjs +19 -0
  316. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.mjs +19 -0
  317. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCustomElement.mjs +34 -0
  318. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCustomFunction.mjs +9 -0
  319. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCustomMediaQuery.mjs +8 -0
  320. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCustomProperty.mjs +8 -0
  321. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isCustomSelector.mjs +9 -0
  322. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isDescriptorDeclaration.mjs +22 -0
  323. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isFirstNested.mjs +83 -0
  324. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.mjs +17 -0
  325. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isHexColor.mjs +9 -0
  326. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isInDocument.mjs +32 -0
  327. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isKeyframeRule.mjs +17 -0
  328. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isKeyframeSelector.mjs +29 -0
  329. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isMathFunction.mjs +11 -0
  330. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isNonNegativeInteger.mjs +6 -0
  331. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isNumbery.mjs +9 -0
  332. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isOnlyWhitespace.mjs +17 -0
  333. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isPathNotFoundError.mjs +9 -0
  334. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isScssVariable.mjs +19 -0
  335. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isSharedLineComment.mjs +53 -0
  336. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isSingleLineString.mjs +10 -0
  337. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.mjs +32 -0
  338. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.mjs +24 -0
  339. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.mjs +32 -0
  340. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxComment.mjs +13 -0
  341. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.mjs +57 -0
  342. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.mjs +28 -0
  343. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.mjs +14 -0
  344. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.mjs +15 -0
  345. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.mjs +32 -0
  346. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxRule.mjs +24 -0
  347. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.mjs +56 -0
  348. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.mjs +56 -0
  349. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.mjs +49 -0
  350. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isStandardSyntaxValue.mjs +51 -0
  351. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.mjs +24 -0
  352. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isUnicodeSupported.mjs +26 -0
  353. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isUrlFunction.mjs +9 -0
  354. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isValidFontSize.mjs +38 -0
  355. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isValidHex.mjs +11 -0
  356. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isValidIdentifier.mjs +39 -0
  357. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isVarFunction.mjs +9 -0
  358. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isVariable.mjs +9 -0
  359. package/packages/config-stylelint/node_modules/stylelint/lib/utils/isWhitespace.mjs +9 -0
  360. package/packages/config-stylelint/node_modules/stylelint/lib/utils/matchesStringOrRegExp.mjs +97 -0
  361. package/packages/config-stylelint/node_modules/stylelint/lib/utils/mergeSyntaxDefinitions.mjs +137 -0
  362. package/packages/config-stylelint/node_modules/stylelint/lib/utils/narrowFixRange.mjs +68 -0
  363. package/packages/config-stylelint/node_modules/stylelint/lib/utils/nodeContextLookup.mjs +41 -0
  364. package/packages/config-stylelint/node_modules/stylelint/lib/utils/nodeFieldIndices.mjs +119 -0
  365. package/packages/config-stylelint/node_modules/stylelint/lib/utils/normalizeFilePath.mjs +26 -0
  366. package/packages/config-stylelint/node_modules/stylelint/lib/utils/normalizeFixMode.mjs +22 -0
  367. package/packages/config-stylelint/node_modules/stylelint/lib/utils/normalizeSelector.mjs +231 -0
  368. package/packages/config-stylelint/node_modules/stylelint/lib/utils/optionsMatches.mjs +20 -0
  369. package/packages/config-stylelint/node_modules/stylelint/lib/utils/optionsMatchesEntry.mjs +29 -0
  370. package/packages/config-stylelint/node_modules/stylelint/lib/utils/parseCustomMediaQuery.mjs +15 -0
  371. package/packages/config-stylelint/node_modules/stylelint/lib/utils/parseMediaQuery.mjs +15 -0
  372. package/packages/config-stylelint/node_modules/stylelint/lib/utils/parseSelector.mjs +19 -0
  373. package/packages/config-stylelint/node_modules/stylelint/lib/utils/pathExists.mjs +16 -0
  374. package/packages/config-stylelint/node_modules/stylelint/lib/utils/pluralize.mjs +10 -0
  375. package/packages/config-stylelint/node_modules/stylelint/lib/utils/putIfAbsent.mjs +20 -0
  376. package/packages/config-stylelint/node_modules/stylelint/lib/utils/rangesOverlap.mjs +19 -0
  377. package/packages/config-stylelint/node_modules/stylelint/lib/utils/rawNodeString.mjs +29 -0
  378. package/packages/config-stylelint/node_modules/stylelint/lib/utils/regexes.mjs +135 -0
  379. package/packages/config-stylelint/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.mjs +13 -0
  380. package/packages/config-stylelint/node_modules/stylelint/lib/utils/report.mjs +321 -0
  381. package/packages/config-stylelint/node_modules/stylelint/lib/utils/reportCommentProblem.mjs +39 -0
  382. package/packages/config-stylelint/node_modules/stylelint/lib/utils/resolveFilePath.mjs +38 -0
  383. package/packages/config-stylelint/node_modules/stylelint/lib/utils/resolveNestedSelectorsForRule.mjs +108 -0
  384. package/packages/config-stylelint/node_modules/stylelint/lib/utils/resolveOptionValue.mjs +30 -0
  385. package/packages/config-stylelint/node_modules/stylelint/lib/utils/resolveSilent.mjs +144 -0
  386. package/packages/config-stylelint/node_modules/stylelint/lib/utils/ruleMessages.mjs +18 -0
  387. package/packages/config-stylelint/node_modules/stylelint/lib/utils/setAtRuleParams.mjs +18 -0
  388. package/packages/config-stylelint/node_modules/stylelint/lib/utils/setDeclarationValue.mjs +18 -0
  389. package/packages/config-stylelint/node_modules/stylelint/lib/utils/suppressionsService.mjs +317 -0
  390. package/packages/config-stylelint/node_modules/stylelint/lib/utils/toPath.mjs +23 -0
  391. package/packages/config-stylelint/node_modules/stylelint/lib/utils/typeGuards.mjs +90 -0
  392. package/packages/config-stylelint/node_modules/stylelint/lib/utils/uniteSets.mjs +9 -0
  393. package/packages/config-stylelint/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.mjs +29 -0
  394. package/packages/config-stylelint/node_modules/stylelint/lib/utils/validateObjectWithProps.mjs +28 -0
  395. package/packages/config-stylelint/node_modules/stylelint/lib/utils/validateOptions.mjs +176 -0
  396. package/packages/config-stylelint/node_modules/stylelint/lib/utils/validateTypes.mjs +148 -0
  397. package/packages/config-stylelint/node_modules/stylelint/lib/utils/vendor.mjs +43 -0
  398. package/packages/config-stylelint/node_modules/stylelint/lib/validateDisableSettings.mjs +67 -0
  399. package/packages/config-stylelint/node_modules/stylelint/lib/writeOutputFile.mjs +15 -0
  400. package/packages/config-stylelint/node_modules/stylelint/package.json +211 -0
  401. package/packages/config-stylelint/node_modules/stylelint/types/stylelint/index.d.ts +1594 -0
  402. package/packages/config-stylelint/node_modules/unicorn-magic/default.d.ts +13 -0
  403. package/packages/config-stylelint/node_modules/unicorn-magic/default.js +14 -0
  404. package/packages/config-stylelint/node_modules/unicorn-magic/license +9 -0
  405. package/packages/config-stylelint/node_modules/unicorn-magic/node.d.ts +125 -0
  406. package/packages/config-stylelint/node_modules/unicorn-magic/node.js +49 -0
  407. package/packages/config-stylelint/node_modules/unicorn-magic/package.json +68 -0
  408. package/packages/config-stylelint/node_modules/unicorn-magic/readme.md +31 -0
  409. package/packages/config-stylelint/package.json +3 -3
  410. package/packages/config-stylelint/plugins/color-format.js +2 -2
@@ -0,0 +1,1594 @@
1
+ import type * as PostCSS from 'postcss';
2
+ import type { Options as GlobbyOptions } from 'globby';
3
+ import type { cosmiconfig, TransformSync as CosmiconfigTransformSync } from 'cosmiconfig';
4
+
5
+ type ConfigExtends = string | string[];
6
+
7
+ type ConfigPlugins = string | stylelint.Plugin | (string | stylelint.Plugin)[];
8
+
9
+ type ConfigIgnoreFiles = string | string[];
10
+
11
+ type ConfigRules = {
12
+ [ruleName: string]: stylelint.ConfigRuleSettings<any, Object>;
13
+ };
14
+
15
+ type ConfigOverride = Omit<stylelint.Config, 'overrides'> & {
16
+ files: string | string[];
17
+ name?: string;
18
+ };
19
+
20
+ type ConfigProcessors = string[];
21
+
22
+ type DisableSettings = stylelint.ConfigRuleSettings<boolean, stylelint.DisableOptions>;
23
+
24
+ // A meta-type that returns a union over all properties of `T` whose values
25
+ // have type `U`.
26
+ // see sindresorhus/type-fest#630
27
+ type PropertyNamesOfType<T, U> = {
28
+ [K in keyof T]-?: T[K] extends U ? K : never;
29
+ }[keyof T];
30
+
31
+ type FileCache = {
32
+ calcHashOfConfig: (config: stylelint.Config) => void;
33
+ hasFileChanged: (absoluteFilepath: string) => boolean;
34
+ reconcile: () => void;
35
+ destroy: () => void;
36
+ removeEntry: (absoluteFilepath: string) => void;
37
+ };
38
+
39
+ type RuleFuncArgs = (string | RegExp | number | boolean | (string | RegExp)[])[];
40
+
41
+ // Note: With strict function types enabled, function signatures are checked contravariantly.
42
+ // This means that it would not be possible for rule authors to narrow the message function
43
+ // parameters to e.g. just `string`. Declaring the type for rule message functions through
44
+ // method declarations tricks TypeScript into bivariant signature checking. More details can
45
+ // be found here: https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types.
46
+ // and in the original discussion: https://github.com/stylelint/stylelint/pull/6147#issuecomment-1155337016.
47
+ type RuleMessageFunc = {
48
+ bivariance(...args: RuleFuncArgs): string;
49
+ }['bivariance'];
50
+
51
+ type RuleSeverityFunc = {
52
+ bivariance(...args: RuleFuncArgs): stylelint.Severity | null;
53
+ }['bivariance'];
54
+
55
+ type RuleOptionsPossibleFunc = (value: unknown) => boolean;
56
+
57
+ type DisableReportEntry = {
58
+ source?: string;
59
+ ranges: stylelint.DisableReportRange[];
60
+ };
61
+
62
+ declare namespace stylelint {
63
+ /**
64
+ * Rule severity.
65
+ */
66
+ export type Severity = 'warning' | 'error';
67
+
68
+ /**
69
+ * A Stylelint plugin.
70
+ */
71
+ export type Plugin =
72
+ | { default?: { ruleName: string; rule: Rule } }
73
+ | { ruleName: string; rule: Rule };
74
+
75
+ /** @internal */
76
+ export type ConfigRuleSettings<T, O extends Object> =
77
+ | null
78
+ | undefined
79
+ | NonNullable<T>
80
+ | [NonNullable<T>]
81
+ | [NonNullable<T>, O];
82
+
83
+ /** @internal */
84
+ export type DisableOptions = {
85
+ except?: Array<StringOrRegex>;
86
+ severity?: Severity;
87
+ };
88
+
89
+ type LanguageOptions = {
90
+ syntax?: {
91
+ atRules?: Record<
92
+ string,
93
+ {
94
+ comment?: string;
95
+ prelude?: string;
96
+ descriptors?: Record<string, string>;
97
+ }
98
+ >;
99
+ cssWideKeywords?: string[];
100
+ properties?: Record<string, string>;
101
+ types?: Record<string, string>;
102
+ };
103
+ };
104
+
105
+ /**
106
+ * Configuration.
107
+ */
108
+ export type Config = {
109
+ /**
110
+ * Allows to extend an existing configuration. Configurations can bundle plugins, custom syntaxes,
111
+ * options, and configure rules. They can also extend other configurations
112
+ *
113
+ * @see [extends](https://stylelint.io/user-guide/configure/#extends)
114
+ */
115
+ extends?: ConfigExtends;
116
+ /**
117
+ * Custom rules or sets of custom rules built to support methodologies, toolsets,
118
+ * non-standard CSS features, or very specific use cases
119
+ *
120
+ * @see [plugins](https://stylelint.io/user-guide/configure/#plugins)
121
+ */
122
+ plugins?: ConfigPlugins;
123
+ pluginFunctions?: {
124
+ [pluginName: string]: Rule;
125
+ };
126
+ /**
127
+ * A glob or array of globs to ignore specific files
128
+ *
129
+ * @default 'node_modules'
130
+ *
131
+ * @see [ignoreFiles](https://stylelint.io/user-guide/configure/#ignorefiles)
132
+ */
133
+ ignoreFiles?: ConfigIgnoreFiles;
134
+ ignorePatterns?: string;
135
+ /**
136
+ * An object containing the configured rules
137
+ *
138
+ * @see [rules](https://stylelint.io/user-guide/configure/#rules)
139
+ */
140
+ rules?: ConfigRules;
141
+ /**
142
+ * Only register problems for rules with an "error"-level severity (ignore "warning"-level)
143
+ *
144
+ * @see [quiet](https://stylelint.io/user-guide/options/#quiet)
145
+ */
146
+ quiet?: boolean;
147
+ /**
148
+ * A string to specify the name of a formatter or a path to a custom formatter function
149
+ *
150
+ * @see [formatter](https://stylelint.io/user-guide/configure#formatter)
151
+ */
152
+ formatter?: FormatterType | Formatter;
153
+ /**
154
+ * A string to set the default severity level for all rules that do not have a severity
155
+ * specified in their secondary options
156
+ *
157
+ * @see [defaultSeverity](https://stylelint.io/user-guide/configure#defaultseverity)
158
+ */
159
+ defaultSeverity?: Severity;
160
+ /**
161
+ * A boolean value indicating if 'stylelint-disable' comments will be ignored
162
+ *
163
+ * @see [ignoreDisables](https://stylelint.io/user-guide/configure#ignoredisables)
164
+ */
165
+ ignoreDisables?: boolean;
166
+ /**
167
+ * Report configuration comments that don't match any lints that need to be disabled
168
+ *
169
+ * @see [reportNeedlessDisables](https://stylelint.io/user-guide/configure#reportneedlessdisables)
170
+ */
171
+ reportNeedlessDisables?: DisableSettings;
172
+ /**
173
+ * Report configuration comments that don't match rules that are specified in the configuration object
174
+ *
175
+ * @see [reportInvalidScopeDisables](https://stylelint.io/user-guide/configure#reportinvalidscopedisables)
176
+ */
177
+ reportInvalidScopeDisables?: DisableSettings;
178
+ /**
179
+ * Report configuration comments without a description
180
+ *
181
+ * @see [reportDescriptionlessDisables](https://stylelint.io/user-guide/configure#reportdescriptionlessdisables)
182
+ */
183
+ reportDescriptionlessDisables?: DisableSettings;
184
+ /**
185
+ * Report configuration comments that are not scoped to at least one rule
186
+ *
187
+ * @see [reportUnscopedDisables](https://stylelint.io/user-guide/configure#reportunscopeddisables)
188
+ */
189
+ reportUnscopedDisables?: DisableSettings;
190
+ /**
191
+ * A string to set what configuration comments like 'stylelint-disable' start with.
192
+ * Сan be useful when using multiple instances of Stylelint with different configurations.
193
+ *
194
+ * @see [configurationComment](https://stylelint.io/user-guide/configure#configurationcomment)
195
+ */
196
+ configurationComment?: string;
197
+ /**
198
+ * An array of objects to specify what subset of files to apply a configuration to
199
+ *
200
+ * @see [overrides](https://stylelint.io/user-guide/configure#overrides)
201
+ */
202
+ overrides?: ConfigOverride[];
203
+ /**
204
+ * Allows to specify a custom syntax to use in code
205
+ *
206
+ * @see [customSyntax](https://stylelint.io/user-guide/configure#customsyntax)
207
+ */
208
+ customSyntax?: CustomSyntax;
209
+ /**
210
+ * Functions that allow to hook into Stylelint's pipeline
211
+ *
212
+ * @experimental
213
+ *
214
+ * @see [processors](https://stylelint.io/user-guide/configure#processors)
215
+ */
216
+ processors?: ConfigProcessors;
217
+ languageOptions?: LanguageOptions;
218
+ /** @internal */
219
+ _processorFunctions?: Map<string, ReturnType<Processor>['postprocess']>;
220
+ /**
221
+ * If true, Stylelint does not throw an error when the glob pattern matches no files.
222
+ *
223
+ * Should not be overridden on a per-file basis
224
+ *
225
+ * @see [allowEmptyInput](https://stylelint.io/user-guide/configure#allowemptyinput)
226
+ */
227
+ allowEmptyInput?: boolean;
228
+ /**
229
+ * If true, store the results of processed files so that Stylelint only operates on the changed ones.
230
+ *
231
+ * Should not be overridden on a per-file basis
232
+ *
233
+ * @see [cache](https://stylelint.io/user-guide/configure#cache)
234
+ */
235
+ cache?: boolean;
236
+ /**
237
+ * If true, automatically fix, where possible, problems reported by rules.
238
+ *
239
+ * Should not be overridden on a per-file basis
240
+ *
241
+ * @see [fix](https://stylelint.io/user-guide/configure#fix)
242
+ */
243
+ fix?: boolean;
244
+ computeEditInfo?: boolean;
245
+ /**
246
+ * Force enable/disable the validation of the rules' options
247
+ *
248
+ * @default true
249
+ *
250
+ * @see [validate](https://stylelint.io/user-guide/options/#validate)
251
+ */
252
+ validate?: boolean;
253
+ };
254
+
255
+ /** @internal */
256
+ export type DisablePropertyName = PropertyNamesOfType<Config, DisableSettings>;
257
+
258
+ /** @internal */
259
+ export type CosmiconfigResult =
260
+ | (ReturnType<CosmiconfigTransformSync> & { config: Config })
261
+ | null;
262
+
263
+ /** @internal */
264
+ export type DisabledRange = {
265
+ node: PostCSS.Node;
266
+ start: number;
267
+ strictStart: boolean;
268
+ end?: number;
269
+ strictEnd?: boolean;
270
+ rules?: string[];
271
+ description?: string;
272
+ };
273
+
274
+ /** @internal */
275
+ export type DisabledRangeObject = {
276
+ [ruleName: string]: DisabledRange[];
277
+ };
278
+
279
+ /** @internal */
280
+ export type DisabledWarning = { line: number; rule: string };
281
+
282
+ /** @internal */
283
+ export type StylelintPostcssResult = {
284
+ ruleSeverities: { [ruleName: string]: RuleSeverity };
285
+ customMessages: { [ruleName: string]: RuleMessage };
286
+ customUrls: { [ruleName: string]: string };
287
+ ruleMetadata: { [ruleName: string]: Partial<RuleMeta> };
288
+ rangesOfComputedEditInfos: Array<EditInfo['range']>;
289
+ fixersData: { [ruleName: string]: number };
290
+ quiet?: boolean;
291
+ quietDeprecationWarnings?: boolean;
292
+ disabledRanges: DisabledRangeObject;
293
+ disabledWarnings?: DisabledWarning[];
294
+ ignored?: boolean;
295
+ stylelintError?: boolean;
296
+ stylelintWarning?: boolean;
297
+ config?: Config;
298
+
299
+ // NOTE: The type indeed is `CSSTreeLexer` from `css-tree`, but we don't want
300
+ // to add `@types/css-tree` as a runtime dependency. Ref #9131.
301
+ lexer: unknown;
302
+ };
303
+
304
+ type StylelintWarningType = 'deprecation' | 'invalidOption' | 'parseError';
305
+
306
+ /** @internal */
307
+ export type WarningOptions = PostCSS.WarningOptions & {
308
+ stylelintType?: StylelintWarningType;
309
+ severity?: Severity;
310
+ url?: string;
311
+ rule?: string;
312
+ fix?: EditInfo;
313
+ };
314
+
315
+ /** @internal */
316
+ export type PostcssResult = PostCSS.Result & {
317
+ stylelint: StylelintPostcssResult;
318
+ warn(message: string, options?: WarningOptions): void;
319
+ };
320
+
321
+ /** @internal */
322
+ export type Formatter = (results: LintResult[], returnValue: LinterResult) => string;
323
+
324
+ type Formatters = {
325
+ readonly compact: Promise<Formatter>;
326
+ readonly json: Promise<Formatter>;
327
+ readonly string: Promise<Formatter>;
328
+ readonly tap: Promise<Formatter>;
329
+ readonly unix: Promise<Formatter>;
330
+ readonly verbose: Promise<Formatter>;
331
+ };
332
+
333
+ /** @internal */
334
+ export type FormatterType = keyof Formatters;
335
+
336
+ /** @internal */
337
+ export type CustomSyntax = string | PostCSS.Syntax;
338
+
339
+ /**
340
+ * WARNING: This is an experimental feature. The API may change in the future.
341
+ */
342
+ export type Processor = () => {
343
+ name: string;
344
+ postprocess: (result: LintResult, root?: PostCSS.Root) => void;
345
+ };
346
+
347
+ /** @internal */
348
+ export type RuleMessage = string | RuleMessageFunc;
349
+
350
+ /** @internal */
351
+ export type RuleMessages = { [message: string]: RuleMessage };
352
+
353
+ /** @internal */
354
+ export type RuleOptionsPossible = boolean | number | string | RuleOptionsPossibleFunc;
355
+
356
+ /** @internal */
357
+ export type RuleOptions = {
358
+ actual: unknown;
359
+ possible?:
360
+ | RuleOptionsPossibleFunc
361
+ | RuleOptionsPossible[]
362
+ | Record<string, RuleOptionsPossible[]>;
363
+ optional?: boolean;
364
+ };
365
+
366
+ /** @internal */
367
+ type RuleSeverity = Severity | RuleSeverityFunc;
368
+
369
+ /**
370
+ * A rule context.
371
+ */
372
+ export type RuleContext = {
373
+ configurationComment?: string | undefined;
374
+ fix?: boolean | undefined;
375
+ newline?: string | undefined;
376
+ };
377
+
378
+ /** @internal */
379
+ export type RuleBase<P = any, S = any> = (
380
+ primaryOption: P,
381
+ secondaryOptions: S,
382
+ context: RuleContext,
383
+ ) => (root: PostCSS.Root, result: PostcssResult) => Promise<void> | void;
384
+
385
+ /** @internal */
386
+ export type RuleMeta = {
387
+ url: string;
388
+ deprecated?: boolean;
389
+ fixable?: boolean;
390
+ };
391
+
392
+ /** @internal */
393
+ export type Range = {
394
+ start: Position;
395
+ end: Position;
396
+ };
397
+
398
+ /**
399
+ * A rule.
400
+ */
401
+ export type Rule<P = any, S = any, M = RuleMessages> = RuleBase<P, S> & {
402
+ ruleName: string;
403
+ messages: M;
404
+ primaryOptionArray?: boolean;
405
+ meta?: RuleMeta;
406
+ };
407
+
408
+ type StringOrRegex = string | RegExp;
409
+ type OneOrMany<S> = S | S[];
410
+ type Primary = number | true | OneOrMany<StringOrRegex> | Record<string, any>;
411
+ type Secondary = Record<string, any>;
412
+
413
+ // see sindresorhus/type-fest#821
414
+ type Messages = {
415
+ [key in `expected${string}` | `rejected${string}`]: RuleMessage;
416
+ };
417
+
418
+ type ExpectedMessage<T extends unknown[]> = { expected: (...args: T) => string };
419
+ type RejectedMessage<T extends unknown[]> = { rejected: (...args: T) => string };
420
+ type AutofixMessage = ExpectedMessage<[actual: string, expected: string]>;
421
+ type PatternMessage = ExpectedMessage<[input: string, pattern: StringOrRegex]>;
422
+ type MaximumMessage = ExpectedMessage<[selector: string, maximum: number]>;
423
+
424
+ type CoreRule<
425
+ P extends Primary,
426
+ S extends Secondary = Secondary,
427
+ M extends Messages = Messages,
428
+ > = Rule<P, S, M>;
429
+ type NotationRule<P extends string, S extends object = {}> = CoreRule<
430
+ P,
431
+ S,
432
+ ExpectedMessage<[primary: P]>
433
+ >;
434
+ type PatternRule<S extends object = {}> = CoreRule<StringOrRegex, S, PatternMessage>;
435
+ type MaxRule<S extends object = {}> = CoreRule<number, S, MaximumMessage>;
436
+
437
+ /** @internal */
438
+ export type CoreRules = {
439
+ 'alpha-value-notation': CoreRule<
440
+ 'number' | 'percentage',
441
+ { exceptProperties: OneOrMany<StringOrRegex> },
442
+ AutofixMessage
443
+ >;
444
+ 'annotation-no-unknown': CoreRule<
445
+ true,
446
+ { ignoreAnnotations: OneOrMany<StringOrRegex> },
447
+ RejectedMessage<[annotation: string]>
448
+ >;
449
+ 'at-rule-allowed-list': CoreRule<
450
+ OneOrMany<StringOrRegex>,
451
+ {},
452
+ RejectedMessage<[atRule: string]>
453
+ >;
454
+ 'at-rule-descriptor-no-unknown': CoreRule<
455
+ true,
456
+ {},
457
+ RejectedMessage<[atRule: string, descriptor: string]>
458
+ >;
459
+ 'at-rule-descriptor-value-no-unknown': CoreRule<
460
+ true,
461
+ {},
462
+ RejectedMessage<[descriptor: string, value: string]>
463
+ >;
464
+ 'at-rule-disallowed-list': CoreRule<
465
+ OneOrMany<StringOrRegex>,
466
+ {},
467
+ RejectedMessage<[atRule: string]>
468
+ >;
469
+ 'at-rule-empty-line-before': CoreRule<
470
+ 'always' | 'never',
471
+ {
472
+ except: OneOrMany<
473
+ | 'after-same-name'
474
+ | 'inside-block'
475
+ | 'blockless-after-same-name-blockless'
476
+ | 'blockless-after-blockless'
477
+ | 'first-nested'
478
+ >;
479
+ ignore: OneOrMany<
480
+ | 'after-comment'
481
+ | 'first-nested'
482
+ | 'inside-block'
483
+ | 'blockless-after-same-name-blockless'
484
+ | 'blockless-after-blockless'
485
+ >;
486
+ ignoreAtRules: OneOrMany<StringOrRegex>;
487
+ }
488
+ >;
489
+ 'at-rule-no-deprecated': CoreRule<
490
+ true,
491
+ { ignoreAtRules: OneOrMany<StringOrRegex> },
492
+ RejectedMessage<[atRule: string]>
493
+ >;
494
+ 'at-rule-no-unknown': CoreRule<
495
+ true,
496
+ { ignoreAtRules: OneOrMany<StringOrRegex> },
497
+ RejectedMessage<[atRule: string]>
498
+ >;
499
+ 'at-rule-no-vendor-prefix': CoreRule<
500
+ true,
501
+ { ignoreAtRules: OneOrMany<StringOrRegex> },
502
+ RejectedMessage<[property: string]>
503
+ >;
504
+ 'at-rule-prelude-no-invalid': CoreRule<
505
+ true,
506
+ { ignoreAtRules: OneOrMany<StringOrRegex> },
507
+ RejectedMessage<[atRule: string, prelude: string]>
508
+ >;
509
+ 'at-rule-property-required-list': CoreRule<
510
+ Record<string, OneOrMany<string>>,
511
+ {},
512
+ ExpectedMessage<[atRule: string, property: string] | [atRule: string, descriptor: string]>
513
+ >;
514
+ 'block-no-empty': CoreRule<true, { ignore: OneOrMany<'comments'> }>;
515
+ 'block-no-redundant-nested-style-rules': CoreRule<true>;
516
+ 'color-function-alias-notation': CoreRule<'with-alpha' | 'without-alpha', {}, AutofixMessage>;
517
+ 'color-function-notation': CoreRule<
518
+ 'modern' | 'legacy',
519
+ { ignore: OneOrMany<'with-var-inside'> }
520
+ >;
521
+ 'color-hex-alpha': CoreRule<
522
+ 'always' | 'never',
523
+ {},
524
+ ExpectedMessage<[hex: string]> & RejectedMessage<[hex: string]>
525
+ >;
526
+ 'color-hex-length': CoreRule<'short' | 'long', {}, AutofixMessage>;
527
+ 'color-named': CoreRule<
528
+ 'never' | 'always-where-possible',
529
+ { ignoreProperties: OneOrMany<StringOrRegex>; ignore: OneOrMany<'inside-function'> },
530
+ AutofixMessage & RejectedMessage<[keyword: string]>
531
+ >;
532
+ 'color-no-hex': CoreRule<true, {}, RejectedMessage<[hex: string]>>;
533
+ 'color-no-invalid-hex': CoreRule<true, {}, RejectedMessage<[hex: string]>>;
534
+ 'comment-empty-line-before': CoreRule<
535
+ 'always' | 'never',
536
+ {
537
+ except: OneOrMany<'first-nested'>;
538
+ ignore: OneOrMany<'stylelint-commands' | 'after-comment'>;
539
+ ignoreComments: OneOrMany<StringOrRegex>;
540
+ }
541
+ >;
542
+ 'comment-no-empty': CoreRule<true>;
543
+ 'comment-pattern': CoreRule<StringOrRegex, {}, ExpectedMessage<[pattern: StringOrRegex]>>;
544
+ 'comment-whitespace-inside': CoreRule<'always' | 'never'>;
545
+ 'comment-word-disallowed-list': CoreRule<
546
+ OneOrMany<StringOrRegex>,
547
+ {},
548
+ RejectedMessage<[pattern: StringOrRegex]>
549
+ >;
550
+ 'container-name-pattern': PatternRule;
551
+ 'custom-media-pattern': PatternRule;
552
+ 'custom-property-empty-line-before': CoreRule<
553
+ 'always' | 'never',
554
+ {
555
+ except: OneOrMany<
556
+ 'after-block' | 'after-comment' | 'after-custom-property' | 'first-nested'
557
+ >;
558
+ ignore: OneOrMany<
559
+ 'after-comment' | 'after-custom-property' | 'first-nested' | 'inside-single-line-block'
560
+ >;
561
+ }
562
+ >;
563
+ 'custom-property-no-missing-var-function': CoreRule<
564
+ true,
565
+ {},
566
+ RejectedMessage<[property: string]>
567
+ >;
568
+ 'custom-property-pattern': PatternRule;
569
+ 'display-notation': CoreRule<
570
+ 'short' | 'full',
571
+ {},
572
+ ExpectedMessage<[unexpected: string, expected: string]>
573
+ >;
574
+ 'declaration-block-no-duplicate-custom-properties': CoreRule<
575
+ true,
576
+ { ignoreProperties: OneOrMany<StringOrRegex> },
577
+ RejectedMessage<[property: string]>
578
+ >;
579
+ 'declaration-block-no-duplicate-properties': CoreRule<
580
+ true,
581
+ {
582
+ ignore: OneOrMany<
583
+ | 'consecutive-duplicates'
584
+ | 'consecutive-duplicates-with-different-values'
585
+ | 'consecutive-duplicates-with-different-syntaxes'
586
+ | 'consecutive-duplicates-with-same-prefixless-values'
587
+ >;
588
+ ignoreProperties: OneOrMany<StringOrRegex>;
589
+ },
590
+ RejectedMessage<[property: string]>
591
+ >;
592
+ 'rule-nesting-at-rule-required-list': CoreRule<
593
+ OneOrMany<StringOrRegex>,
594
+ {},
595
+ ExpectedMessage<[patterns: StringOrRegex[]]>
596
+ >;
597
+ 'declaration-block-no-redundant-longhand-properties': CoreRule<
598
+ true,
599
+ {
600
+ ignoreShorthands: OneOrMany<StringOrRegex>;
601
+ ignoreLonghands: OneOrMany<string>;
602
+ },
603
+ ExpectedMessage<[property: string]>
604
+ >;
605
+ 'declaration-block-no-shorthand-property-overrides': CoreRule<
606
+ true,
607
+ {},
608
+ RejectedMessage<[shorthand: string, property: string]>
609
+ >;
610
+ 'declaration-block-single-line-max-declarations': CoreRule<
611
+ number,
612
+ {},
613
+ ExpectedMessage<[maximum: number]>
614
+ >;
615
+ 'declaration-empty-line-before': CoreRule<
616
+ 'always' | 'never',
617
+ {
618
+ except: OneOrMany<'first-nested' | 'after-block' | 'after-comment' | 'after-declaration'>;
619
+ ignore: OneOrMany<
620
+ 'after-comment' | 'after-declaration' | 'first-nested' | 'inside-single-line-block'
621
+ >;
622
+ }
623
+ >;
624
+ 'declaration-no-important': CoreRule<true>;
625
+ 'declaration-property-max-values': CoreRule<
626
+ Record<string, number>,
627
+ {},
628
+ ExpectedMessage<[property: string, maximum: number]>
629
+ >;
630
+ 'declaration-property-unit-allowed-list': CoreRule<
631
+ Record<string, OneOrMany<string>>,
632
+ { ignore: OneOrMany<'inside-function'> },
633
+ RejectedMessage<[property: string, unit: string]>
634
+ >;
635
+ 'declaration-property-unit-disallowed-list': CoreRule<
636
+ Record<string, OneOrMany<string>>,
637
+ {},
638
+ RejectedMessage<[property: string, unit: string]>
639
+ >;
640
+ 'declaration-property-value-allowed-list': CoreRule<
641
+ Record<string, OneOrMany<StringOrRegex>>,
642
+ {},
643
+ RejectedMessage<[property: string, value: string]>
644
+ >;
645
+ 'declaration-property-value-disallowed-list': CoreRule<
646
+ Record<string, OneOrMany<StringOrRegex>>,
647
+ {},
648
+ RejectedMessage<[property: string, value: string]>
649
+ >;
650
+ 'declaration-property-value-keyword-no-deprecated': CoreRule<
651
+ true,
652
+ { ignoreKeywords: OneOrMany<StringOrRegex> },
653
+ AutofixMessage & { rejected: (property: string, keyword: string) => string }
654
+ >;
655
+ 'declaration-property-value-no-unknown': CoreRule<
656
+ true,
657
+ {
658
+ ignoreProperties: Record<string, OneOrMany<StringOrRegex>>;
659
+ propertiesSyntax: Record<string, string>;
660
+ typesSyntax: Record<string, string>;
661
+ },
662
+ RejectedMessage<[property: string, value: string]> & {
663
+ rejectedParseError: (property: string, value: string) => string;
664
+ rejectedMath: (property: string, expression: string) => string;
665
+ }
666
+ >;
667
+ 'font-family-name-quotes': CoreRule<
668
+ 'always-where-required' | 'always-where-recommended' | 'always-unless-keyword',
669
+ {},
670
+ ExpectedMessage<[name: string]> & RejectedMessage<[name: string]>
671
+ >;
672
+ 'font-family-no-duplicate-names': CoreRule<
673
+ true,
674
+ { ignoreFontFamilyNames: OneOrMany<StringOrRegex> },
675
+ RejectedMessage<[name: string]>
676
+ >;
677
+ 'font-family-no-missing-generic-family-keyword': CoreRule<
678
+ true,
679
+ { ignoreFontFamilies: OneOrMany<StringOrRegex> }
680
+ >;
681
+ 'font-weight-notation': CoreRule<
682
+ 'numeric' | 'named-where-possible',
683
+ { ignore: OneOrMany<'relative'> }
684
+ >;
685
+ 'function-allowed-list': CoreRule<
686
+ OneOrMany<StringOrRegex>,
687
+ { exceptWithoutPropertyFallback: OneOrMany<StringOrRegex> },
688
+ RejectedMessage<[name: string]>
689
+ >;
690
+ 'function-calc-no-unspaced-operator': CoreRule<
691
+ true,
692
+ {},
693
+ {
694
+ expectedAfter: (operator: string) => string;
695
+ expectedBefore: (operator: string) => string;
696
+ }
697
+ >;
698
+ 'function-disallowed-list': CoreRule<
699
+ OneOrMany<StringOrRegex>,
700
+ {},
701
+ RejectedMessage<[name: string]>
702
+ >;
703
+ 'function-linear-gradient-no-nonstandard-direction': CoreRule<true>;
704
+ 'function-name-case': CoreRule<
705
+ 'lower' | 'upper',
706
+ { ignoreFunctions: OneOrMany<StringOrRegex> },
707
+ AutofixMessage
708
+ >;
709
+ 'function-no-unknown': CoreRule<
710
+ true,
711
+ { ignoreFunctions: OneOrMany<StringOrRegex> },
712
+ RejectedMessage<[name: string]>
713
+ >;
714
+ 'function-url-no-scheme-relative': CoreRule<true>;
715
+ 'function-url-quotes': CoreRule<'always' | 'never', { except: OneOrMany<'empty'> }>;
716
+ 'function-url-scheme-allowed-list': CoreRule<
717
+ OneOrMany<StringOrRegex>,
718
+ {},
719
+ RejectedMessage<[scheme: string]>
720
+ >;
721
+ 'function-url-scheme-disallowed-list': CoreRule<
722
+ OneOrMany<StringOrRegex>,
723
+ {},
724
+ RejectedMessage<[scheme: string]>
725
+ >;
726
+ 'hue-degree-notation': CoreRule<'angle' | 'number', {}, AutofixMessage>;
727
+ 'import-notation': CoreRule<'string' | 'url', {}, AutofixMessage>;
728
+ 'keyframe-block-no-duplicate-selectors': CoreRule<
729
+ true,
730
+ {},
731
+ RejectedMessage<[selector: string]>
732
+ >;
733
+ 'keyframe-declaration-no-important': CoreRule<true>;
734
+ 'keyframe-selector-notation': CoreRule<
735
+ 'keyword' | 'percentage' | 'percentage-unless-within-keyword-only-block',
736
+ {},
737
+ AutofixMessage
738
+ >;
739
+ 'keyframes-name-pattern': PatternRule;
740
+ 'layer-name-pattern': PatternRule;
741
+ 'length-zero-no-unit': CoreRule<
742
+ true,
743
+ {
744
+ ignore: OneOrMany<'custom-properties'>;
745
+ ignoreFunctions: OneOrMany<StringOrRegex>;
746
+ ignorePreludeOfAtRules: OneOrMany<StringOrRegex>;
747
+ }
748
+ >;
749
+ 'lightness-notation': CoreRule<'percentage' | 'number', {}, AutofixMessage>;
750
+ 'max-nesting-depth': CoreRule<
751
+ number,
752
+ {
753
+ ignore: OneOrMany<'blockless-at-rules' | 'pseudo-classes'>;
754
+ ignoreAtRules: OneOrMany<StringOrRegex>;
755
+ ignoreRules: OneOrMany<StringOrRegex>;
756
+ ignorePseudoClasses: OneOrMany<StringOrRegex>;
757
+ },
758
+ ExpectedMessage<[depth: number]>
759
+ >;
760
+ 'media-feature-name-allowed-list': CoreRule<
761
+ OneOrMany<StringOrRegex>,
762
+ {},
763
+ RejectedMessage<[name: string]>
764
+ >;
765
+ 'media-feature-name-disallowed-list': CoreRule<
766
+ OneOrMany<StringOrRegex>,
767
+ {},
768
+ RejectedMessage<[name: string]>
769
+ >;
770
+ 'media-feature-name-no-unknown': CoreRule<
771
+ true,
772
+ { ignoreMediaFeatureNames: OneOrMany<StringOrRegex> },
773
+ RejectedMessage<[name: string]>
774
+ >;
775
+ 'media-feature-name-no-vendor-prefix': CoreRule<
776
+ true,
777
+ { ignoreMediaFeatureNames: OneOrMany<StringOrRegex> }
778
+ >;
779
+ 'media-feature-name-unit-allowed-list': CoreRule<
780
+ Record<string, OneOrMany<string>>,
781
+ {},
782
+ RejectedMessage<[unit: string, name: string]>
783
+ >;
784
+ 'media-feature-name-value-allowed-list': CoreRule<
785
+ Record<string, OneOrMany<StringOrRegex>>,
786
+ {},
787
+ RejectedMessage<[name: string, value: string]>
788
+ >;
789
+ 'media-feature-name-value-no-unknown': CoreRule<
790
+ true,
791
+ {
792
+ ignoreMediaFeatureNameValues: Record<string, OneOrMany<string | RegExp>>;
793
+ },
794
+ RejectedMessage<[name: string, value: string]>
795
+ >;
796
+ 'media-feature-range-notation': NotationRule<
797
+ 'prefix' | 'context',
798
+ { except: OneOrMany<'exact-value'> }
799
+ >;
800
+ 'media-query-no-invalid': CoreRule<
801
+ true,
802
+ { ignoreFunctions: OneOrMany<StringOrRegex> },
803
+ RejectedMessage<[query: string, reason: string]>
804
+ >;
805
+ 'media-type-no-deprecated': CoreRule<
806
+ true,
807
+ { ignoreMediaTypes: OneOrMany<StringOrRegex> },
808
+ RejectedMessage<[name: string]>
809
+ >;
810
+ 'named-grid-areas-no-invalid': CoreRule<true>;
811
+ 'nesting-selector-no-missing-scoping-root': CoreRule<
812
+ true,
813
+ { ignoreAtRules: OneOrMany<StringOrRegex> }
814
+ >;
815
+ 'no-descending-specificity': CoreRule<
816
+ true,
817
+ { ignore: OneOrMany<'selectors-within-list'> },
818
+ ExpectedMessage<
819
+ [selector: string, selector: string, line: number, selector: string, selector: string]
820
+ >
821
+ >;
822
+ 'no-duplicate-at-import-rules': CoreRule<true, {}, RejectedMessage<[url: string]>>;
823
+ 'no-duplicate-selectors': CoreRule<
824
+ true,
825
+ {
826
+ disallowInList: boolean;
827
+ ignoreSelectors: OneOrMany<StringOrRegex>;
828
+ },
829
+ RejectedMessage<[selector: string, line: number]>
830
+ >;
831
+ 'no-empty-source': CoreRule<true>;
832
+ 'no-invalid-double-slash-comments': CoreRule<true>;
833
+ 'no-invalid-position-at-import-rule': CoreRule<
834
+ true,
835
+ { ignoreAtRules: OneOrMany<StringOrRegex> }
836
+ >;
837
+ 'no-invalid-position-declaration': CoreRule<true, { ignoreAtRules: OneOrMany<StringOrRegex> }>;
838
+ 'no-irregular-whitespace': CoreRule<true>;
839
+ 'no-unknown-animations': CoreRule<true, {}, RejectedMessage<[name: string]>>;
840
+ 'no-unknown-custom-media': CoreRule<true, {}, RejectedMessage<[name: string]>>;
841
+ 'no-unknown-custom-properties': CoreRule<true, {}, RejectedMessage<[property: string]>>;
842
+ 'number-max-precision': CoreRule<
843
+ number,
844
+ {
845
+ ignoreProperties: OneOrMany<StringOrRegex>;
846
+ ignoreUnits: OneOrMany<StringOrRegex>;
847
+ insideFunctions: Record<string, number>;
848
+ },
849
+ AutofixMessage
850
+ >;
851
+ 'property-allowed-list': CoreRule<
852
+ OneOrMany<StringOrRegex>,
853
+ {},
854
+ RejectedMessage<[property: string]>
855
+ >;
856
+ 'property-disallowed-list': CoreRule<
857
+ OneOrMany<StringOrRegex>,
858
+ {},
859
+ RejectedMessage<[property: string]>
860
+ >;
861
+ 'property-no-deprecated': CoreRule<
862
+ true,
863
+ {
864
+ ignoreProperties: OneOrMany<StringOrRegex>;
865
+ },
866
+ AutofixMessage & RejectedMessage<[property: string]>
867
+ >;
868
+ 'property-no-unknown': CoreRule<
869
+ true,
870
+ {
871
+ checkPrefixed: boolean;
872
+ ignoreAtRules: OneOrMany<StringOrRegex>;
873
+ ignoreProperties: OneOrMany<StringOrRegex>;
874
+ ignoreSelectors: OneOrMany<StringOrRegex>;
875
+ },
876
+ RejectedMessage<[property: string]>
877
+ >;
878
+ 'property-no-vendor-prefix': CoreRule<
879
+ true,
880
+ { ignoreProperties: OneOrMany<StringOrRegex> },
881
+ RejectedMessage<[property: string]>
882
+ >;
883
+ 'rule-empty-line-before': CoreRule<
884
+ 'always' | 'never' | 'always-multi-line' | 'never-multi-line',
885
+ {
886
+ ignore: OneOrMany<'after-comment' | 'first-nested' | 'inside-block'>;
887
+ except: OneOrMany<
888
+ | 'after-rule'
889
+ | 'after-single-line-comment'
890
+ | 'first-nested'
891
+ | 'inside-block-and-after-rule'
892
+ | 'inside-block'
893
+ >;
894
+ }
895
+ >;
896
+ 'rule-selector-property-disallowed-list': CoreRule<
897
+ Record<string, OneOrMany<StringOrRegex>>,
898
+ {
899
+ ignore: OneOrMany<'keyframe-selectors'>;
900
+ },
901
+ RejectedMessage<[selector: string, property: string]>
902
+ >;
903
+ 'selector-anb-no-unmatchable': CoreRule<true, {}, RejectedMessage<[selector: string]>>;
904
+ 'selector-attribute-name-disallowed-list': CoreRule<
905
+ OneOrMany<StringOrRegex>,
906
+ {},
907
+ RejectedMessage<[name: string]>
908
+ >;
909
+ 'selector-attribute-operator-allowed-list': CoreRule<
910
+ OneOrMany<string>,
911
+ {},
912
+ RejectedMessage<[operator: string]>
913
+ >;
914
+ 'selector-attribute-operator-disallowed-list': CoreRule<
915
+ OneOrMany<string>,
916
+ {},
917
+ RejectedMessage<[operator: string]>
918
+ >;
919
+ 'selector-attribute-quotes': CoreRule<
920
+ 'always' | 'never',
921
+ {},
922
+ ExpectedMessage<[value: string]> & RejectedMessage<[value: string]>
923
+ >;
924
+ 'selector-class-pattern': PatternRule<{ resolveNestedSelectors: boolean }>;
925
+ 'selector-combinator-allowed-list': CoreRule<
926
+ OneOrMany<string>,
927
+ {},
928
+ RejectedMessage<[combinator: string]>
929
+ >;
930
+ 'selector-combinator-disallowed-list': CoreRule<
931
+ OneOrMany<string>,
932
+ {},
933
+ RejectedMessage<[combinator: string]>
934
+ >;
935
+ 'selector-disallowed-list': CoreRule<
936
+ OneOrMany<StringOrRegex>,
937
+ { splitList: boolean; ignore: OneOrMany<'inside-block' | 'keyframe-selectors'> },
938
+ RejectedMessage<[selector: string]>
939
+ >;
940
+ 'selector-id-pattern': PatternRule;
941
+ 'selector-max-attribute': MaxRule<{ ignoreAttributes: OneOrMany<StringOrRegex> }>;
942
+ 'selector-max-class': MaxRule;
943
+ 'selector-max-combinators': MaxRule;
944
+ 'selector-max-compound-selectors': MaxRule<{ ignoreSelectors: OneOrMany<StringOrRegex> }>;
945
+ 'selector-max-id': MaxRule<{
946
+ ignoreContextFunctionalPseudoClasses: OneOrMany<StringOrRegex>;
947
+ }>;
948
+ 'selector-max-pseudo-class': MaxRule;
949
+ 'selector-max-specificity': CoreRule<
950
+ string,
951
+ { ignoreSelectors: OneOrMany<StringOrRegex> },
952
+ ExpectedMessage<[selector: string, specificity: string, selector: string]>
953
+ >;
954
+ 'selector-max-type': MaxRule<{
955
+ ignore: OneOrMany<'descendant' | 'child' | 'compounded' | 'next-sibling' | 'custom-elements'>;
956
+ ignoreTypes: OneOrMany<StringOrRegex>;
957
+ }>;
958
+ 'selector-max-universal': MaxRule<{ ignoreAfterCombinators: OneOrMany<string> }>;
959
+ 'selector-nested-pattern': PatternRule<{ splitList: boolean }>;
960
+ 'selector-no-qualifying-type': CoreRule<
961
+ true,
962
+ { ignore: OneOrMany<'attribute' | 'class' | 'id'> },
963
+ RejectedMessage<[selector: string, type: string]>
964
+ >;
965
+ 'selector-no-vendor-prefix': CoreRule<
966
+ true,
967
+ { ignoreSelectors: OneOrMany<StringOrRegex> },
968
+ RejectedMessage<[selector: string]>
969
+ >;
970
+ 'selector-not-notation': NotationRule<'simple' | 'complex'>;
971
+ 'selector-pseudo-class-allowed-list': CoreRule<
972
+ OneOrMany<StringOrRegex>,
973
+ {},
974
+ RejectedMessage<[selector: string]>
975
+ >;
976
+ 'selector-pseudo-class-disallowed-list': CoreRule<
977
+ OneOrMany<StringOrRegex>,
978
+ {},
979
+ RejectedMessage<[selector: string]>
980
+ >;
981
+ 'selector-pseudo-class-no-unknown': CoreRule<
982
+ true,
983
+ { ignorePseudoClasses: OneOrMany<StringOrRegex> },
984
+ RejectedMessage<[selector: string]>
985
+ >;
986
+ 'selector-pseudo-element-allowed-list': CoreRule<
987
+ OneOrMany<StringOrRegex>,
988
+ {},
989
+ RejectedMessage<[selector: string]>
990
+ >;
991
+ 'selector-pseudo-element-colon-notation': NotationRule<'single' | 'double'>;
992
+ 'selector-pseudo-element-disallowed-list': CoreRule<
993
+ OneOrMany<StringOrRegex>,
994
+ {},
995
+ RejectedMessage<[selector: string]>
996
+ >;
997
+ 'selector-pseudo-element-no-unknown': CoreRule<
998
+ true,
999
+ { ignorePseudoElements: OneOrMany<StringOrRegex> },
1000
+ RejectedMessage<[selector: string]>
1001
+ >;
1002
+ 'selector-type-case': CoreRule<
1003
+ 'lower' | 'upper',
1004
+ { ignoreTypes: OneOrMany<StringOrRegex> },
1005
+ AutofixMessage
1006
+ >;
1007
+ 'selector-type-no-unknown': CoreRule<
1008
+ true,
1009
+ {
1010
+ ignore: OneOrMany<'custom-elements' | 'default-namespace'>;
1011
+ ignoreNamespaces: OneOrMany<StringOrRegex>;
1012
+ ignoreTypes: OneOrMany<StringOrRegex>;
1013
+ },
1014
+ RejectedMessage<[selector: string]>
1015
+ >;
1016
+ 'shorthand-property-no-redundant-values': CoreRule<
1017
+ true,
1018
+ {
1019
+ ignore: OneOrMany<'four-into-three-edge-values'>;
1020
+ },
1021
+ AutofixMessage
1022
+ >;
1023
+ 'string-no-newline': CoreRule<
1024
+ true,
1025
+ { ignore: OneOrMany<'at-rule-preludes' | 'declaration-values'> }
1026
+ >;
1027
+ 'syntax-string-no-invalid': CoreRule<true, {}, RejectedMessage<[component: string]>>;
1028
+ 'time-min-milliseconds': CoreRule<
1029
+ number,
1030
+ { ignore: OneOrMany<'delay'> },
1031
+ ExpectedMessage<[ms: number]>
1032
+ >;
1033
+ 'unit-allowed-list': CoreRule<
1034
+ OneOrMany<string>,
1035
+ {
1036
+ ignoreFunctions: OneOrMany<StringOrRegex>;
1037
+ ignoreProperties: Record<string, OneOrMany<StringOrRegex>>;
1038
+ },
1039
+ RejectedMessage<[unit: string]>
1040
+ >;
1041
+ 'unit-disallowed-list': CoreRule<
1042
+ OneOrMany<string>,
1043
+ {
1044
+ ignoreFunctions: OneOrMany<StringOrRegex>;
1045
+ ignoreProperties: Record<string, OneOrMany<StringOrRegex>>;
1046
+ ignoreMediaFeatureNames: Record<string, OneOrMany<StringOrRegex>>;
1047
+ },
1048
+ RejectedMessage<[unit: string]>
1049
+ >;
1050
+ 'unit-no-unknown': CoreRule<
1051
+ true,
1052
+ {
1053
+ ignoreUnits: OneOrMany<StringOrRegex>;
1054
+ ignoreFunctions: OneOrMany<StringOrRegex>;
1055
+ },
1056
+ RejectedMessage<[unit: string]>
1057
+ >;
1058
+ 'value-keyword-case': CoreRule<
1059
+ 'lower' | 'upper',
1060
+ {
1061
+ ignoreProperties: OneOrMany<StringOrRegex>;
1062
+ ignoreKeywords: OneOrMany<StringOrRegex>;
1063
+ ignoreFunctions: OneOrMany<StringOrRegex>;
1064
+ camelCaseSvgKeywords: boolean;
1065
+ },
1066
+ AutofixMessage
1067
+ >;
1068
+ 'value-no-vendor-prefix': CoreRule<
1069
+ true,
1070
+ { ignoreValues: OneOrMany<StringOrRegex> },
1071
+ RejectedMessage<[value: string]>
1072
+ >;
1073
+ };
1074
+
1075
+ /** @internal */
1076
+ export type GetPostcssOptions = {
1077
+ code?: string;
1078
+ codeFilename?: string;
1079
+ filePath?: string;
1080
+ customSyntax?: CustomSyntax;
1081
+ };
1082
+
1083
+ /** @internal */
1084
+ export type GetLintSourceOptions = GetPostcssOptions & {
1085
+ existingPostcssResult?: PostCSS.Result;
1086
+ cache?: boolean;
1087
+ };
1088
+
1089
+ /**
1090
+ * Linter options.
1091
+ */
1092
+ export type LinterOptions = {
1093
+ files?: OneOrMany<string>;
1094
+ globbyOptions?: GlobbyOptions;
1095
+ cache?: boolean;
1096
+ cacheLocation?: string;
1097
+ cacheStrategy?: string;
1098
+ code?: string;
1099
+ codeFilename?: string;
1100
+ config?: Config;
1101
+ configFile?: string;
1102
+ configBasedir?: string;
1103
+ /**
1104
+ * The working directory to resolve files from. Defaults to the
1105
+ * current working directory.
1106
+ */
1107
+ cwd?: string;
1108
+ ignoreDisables?: boolean;
1109
+ ignorePath?: OneOrMany<string>;
1110
+ ignorePattern?: string[];
1111
+ reportDescriptionlessDisables?: boolean;
1112
+ reportNeedlessDisables?: boolean;
1113
+ reportInvalidScopeDisables?: boolean;
1114
+ reportUnscopedDisables?: boolean;
1115
+ maxWarnings?: number;
1116
+ customSyntax?: CustomSyntax;
1117
+ /** @internal */
1118
+ _defaultFormatter?: FormatterType;
1119
+ formatter?: FormatterType | Formatter;
1120
+ disableDefaultIgnores?: boolean;
1121
+ fix?: boolean | FixMode;
1122
+ computeEditInfo?: boolean;
1123
+ allowEmptyInput?: boolean;
1124
+ quiet?: boolean;
1125
+ quietDeprecationWarnings?: boolean;
1126
+ validate?: boolean;
1127
+ /** @experimental */
1128
+ suppressAll?: boolean;
1129
+ /** @experimental */
1130
+ suppressLocation?: string;
1131
+ /** @experimental */
1132
+ suppressRule?: string[];
1133
+ };
1134
+
1135
+ /** @internal */
1136
+ export type FixMode = 'lax' | 'strict';
1137
+
1138
+ /**
1139
+ * @internal
1140
+ *
1141
+ * file path -> rule name -> { count: number }
1142
+ */
1143
+ export type SuppressedProblems = Map<string, Map<string, { count: number }>>;
1144
+
1145
+ /**
1146
+ * A CSS syntax error.
1147
+ */
1148
+ export type CssSyntaxError = {
1149
+ file?: string;
1150
+ input: {
1151
+ column: number;
1152
+ file?: string;
1153
+ line: number;
1154
+ source: string;
1155
+ };
1156
+ /**
1157
+ * The line of the inclusive start position of the error.
1158
+ */
1159
+ line: number;
1160
+ /**
1161
+ * The column of the inclusive start position of the error.
1162
+ */
1163
+ column: number;
1164
+ /**
1165
+ * The line of the exclusive end position of the error.
1166
+ */
1167
+ endLine?: number;
1168
+ /**
1169
+ * The column of the exclusive end position of the error.
1170
+ */
1171
+ endColumn?: number;
1172
+ message: string;
1173
+ name: string;
1174
+ reason: string;
1175
+ source: string;
1176
+ };
1177
+
1178
+ export type EditInfo = {
1179
+ /**
1180
+ * The pair of 0-based indices in source code text to remove.
1181
+ */
1182
+ range: [number, number];
1183
+ /**
1184
+ * The text to add.
1185
+ */
1186
+ text: string;
1187
+ };
1188
+
1189
+ /**
1190
+ * A lint warning.
1191
+ */
1192
+ export type Warning = {
1193
+ /**
1194
+ * The line of the inclusive start position of the warning.
1195
+ */
1196
+ line: number;
1197
+ /**
1198
+ * The column of the inclusive start position of the warning.
1199
+ */
1200
+ column: number;
1201
+ /**
1202
+ * The line of the exclusive end position of the warning.
1203
+ */
1204
+ endLine?: number;
1205
+ /**
1206
+ * The column of the exclusive end position of the warning.
1207
+ */
1208
+ endColumn?: number;
1209
+ /**
1210
+ * The `EditInfo` object of autofix. This property is undefined if this message is not fixable.
1211
+ */
1212
+ fix?: EditInfo;
1213
+ rule: string;
1214
+ severity: Severity;
1215
+ text: string;
1216
+ url?: string;
1217
+ stylelintType?: StylelintWarningType;
1218
+ };
1219
+
1220
+ /**
1221
+ * A lint result.
1222
+ */
1223
+ export type LintResult = {
1224
+ source?: string;
1225
+ deprecations: {
1226
+ text: string;
1227
+ reference?: string;
1228
+ }[];
1229
+ invalidOptionWarnings: {
1230
+ text: string;
1231
+ }[];
1232
+ parseErrors: (PostCSS.Warning & {
1233
+ stylelintType: Extract<StylelintWarningType, 'parseError'>;
1234
+ })[];
1235
+ errored?: boolean;
1236
+ warnings: Warning[];
1237
+ ignored?: boolean;
1238
+ /**
1239
+ * Internal use only. Do not use or rely on this property. It may
1240
+ * change at any time.
1241
+ * @internal
1242
+ */
1243
+ _postcssResult?: PostcssResult;
1244
+ };
1245
+
1246
+ /** @internal */
1247
+ export type DisableReportRange = {
1248
+ rule: string;
1249
+ start: number;
1250
+ end?: number;
1251
+ };
1252
+
1253
+ /**
1254
+ * A linter result.
1255
+ */
1256
+ export type LinterResult = {
1257
+ /**
1258
+ * The working directory from which the linter was run when the
1259
+ * results were generated.
1260
+ */
1261
+ cwd: string;
1262
+ results: LintResult[];
1263
+ errored: boolean;
1264
+ /**
1265
+ * A string that contains the formatted problems.
1266
+ */
1267
+ report: string;
1268
+ /**
1269
+ * A string that contains the autofixed code, if the `fix` option is set to `true`
1270
+ * and the `code` option is provided.
1271
+ */
1272
+ code?: string;
1273
+ maxWarningsExceeded?: {
1274
+ maxWarnings: number;
1275
+ foundWarnings: number;
1276
+ };
1277
+ reportedDisables: DisableOptionsReport;
1278
+ descriptionlessDisables?: DisableOptionsReport;
1279
+ needlessDisables?: DisableOptionsReport;
1280
+ invalidScopeDisables?: DisableOptionsReport;
1281
+ /**
1282
+ * Each rule metadata by name.
1283
+ */
1284
+ ruleMetadata: { [ruleName: string]: Partial<RuleMeta> };
1285
+ };
1286
+
1287
+ type Position = {
1288
+ line: number;
1289
+ column: number;
1290
+ };
1291
+
1292
+ export type ProblemLocation =
1293
+ | {
1294
+ /**
1295
+ * The inclusive start position of the problem, relative to the
1296
+ * node's source text. If provided, this will be used instead of
1297
+ * `index`.
1298
+ */
1299
+ start: Position;
1300
+ /**
1301
+ * The exclusive end position of the problem, relative to the
1302
+ * node's source text. If provided, this will be used instead of
1303
+ * `endIndex`.
1304
+ */
1305
+ end: Position;
1306
+ }
1307
+ | {
1308
+ /**
1309
+ * The inclusive start index of the problem, relative to the node's
1310
+ * source text.
1311
+ */
1312
+ index: number;
1313
+ /**
1314
+ * The exclusive end index of the problem, relative to the node's
1315
+ * source text.
1316
+ */
1317
+ endIndex: number;
1318
+ }
1319
+ | {
1320
+ word: string;
1321
+ }
1322
+ | object;
1323
+
1324
+ export type FixCallback = () => void | undefined | never;
1325
+
1326
+ export type FixObject = {
1327
+ apply?: FixCallback;
1328
+ node?: PostCSS.Node;
1329
+ };
1330
+
1331
+ /**
1332
+ * A lint problem.
1333
+ */
1334
+ export type Problem = {
1335
+ ruleName: string;
1336
+ result: PostcssResult;
1337
+ message: RuleMessage;
1338
+ messageArgs?: Parameters<RuleMessageFunc> | undefined;
1339
+ node: PostCSS.Node;
1340
+ /**
1341
+ * Optional severity override for the problem.
1342
+ */
1343
+ severity?: RuleSeverity;
1344
+ fix?: FixCallback | FixObject;
1345
+ } & ProblemLocation;
1346
+
1347
+ /** @internal */
1348
+ export type ShorthandProperties =
1349
+ | 'animation'
1350
+ | 'background'
1351
+ | 'border'
1352
+ | 'border-block'
1353
+ | 'border-block-end'
1354
+ | 'border-block-start'
1355
+ | 'border-inline'
1356
+ | 'border-inline-end'
1357
+ | 'border-inline-start'
1358
+ | 'border-bottom'
1359
+ | 'border-color'
1360
+ | 'border-image'
1361
+ | 'border-inline-end'
1362
+ | 'border-inline-start'
1363
+ | 'border-left'
1364
+ | 'border-radius'
1365
+ | 'border-right'
1366
+ | 'border-style'
1367
+ | 'border-top'
1368
+ | 'border-width'
1369
+ | 'column-rule'
1370
+ | 'columns'
1371
+ | 'flex'
1372
+ | 'flex-flow'
1373
+ | 'font'
1374
+ | 'font-synthesis'
1375
+ | 'font-variant'
1376
+ | 'gap'
1377
+ | 'grid'
1378
+ | 'grid-area'
1379
+ | 'grid-column'
1380
+ | 'grid-gap'
1381
+ | 'grid-row'
1382
+ | 'grid-template'
1383
+ | 'inset'
1384
+ | 'inset-block'
1385
+ | 'inset-inline'
1386
+ | 'list-style'
1387
+ | 'margin'
1388
+ | 'margin-block'
1389
+ | 'margin-inline'
1390
+ | 'mask'
1391
+ | 'outline'
1392
+ | 'overflow'
1393
+ | 'overscroll-behavior'
1394
+ | 'padding'
1395
+ | 'padding-block'
1396
+ | 'padding-inline'
1397
+ | 'place-content'
1398
+ | 'place-items'
1399
+ | 'place-self'
1400
+ | 'scroll-margin'
1401
+ | 'scroll-margin-block'
1402
+ | 'scroll-margin-inline'
1403
+ | 'scroll-padding'
1404
+ | 'scroll-padding-block'
1405
+ | 'scroll-padding-inline'
1406
+ | 'text-decoration'
1407
+ | 'text-emphasis'
1408
+ | 'transition';
1409
+
1410
+ /** @internal */
1411
+ export type LonghandSubPropertiesOfShorthandProperties = ReadonlyMap<
1412
+ ShorthandProperties,
1413
+ ReadonlySet<string>
1414
+ >;
1415
+
1416
+ /**
1417
+ * Utility functions.
1418
+ */
1419
+ export type Utils = {
1420
+ /**
1421
+ * Report a problem.
1422
+ *
1423
+ * This function accounts for `disabledRanges` attached to the result.
1424
+ * That is, if the reported problem is within a disabledRange,
1425
+ * it is ignored. Otherwise, it is attached to the result as a
1426
+ * postcss warning.
1427
+ *
1428
+ * It also accounts for the rule's severity.
1429
+ *
1430
+ * You *must* pass *either* a node or a line number.
1431
+ *
1432
+ * @param problem - A problem
1433
+ */
1434
+ report: (problem: Problem) => void;
1435
+
1436
+ /**
1437
+ * Given an object of problem messages, return another
1438
+ * that provides the same messages postfixed with the rule
1439
+ * that has been violated.
1440
+ *
1441
+ * @param ruleName - A rule name
1442
+ * @param messages - An object whose keys are message identifiers
1443
+ * and values are either message strings or functions that return message strings
1444
+ * @returns New message object, whose messages will be marked with the rule name
1445
+ */
1446
+ ruleMessages: <T extends RuleMessages, R extends { [K in keyof T]: T[K] }>(
1447
+ ruleName: string,
1448
+ messages: T,
1449
+ ) => R;
1450
+
1451
+ /**
1452
+ * Validate a rule's options.
1453
+ *
1454
+ * See existing rules for examples.
1455
+ *
1456
+ * @param result - PostCSS result
1457
+ * @param ruleName - A rule name
1458
+ * @param optionDescriptions - Each optionDescription can have the following properties:
1459
+ * - `actual` (required): the actual passed option value or object.
1460
+ * - `possible` (required): a schema representation of what values are
1461
+ * valid for those options. `possible` should be an object if the
1462
+ * options are an object, with corresponding keys; if the options are not an
1463
+ * object, `possible` isn't, either. All `possible` value representations
1464
+ * should be **arrays of either values or functions**. Values are === checked
1465
+ * against `actual`. Functions are fed `actual` as an argument and their
1466
+ * return value is interpreted: truthy = valid, falsy = invalid.
1467
+ * - `optional` (optional): If this is `true`, `actual` can be undefined.
1468
+ * @returns Whether or not the options are valid (`true` = valid)
1469
+ */
1470
+ validateOptions: (
1471
+ result: PostcssResult,
1472
+ ruleName: string,
1473
+ ...optionDescriptions: RuleOptions[]
1474
+ ) => boolean;
1475
+
1476
+ /**
1477
+ * Useful for third-party code (e.g. plugins) to run a PostCSS Root
1478
+ * against a specific rule and do something with the warnings.
1479
+ */
1480
+ checkAgainstRule: <T, O extends Object>(
1481
+ options: {
1482
+ ruleName: string;
1483
+ ruleSettings: ConfigRuleSettings<T, O>;
1484
+ root: PostCSS.Root;
1485
+ result?: PostcssResult;
1486
+ context?: RuleContext;
1487
+ },
1488
+ callback: (warning: PostCSS.Warning) => void,
1489
+ ) => Promise<void>;
1490
+ };
1491
+
1492
+ /**
1493
+ * Internal use only. Do not use or rely on this type. It may change at
1494
+ * any time.
1495
+ * @internal
1496
+ */
1497
+ export type InternalApi = {
1498
+ _options: LinterOptions & { cwd: string };
1499
+ _extendExplorer: ReturnType<typeof cosmiconfig>;
1500
+ _configExplorer: ReturnType<typeof cosmiconfig>;
1501
+ _specifiedConfigCache: Map<Config, Map<string, CosmiconfigResult>>;
1502
+ _augmentedConfigCache: Map<string, CosmiconfigResult>;
1503
+ _postcssResultCache: Map<string, PostCSS.Result>;
1504
+ _compiledOverridesCache: Map<string, CompiledOverride[]>;
1505
+ _fileCache: FileCache;
1506
+ };
1507
+
1508
+ /**
1509
+ * Pre-compiled override matcher for efficient reuse.
1510
+ * @internal
1511
+ */
1512
+ export type CompiledOverride = {
1513
+ configOverrides: Omit<ConfigOverride, 'files'>;
1514
+ matches: (filePath: string) => boolean;
1515
+ };
1516
+
1517
+ /** @internal */
1518
+ export type DisableOptionsReport = DisableReportEntry[];
1519
+
1520
+ /** @internal */
1521
+ export type PostcssPluginOptions = Omit<LinterOptions, 'customSyntax'> | Config;
1522
+
1523
+ /**
1524
+ * The Stylelint public API.
1525
+ */
1526
+ export type PublicApi = PostCSS.PluginCreator<PostcssPluginOptions> & {
1527
+ /**
1528
+ * Runs Stylelint with the given options and returns a Promise that
1529
+ * resolves to the results.
1530
+ *
1531
+ * @param options - A lint options object
1532
+ * @returns A lint result
1533
+ */
1534
+ lint: (options: LinterOptions) => Promise<LinterResult>;
1535
+
1536
+ /**
1537
+ * Available rules.
1538
+ */
1539
+ rules: { readonly [name in keyof CoreRules]: Promise<CoreRules[name]> };
1540
+
1541
+ /**
1542
+ * Result report formatters by name.
1543
+ */
1544
+ formatters: Formatters;
1545
+
1546
+ /**
1547
+ * Creates a Stylelint plugin.
1548
+ */
1549
+ createPlugin: (ruleName: string, rule: Rule) => Plugin;
1550
+
1551
+ /**
1552
+ * The Stylelint "internal API" is passed among functions
1553
+ * so that methods on a Stylelint instance can invoke
1554
+ * each other while sharing options and caches.
1555
+ *
1556
+ * @internal
1557
+ */
1558
+ _createLinter: (options: LinterOptions) => InternalApi;
1559
+
1560
+ /**
1561
+ * Resolves the effective configuration for a given file. Resolves to
1562
+ * `undefined` if no config is found.
1563
+ *
1564
+ * @param filePath - The path to the file to get the config for.
1565
+ * @param options - The options to use when creating the Stylelint instance.
1566
+ * @returns A resolved config or `undefined`.
1567
+ */
1568
+ resolveConfig: (
1569
+ filePath: string,
1570
+ options?: Pick<LinterOptions, 'cwd' | 'config' | 'configBasedir' | 'configFile'>,
1571
+ ) => Promise<Config | undefined>;
1572
+
1573
+ /**
1574
+ * Utility functions.
1575
+ */
1576
+ utils: Utils;
1577
+
1578
+ /**
1579
+ * Reference objects.
1580
+ */
1581
+ reference: {
1582
+ longhandSubPropertiesOfShorthandProperties: LonghandSubPropertiesOfShorthandProperties;
1583
+ };
1584
+ };
1585
+ }
1586
+
1587
+ declare const stylelint: stylelint.PublicApi & {
1588
+ /**
1589
+ * For CommonJS default import compatibility.
1590
+ */
1591
+ default: stylelint.PublicApi;
1592
+ };
1593
+
1594
+ export = stylelint;