linter-bundle 5.1.0 → 6.1.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 (195) hide show
  1. package/.linter-bundle.js +2 -0
  2. package/CHANGELOG.md +83 -9
  3. package/README.md +5 -3
  4. package/TODO.md +5 -0
  5. package/eslint/index.cjs +10 -4
  6. package/eslint/overrides-javascript.cjs +7 -1
  7. package/eslint/overrides-jest.cjs +1 -0
  8. package/eslint/overrides-jsdoc.cjs +1 -0
  9. package/eslint/rules/no-global-undefined-check.js +5 -3
  10. package/eslint/rules/no-unnecessary-typeof.js +26 -24
  11. package/eslint/rules/restricted-filenames.js +3 -1
  12. package/helper/ensure-type.cjs +2 -2
  13. package/helper/get-git-files.js +1 -1
  14. package/helper/get-outdated-dependencies.js +1 -1
  15. package/helper/get-outdated-overrides.js +1 -1
  16. package/helper/get-stylelint-path.js +1 -1
  17. package/helper/is-npm-or-yarn.js +1 -1
  18. package/helper/linter-bundle-config.js +22 -7
  19. package/helper/run-process.js +3 -3
  20. package/lint.js +31 -35
  21. package/package.json +27 -26
  22. package/stylelint/index.cjs +90 -5
  23. package/stylelint/plugins/stylelint-15.11.0-stylistic/LICENSE +20 -0
  24. package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/LICENSE +9 -0
  25. package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/index.cjs +122 -0
  26. package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/selectors.cjs +327 -0
  27. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/README.md +110 -0
  28. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/index.cjs +66 -0
  29. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/README.md +117 -0
  30. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/index.cjs +55 -0
  31. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/README.md +63 -0
  32. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/index.cjs +87 -0
  33. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/README.md +50 -0
  34. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/index.cjs +70 -0
  35. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/atRuleNameSpaceChecker.cjs +56 -0
  36. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/README.md +238 -0
  37. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/index.cjs +130 -0
  38. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/README.md +196 -0
  39. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/index.cjs +154 -0
  40. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/README.md +93 -0
  41. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/index.cjs +133 -0
  42. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/README.md +174 -0
  43. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/index.cjs +111 -0
  44. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/README.md +138 -0
  45. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/index.cjs +184 -0
  46. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/README.md +191 -0
  47. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/index.cjs +118 -0
  48. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/README.md +218 -0
  49. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/index.cjs +141 -0
  50. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/README.md +58 -0
  51. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/index.cjs +95 -0
  52. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/README.md +72 -0
  53. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +95 -0
  54. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/README.md +67 -0
  55. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/index.cjs +96 -0
  56. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/README.md +141 -0
  57. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/index.cjs +109 -0
  58. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/README.md +120 -0
  59. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/index.cjs +75 -0
  60. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/README.md +147 -0
  61. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/index.cjs +97 -0
  62. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/README.md +130 -0
  63. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/index.cjs +106 -0
  64. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/README.md +108 -0
  65. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/index.cjs +147 -0
  66. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/README.md +78 -0
  67. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/index.cjs +99 -0
  68. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/README.md +111 -0
  69. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/index.cjs +75 -0
  70. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/README.md +72 -0
  71. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/index.cjs +74 -0
  72. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declarationBangSpaceChecker.cjs +63 -0
  73. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declarationColonSpaceChecker.cjs +58 -0
  74. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/findMediaOperator.cjs +32 -0
  75. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/README.md +113 -0
  76. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/index.cjs +61 -0
  77. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/README.md +129 -0
  78. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/index.cjs +61 -0
  79. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/README.md +144 -0
  80. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/index.cjs +62 -0
  81. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/README.md +144 -0
  82. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/index.cjs +62 -0
  83. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/README.md +78 -0
  84. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/index.cjs +115 -0
  85. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/README.md +144 -0
  86. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/index.cjs +282 -0
  87. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/README.md +140 -0
  88. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/index.cjs +182 -0
  89. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/README.md +80 -0
  90. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/index.cjs +198 -0
  91. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/functionCommaSpaceChecker.cjs +125 -0
  92. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/functionCommaSpaceFix.cjs +51 -0
  93. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/README.md +339 -0
  94. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/index.cjs +743 -0
  95. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/README.md +21 -0
  96. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/index.cjs +132 -0
  97. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/README.md +116 -0
  98. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/index.cjs +225 -0
  99. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/README.md +151 -0
  100. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/index.cjs +200 -0
  101. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/README.md +72 -0
  102. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/index.cjs +91 -0
  103. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/README.md +72 -0
  104. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/index.cjs +91 -0
  105. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/README.md +108 -0
  106. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/index.cjs +93 -0
  107. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/README.md +62 -0
  108. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/index.cjs +112 -0
  109. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/README.md +72 -0
  110. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/index.cjs +109 -0
  111. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/README.md +72 -0
  112. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/index.cjs +109 -0
  113. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/README.md +113 -0
  114. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/index.cjs +97 -0
  115. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/README.md +111 -0
  116. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/index.cjs +49 -0
  117. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/README.md +136 -0
  118. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/index.cjs +93 -0
  119. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/README.md +136 -0
  120. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/index.cjs +93 -0
  121. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaFeatureColonSpaceChecker.cjs +54 -0
  122. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaQueryListCommaWhitespaceChecker.cjs +73 -0
  123. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/README.md +34 -0
  124. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/index.cjs +63 -0
  125. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/README.md +79 -0
  126. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/index.cjs +302 -0
  127. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/README.md +78 -0
  128. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/index.cjs +246 -0
  129. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/README.md +34 -0
  130. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/index.cjs +62 -0
  131. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/README.md +74 -0
  132. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/index.cjs +197 -0
  133. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/README.md +40 -0
  134. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/index.cjs +139 -0
  135. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/README.md +192 -0
  136. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/index.cjs +95 -0
  137. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/README.md +112 -0
  138. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/index.cjs +214 -0
  139. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/README.md +162 -0
  140. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/index.cjs +109 -0
  141. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/README.md +162 -0
  142. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/index.cjs +88 -0
  143. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/README.md +78 -0
  144. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/index.cjs +67 -0
  145. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/README.md +78 -0
  146. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/index.cjs +67 -0
  147. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/README.md +40 -0
  148. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/index.cjs +95 -0
  149. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/README.md +120 -0
  150. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/index.cjs +126 -0
  151. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/README.md +112 -0
  152. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/index.cjs +101 -0
  153. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/README.md +110 -0
  154. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/index.cjs +92 -0
  155. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/README.md +110 -0
  156. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/index.cjs +92 -0
  157. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/README.md +103 -0
  158. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/index.cjs +74 -0
  159. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/README.md +108 -0
  160. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/index.cjs +104 -0
  161. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/README.md +62 -0
  162. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/index.cjs +162 -0
  163. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/README.md +128 -0
  164. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/index.cjs +90 -0
  165. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorAttributeOperatorSpaceChecker.cjs +95 -0
  166. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorCombinatorSpaceChecker.cjs +113 -0
  167. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorListCommaWhitespaceChecker.cjs +64 -0
  168. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/README.md +130 -0
  169. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/index.cjs +256 -0
  170. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/README.md +41 -0
  171. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/index.cjs +67 -0
  172. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/README.md +126 -0
  173. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/index.cjs +133 -0
  174. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/README.md +102 -0
  175. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/index.cjs +107 -0
  176. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/README.md +100 -0
  177. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/index.cjs +49 -0
  178. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/README.md +136 -0
  179. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/index.cjs +94 -0
  180. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/README.md +136 -0
  181. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/index.cjs +94 -0
  182. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/README.md +121 -0
  183. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/index.cjs +68 -0
  184. package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/valueListCommaWhitespaceChecker.cjs +74 -0
  185. package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/LICENSE +13 -0
  186. package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/index.cjs +216 -0
  187. package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/addEmptyLineAfter.cjs +30 -0
  188. package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/hasEmptyBlock.cjs +14 -0
  189. package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/nextNonCommentNode.cjs +21 -0
  190. package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/removeEmptyLinesAfter.cjs +16 -0
  191. package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/whitespaceChecker.cjs +361 -0
  192. package/stylelint/plugins/stylelint-selector-no-empty.js +8 -8
  193. package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +4 -4
  194. package/stylelint/plugins/stylelint-high-performance-animation.js +0 -276
  195. package/stylelint/plugins/stylelint-stylistic.js +0 -188
@@ -0,0 +1,136 @@
1
+ # media-query-list-comma-space-before
2
+
3
+ Require a single space or disallow whitespace before the commas of media query lists.
4
+
5
+ <!-- prettier-ignore -->
6
+ ```css
7
+ @media screen and (color) ,projection and (color) {}
8
+ /** ↑
9
+ * The space before this comma */
10
+ ```
11
+
12
+ The [`fix` option](https://stylelint.io/user-guide/options/#fix) can automatically fix all of the problems reported by this rule.
13
+
14
+ ## Options
15
+
16
+ `string`: `"always"|"never"|"always-single-line"|"never-single-line"`
17
+
18
+ ### `"always"`
19
+
20
+ There _must always_ be a single space before the commas.
21
+
22
+ The following patterns are considered problems:
23
+
24
+ <!-- prettier-ignore -->
25
+ ```css
26
+ @media screen and (color),projection and (color) {}
27
+ ```
28
+
29
+ <!-- prettier-ignore -->
30
+ ```css
31
+ @media screen and (color)
32
+ ,projection and (color) {}
33
+ ```
34
+
35
+ The following patterns are _not_ considered problems:
36
+
37
+ <!-- prettier-ignore -->
38
+ ```css
39
+ @media screen and (color) ,projection and (color) {}
40
+ ```
41
+
42
+ <!-- prettier-ignore -->
43
+ ```css
44
+ @media screen and (color) ,
45
+ projection and (color) {}
46
+ ```
47
+
48
+ ### `"never"`
49
+
50
+ There _must never_ be whitespace before the commas.
51
+
52
+ The following patterns are considered problems:
53
+
54
+ <!-- prettier-ignore -->
55
+ ```css
56
+ @media screen and (color) ,projection and (color) {}
57
+ ```
58
+
59
+ <!-- prettier-ignore -->
60
+ ```css
61
+ @media screen and (color)
62
+ , projection and (color) {}
63
+ ```
64
+
65
+ The following patterns are _not_ considered problems:
66
+
67
+ <!-- prettier-ignore -->
68
+ ```css
69
+ @media screen and (color),projection and (color) {}
70
+ ```
71
+
72
+ <!-- prettier-ignore -->
73
+ ```css
74
+ @media screen and (color),
75
+ projection and (color) {}
76
+ ```
77
+
78
+ ### `"always-single-line"`
79
+
80
+ There _must always_ be a single space before the commas in single-line media query lists.
81
+
82
+ The following patterns are considered problems:
83
+
84
+ <!-- prettier-ignore -->
85
+ ```css
86
+ @media screen and (color),projection and (color) {}
87
+ ```
88
+
89
+ The following patterns are _not_ considered problems:
90
+
91
+ <!-- prettier-ignore -->
92
+ ```css
93
+ @media screen and (color) ,projection and (color) {}
94
+ ```
95
+
96
+ <!-- prettier-ignore -->
97
+ ```css
98
+ @media screen and (color)
99
+ , projection and (color) {}
100
+ ```
101
+
102
+ <!-- prettier-ignore -->
103
+ ```css
104
+ @media screen and (color)
105
+ ,projection and (color) {}
106
+ ```
107
+
108
+ ### `"never-single-line"`
109
+
110
+ There _must never_ be whitespace before the commas in single-line media query lists.
111
+
112
+ The following patterns are considered problems:
113
+
114
+ <!-- prettier-ignore -->
115
+ ```css
116
+ @media screen and (color) , projection and (color) {}
117
+ ```
118
+
119
+ The following patterns are _not_ considered problems:
120
+
121
+ <!-- prettier-ignore -->
122
+ ```css
123
+ @media screen and (color),projection and (color) {}
124
+ ```
125
+
126
+ <!-- prettier-ignore -->
127
+ ```css
128
+ @media screen and (color)
129
+ ,projection and (color) {}
130
+ ```
131
+
132
+ <!-- prettier-ignore -->
133
+ ```css
134
+ @media screen and (color)
135
+ , projection and (color) {}
136
+ ```
@@ -0,0 +1,93 @@
1
+ /* eslint-disable -- We want to keep as much of the original code as possible */
2
+ // @ts-nocheck
3
+
4
+ const stylelint = require('stylelint');
5
+ const atRuleParamIndex = require('stylelint/lib/utils/atRuleParamIndex.cjs');
6
+ const ruleMessages = require('stylelint/lib/utils/ruleMessages.cjs');
7
+ const validateOptions = require('stylelint/lib/utils/validateOptions.cjs');
8
+
9
+ const whitespaceChecker = require('../../utils/whitespaceChecker.cjs');
10
+ const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker.cjs');
11
+
12
+ const ruleName = 'plugin/media-query-list-comma-space-before';
13
+
14
+ const messages = ruleMessages(ruleName, {
15
+ expectedBefore: () => 'Expected single space before ","',
16
+ rejectedBefore: () => 'Unexpected whitespace before ","',
17
+ expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line list',
18
+ rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list'
19
+ });
20
+
21
+ const meta = {
22
+ url: 'https://github.com/jens-duttke/linter-bundle/blob/main/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/README.md',
23
+ fixable: true
24
+ };
25
+
26
+ /** @type {import('stylelint').Rule} */
27
+ const rule = (primary, _secondaryOptions, context) => {
28
+ const checker = whitespaceChecker('space', primary, messages);
29
+
30
+ return (root, result) => {
31
+ const validOptions = validateOptions(result, ruleName, {
32
+ actual: primary,
33
+ possible: ['always', 'never', 'always-single-line', 'never-single-line']
34
+ });
35
+
36
+ if (!validOptions) {
37
+ return;
38
+ }
39
+
40
+ /** @type {Map<import('postcss').AtRule, number[]> | undefined} */
41
+ let fixData;
42
+
43
+ mediaQueryListCommaWhitespaceChecker({
44
+ root,
45
+ result,
46
+ locationChecker: checker.before,
47
+ checkedRuleName: ruleName,
48
+ fix: context.fix ?
49
+ (atRule, index) => {
50
+ const parameterCommaIndex = index - atRuleParamIndex(atRule);
51
+
52
+ fixData ||= new Map();
53
+ const commaIndices = fixData.get(atRule) || [];
54
+
55
+ commaIndices.push(parameterCommaIndex);
56
+ fixData.set(atRule, commaIndices);
57
+
58
+ return true;
59
+ }
60
+ : null
61
+ });
62
+
63
+ if (fixData) {
64
+ for (const [atRule, commaIndices] of fixData.entries()) {
65
+ let parameters = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
66
+
67
+ for (const index of commaIndices.sort((a, b) => b - a)) {
68
+ const beforeComma = parameters.slice(0, index);
69
+ const afterComma = parameters.slice(index);
70
+
71
+ if (primary.startsWith('always')) {
72
+ parameters = beforeComma.replace(/\s*$/, ' ') + afterComma;
73
+ }
74
+ else if (primary.startsWith('never')) {
75
+ parameters = beforeComma.replace(/\s*$/, '') + afterComma;
76
+ }
77
+ }
78
+
79
+ if (atRule.raws.params) {
80
+ atRule.raws.params.raw = parameters;
81
+ }
82
+ else {
83
+ atRule.params = parameters;
84
+ }
85
+ }
86
+ }
87
+ };
88
+ };
89
+
90
+ rule.ruleName = ruleName;
91
+ rule.messages = messages;
92
+ rule.meta = meta;
93
+ module.exports = stylelint.createPlugin(ruleName, rule);
@@ -0,0 +1,54 @@
1
+ /* eslint-disable -- We want to keep as much of the original code as possible */
2
+ // @ts-nocheck
3
+
4
+ const atRuleParamIndex = require('stylelint/lib/utils/atRuleParamIndex.cjs');
5
+ const report = require('stylelint/lib/utils/report.cjs');
6
+
7
+ const styleSearch = require('../style-search/index.cjs');
8
+
9
+ /**
10
+ * @param {{
11
+ * root: import('postcss').Root,
12
+ * locationChecker: (args: { source: string, index: number, err: (message: string) => void }) => void,
13
+ * fix: ((node: import('postcss').AtRule, index: number) => boolean) | null,
14
+ * result: import('stylelint').PostcssResult,
15
+ * checkedRuleName: string,
16
+ * }} opts
17
+ * @param options
18
+ */
19
+ module.exports = function mediaFeatureColonSpaceChecker (options) {
20
+ options.root.walkAtRules(/^media$/i, (atRule) => {
21
+ const parameters = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
22
+
23
+ styleSearch({ source: parameters, target: ':' }, (match) => {
24
+ checkColon(parameters, match.startIndex, atRule);
25
+ });
26
+ });
27
+
28
+ /**
29
+ * @param {string} source
30
+ * @param {number} index
31
+ * @param {import('postcss').AtRule} node
32
+ */
33
+ function checkColon (source, index, node) {
34
+ options.locationChecker({
35
+ source,
36
+ index,
37
+ err: (message) => {
38
+ const colonIndex = index + atRuleParamIndex(node);
39
+
40
+ if (options.fix?.(node, colonIndex)) {
41
+ return;
42
+ }
43
+
44
+ report({
45
+ message,
46
+ node,
47
+ index: colonIndex,
48
+ result: options.result,
49
+ ruleName: options.checkedRuleName
50
+ });
51
+ }
52
+ });
53
+ }
54
+ };
@@ -0,0 +1,73 @@
1
+ /* eslint-disable -- We want to keep as much of the original code as possible */
2
+ // @ts-nocheck
3
+
4
+ const atRuleParamIndex = require('stylelint/lib/utils/atRuleParamIndex.cjs');
5
+ const report = require('stylelint/lib/utils/report.cjs');
6
+ const { assertString } = require('stylelint/lib/utils/validateTypes.cjs');
7
+
8
+ const styleSearch = require('../style-search/index.cjs');
9
+
10
+ /**
11
+ * @param {{
12
+ * root: import('postcss').Root,
13
+ * result: import('stylelint').PostcssResult,
14
+ * locationChecker: (args: { source: string, index: number, err: (message: string) => void }) => void,
15
+ * checkedRuleName: string,
16
+ * fix?: ((atRule: import('postcss').AtRule, index: number) => boolean) | null | undefined,
17
+ * allowTrailingComments?: boolean,
18
+ * }} opts
19
+ * @param options
20
+ */
21
+ module.exports = function mediaQueryListCommaWhitespaceChecker (options) {
22
+ options.root.walkAtRules(/^media$/i, (atRule) => {
23
+ const parameters = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
24
+
25
+ styleSearch({ source: parameters, target: ',' }, (match) => {
26
+ let index = match.startIndex;
27
+
28
+ if (options.allowTrailingComments) {
29
+ // if there is a comment on the same line at after the comma, check the space after the comment.
30
+ let execResult;
31
+
32
+ while ((execResult = (/^[^\S\n\r]*\/\*([\S\s]*?)\*\//).exec(parameters.slice(index + 1)))) {
33
+ assertString(execResult[0]);
34
+ index += execResult[0].length;
35
+ }
36
+
37
+ if ((execResult = (/^([^\S\n\r]*\/\/[\S\s]*?)\r?\n/).exec(parameters.slice(index + 1)))) {
38
+ assertString(execResult[1]);
39
+ index += execResult[1].length;
40
+ }
41
+ }
42
+
43
+ checkComma(parameters, index, atRule);
44
+ });
45
+ });
46
+
47
+ /**
48
+ * @param {string} source
49
+ * @param {number} index
50
+ * @param {import('postcss').AtRule} node
51
+ */
52
+ function checkComma (source, index, node) {
53
+ options.locationChecker({
54
+ source,
55
+ index,
56
+ err: (message) => {
57
+ const commaIndex = index + atRuleParamIndex(node);
58
+
59
+ if (options.fix?.(node, commaIndex)) {
60
+ return;
61
+ }
62
+
63
+ report({
64
+ message,
65
+ node,
66
+ index: commaIndex,
67
+ result: options.result,
68
+ ruleName: options.checkedRuleName
69
+ });
70
+ }
71
+ });
72
+ }
73
+ };
@@ -0,0 +1,34 @@
1
+ # no-empty-first-line
2
+
3
+ Disallow empty first lines.
4
+
5
+ <!-- prettier-ignore -->
6
+ ```css
7
+ \n
8
+ /** ↑
9
+ * This newline */
10
+ a { color: pink; }
11
+ ```
12
+
13
+ This rule ignores empty sources. Use the [`no-empty-source`](../no-empty-source/README.md) rule to disallow these.
14
+
15
+ The [`fix` option](https://stylelint.io/user-guide/options/#fix) can automatically fix all of the problems reported by this rule.
16
+
17
+ ## Options
18
+
19
+ ### `true`
20
+
21
+ The following patterns are considered problems:
22
+
23
+ <!-- prettier-ignore -->
24
+ ```css
25
+ \n
26
+ a { color: pink; }
27
+ ```
28
+
29
+ The following patterns are _not_ considered problems:
30
+
31
+ <!-- prettier-ignore -->
32
+ ```css
33
+ a { color: pink; }
34
+ ```
@@ -0,0 +1,63 @@
1
+ /* eslint-disable -- We want to keep as much of the original code as possible */
2
+ // @ts-nocheck
3
+
4
+ const stylelint = require('stylelint');
5
+ const report = require('stylelint/lib/utils/report.cjs');
6
+ const ruleMessages = require('stylelint/lib/utils/ruleMessages.cjs');
7
+ const validateOptions = require('stylelint/lib/utils/validateOptions.cjs');
8
+
9
+ const ruleName = 'plugin/no-empty-first-line';
10
+ const noEmptyFirstLineTest = /^\s*[\n\r]/;
11
+
12
+ const messages = ruleMessages(ruleName, {
13
+ rejected: 'Unexpected empty line'
14
+ });
15
+
16
+ const meta = {
17
+ url: 'https://github.com/jens-duttke/linter-bundle/blob/main/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/README.md',
18
+ fixable: true
19
+ };
20
+
21
+ /** @type {import('stylelint').Rule} */
22
+ const rule = (primary, _secondaryOptions, context) => (root, result) => {
23
+ const validOptions = validateOptions(result, ruleName, { actual: primary });
24
+
25
+ // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. Property 'lang' does not exist on type 'Source'.
26
+ if (!validOptions || root.source.inline || root.source.lang === 'object-literal') {
27
+ return;
28
+ }
29
+
30
+ const rootString = context.fix ? root.toString() : (root.source?.input.css) || '';
31
+
32
+ if (!rootString.trim()) {
33
+ return;
34
+ }
35
+
36
+ if (noEmptyFirstLineTest.test(rootString)) {
37
+ if (context.fix) {
38
+ if (root.first == null) {
39
+ throw new Error('The root node must have the first node.');
40
+ }
41
+
42
+ if (root.first.raws.before == null) {
43
+ throw new Error('The first node must have spaces before.');
44
+ }
45
+
46
+ root.first.raws.before = root.first.raws.before.trimStart();
47
+
48
+ return;
49
+ }
50
+
51
+ report({
52
+ message: messages.rejected,
53
+ node: root,
54
+ result,
55
+ ruleName
56
+ });
57
+ }
58
+ };
59
+
60
+ rule.ruleName = ruleName;
61
+ rule.messages = messages;
62
+ rule.meta = meta;
63
+ module.exports = stylelint.createPlugin(ruleName, rule);
@@ -0,0 +1,79 @@
1
+ # no-eol-whitespace
2
+
3
+ Disallow end-of-line whitespace.
4
+
5
+ <!-- prettier-ignore -->
6
+ ```css
7
+ a { color: pink; }···
8
+ /** ↑
9
+ * This whitespace */
10
+ ```
11
+
12
+ The [`fix` option](https://stylelint.io/user-guide/options/#fix) can automatically fix most of the problems reported by this rule.
13
+
14
+ ## Options
15
+
16
+ ### `true`
17
+
18
+ The following patterns are considered problems:
19
+
20
+ <!-- prettier-ignore -->
21
+ ```css
22
+ a { color: pink; }·
23
+ ```
24
+
25
+ <!-- prettier-ignore -->
26
+ ```css
27
+ a { color: pink; }····
28
+ ```
29
+
30
+ Comment strings are also checked -- so the following is a problem:
31
+
32
+ <!-- prettier-ignore -->
33
+ ```css
34
+ /* something····
35
+ * something else */
36
+ ```
37
+
38
+ The following patterns are _not_ considered problems:
39
+
40
+ <!-- prettier-ignore -->
41
+ ```css
42
+ a { color: pink; }
43
+ ```
44
+
45
+ <!-- prettier-ignore -->
46
+ ```css
47
+ /* something
48
+ * something else */
49
+ ```
50
+
51
+ ## Optional secondary options
52
+
53
+ ### `ignore: ["empty-lines"]`
54
+
55
+ #### `"empty-lines"`
56
+
57
+ Allow end-of-line whitespace for lines that are only whitespace, "empty" lines.
58
+
59
+ The following patterns are _not_ considered problems:
60
+
61
+ <!-- prettier-ignore -->
62
+ ```css
63
+ a {
64
+ color: pink;
65
+ ··
66
+ background: orange;
67
+ }
68
+ ```
69
+
70
+ <!-- prettier-ignore -->
71
+ ```css
72
+ ····
73
+ ```
74
+
75
+ <!-- prettier-ignore -->
76
+ ```css
77
+ a { color: pink; }
78
+ ····
79
+ ```