ratchapong

Reorganize stylint

Mar 15th, 2022
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.04 KB | None | 0 0
  1. const ss = `
  2. # List of rules
  3.  
  4. The built-in rules help you:
  5.  
  6. - [avoid errors](#avoid-errors)
  7. - [enforce conventions](#enforce-conventions)
  8.  
  9. There are also frozen rules that let you address [stylistic issues](#stylistic-issues).
  10.  
  11. Within each cateogory, the rules are grouped by the [_thing_](http://apps.workflower.fi/vocabs/css/en) they apply to.
  12.  
  13. ## Avoid errors
  14.  
  15. ### Color
  16.  
  17. - [\`color-no-invalid-hex\`](../../../lib/rules/color-no-invalid-hex/README.md): Disallow invalid hex colors.
  18.  
  19. ### Font family
  20.  
  21. - [\`font-family-no-duplicate-names\`](../../../lib/rules/font-family-no-duplicate-names/README.md): Disallow duplicate font family names.
  22. - [\`font-family-no-missing-generic-family-keyword\`](../../../lib/rules/font-family-no-missing-generic-family-keyword/README.md): Disallow missing generic families in lists of font family names.
  23.  
  24. ### Named grid areas
  25.  
  26. - [\`named-grid-areas-no-invalid\`](../../../lib/rules/named-grid-areas-no-invalid/README.md): Disallow invalid named grid areas.
  27.  
  28. ### Function
  29.  
  30. - [\`function-calc-no-unspaced-operator\`](../../../lib/rules/function-calc-no-unspaced-operator/README.md): Disallow an unspaced operator within \`calc\` functions.
  31. - [\`function-linear-gradient-no-nonstandard-direction\`](../../../lib/rules/function-linear-gradient-no-nonstandard-direction/README.md): Disallow direction values in \`linear-gradient()\` calls that are not valid according to the [standard syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient#Syntax).
  32. - [\`function-no-unknown\`](../../../lib/rules/function-no-unknown/README.md): Disallow unknown functions.
  33.  
  34. ### String
  35.  
  36. - [\`string-no-newline\`](../../../lib/rules/string-no-newline/README.md): Disallow (unescaped) newlines in strings.
  37.  
  38. ### Unit
  39.  
  40. - [\`unit-no-unknown\`](../../../lib/rules/unit-no-unknown/README.md): Disallow unknown units.
  41.  
  42. ### Custom property
  43.  
  44. - [\`custom-property-no-missing-var-function\`](../../../lib/rules/custom-property-no-missing-var-function/README.md): Disallow missing \`var\` function for custom properties.
  45.  
  46. ### Property
  47.  
  48. - [\`property-no-unknown\`](../../../lib/rules/property-no-unknown/README.md): Disallow unknown properties.
  49.  
  50. ### Keyframe declaration
  51.  
  52. - [\`keyframe-declaration-no-important\`](../../../lib/rules/keyframe-declaration-no-important/README.md): Disallow \`!important\` within keyframe declarations.
  53.  
  54. ### Declaration block
  55.  
  56. - [\`declaration-block-no-duplicate-custom-properties\`](../../../lib/rules/declaration-block-no-duplicate-custom-properties/README.md): Disallow duplicate custom properties within declaration blocks.
  57. - [\`declaration-block-no-duplicate-properties\`](../../../lib/rules/declaration-block-no-duplicate-properties/README.md): Disallow duplicate properties within declaration blocks.
  58. - [\`declaration-block-no-shorthand-property-overrides\`](../../../lib/rules/declaration-block-no-shorthand-property-overrides/README.md): Disallow shorthand properties that override related longhand properties.
  59.  
  60. ### Block
  61.  
  62. - [\`block-no-empty\`](../../../lib/rules/block-no-empty/README.md): Disallow empty blocks.
  63.  
  64. ### Selector
  65.  
  66. - [\`selector-pseudo-class-no-unknown\`](../../../lib/rules/selector-pseudo-class-no-unknown/README.md): Disallow unknown pseudo-class selectors.
  67. - [\`selector-pseudo-element-no-unknown\`](../../../lib/rules/selector-pseudo-element-no-unknown/README.md): Disallow unknown pseudo-element selectors.
  68. - [\`selector-type-no-unknown\`](../../../lib/rules/selector-type-no-unknown/README.md): Disallow unknown type selectors.
  69.  
  70. ### Media feature
  71.  
  72. - [\`media-feature-name-no-unknown\`](../../../lib/rules/media-feature-name-no-unknown/README.md): Disallow unknown media feature names.
  73.  
  74. ### At-rule
  75.  
  76. - [\`at-rule-no-unknown\`](../../../lib/rules/at-rule-no-unknown/README.md): Disallow unknown at-rules.
  77.  
  78. ### Comment
  79.  
  80. - [\`comment-no-empty\`](../../../lib/rules/comment-no-empty/README.md): Disallow empty comments.
  81.  
  82. ### General / Sheet
  83.  
  84. - [\`no-descending-specificity\`](../../../lib/rules/no-descending-specificity/README.md): Disallow selectors of lower specificity from coming after overriding selectors of higher specificity.
  85. - [\`no-duplicate-at-import-rules\`](../../../lib/rules/no-duplicate-at-import-rules/README.md): Disallow duplicate \`@import\` rules within a stylesheet.
  86. - [\`no-duplicate-selectors\`](../../../lib/rules/no-duplicate-selectors/README.md): Disallow duplicate selectors within a stylesheet.
  87. - [\`no-empty-source\`](../../../lib/rules/no-empty-source/README.md): Disallow empty sources.
  88. - [\`no-invalid-double-slash-comments\`](../../../lib/rules/no-invalid-double-slash-comments/README.md): Disallow double-slash comments (\`//...\`) which are not supported by CSS.
  89. - [\`no-invalid-position-at-import-rule\`](../../../lib/rules/no-invalid-position-at-import-rule/README.md): Disallow invalid position \`@import\` rules within a stylesheet.
  90.  
  91. ## Enforce conventions
  92.  
  93. ### Alpha-value
  94.  
  95. - [\`alpha-value-notation\`](../../../lib/rules/alpha-value-notation/README.md): Specify percentage or number notation for alpha-values (Autofixable).
  96.  
  97. ### Hue
  98.  
  99. - [\`hue-degree-notation\`](../../../lib/rules/hue-degree-notation/README.md): Specify number or angle notation for degree hues (Autofixable).
  100.  
  101. ### Color
  102.  
  103. - [\`color-function-notation\`](../../../lib/rules/color-function-notation/README.md): Specify modern or legacy notation for applicable color-functions (Autofixable).
  104. - [\`color-hex-alpha\`](../../../lib/rules/color-hex-alpha/README.md): Require or disallow alpha channel for hex colors.
  105. - [\`color-hex-length\`](../../../lib/rules/color-hex-length/README.md): Specify short or long notation for hex colors (Autofixable).
  106. - [\`color-named\`](../../../lib/rules/color-named/README.md): Require (where possible) or disallow named colors.
  107. - [\`color-no-hex\`](../../../lib/rules/color-no-hex/README.md): Disallow hex colors.
  108.  
  109. ### Length
  110.  
  111. - [\`length-zero-no-unit\`](../../../lib/rules/length-zero-no-unit/README.md): Disallow units for zero lengths (Autofixable).
  112.  
  113. ### Font family
  114.  
  115. - [\`font-family-name-quotes\`](../../../lib/rules/font-family-name-quotes/README.md): Specify whether or not quotation marks should be used around font family names (Autofixable).
  116.  
  117. ### Font weight
  118.  
  119. - [\`font-weight-notation\`](../../../lib/rules/font-weight-notation/README.md): Require numeric or named (where possible) \`font-weight\` values. Also, when named values are expected, require only valid names.
  120.  
  121. ### Function
  122.  
  123. - [\`function-allowed-list\`](../../../lib/rules/function-allowed-list/README.md): Specify a list of allowed functions.
  124. - [\`function-disallowed-list\`](../../../lib/rules/function-disallowed-list/README.md): Specify a list of disallowed functions.
  125. - [\`function-url-no-scheme-relative\`](../../../lib/rules/function-url-no-scheme-relative/README.md): Disallow scheme-relative urls.
  126. - [\`function-url-quotes\`](../../../lib/rules/function-url-quotes/README.md): Require or disallow quotes for urls.
  127. - [\`function-url-scheme-allowed-list\`](../../../lib/rules/function-url-scheme-allowed-list/README.md): Specify a list of allowed URL schemes.
  128. - [\`function-url-scheme-disallowed-list\`](../../../lib/rules/function-url-scheme-disallowed-list/README.md): Specify a list of disallowed URL schemes.
  129.  
  130. ### Keyframes
  131.  
  132. - [\`keyframes-name-pattern\`](../../../lib/rules/keyframes-name-pattern/README.md): Specify a pattern for keyframe names.
  133.  
  134. ### Number
  135.  
  136. - [\`number-max-precision\`](../../../lib/rules/number-max-precision/README.md): Limit the number of decimal places allowed in numbers.
  137.  
  138. ### Time
  139.  
  140. - [\`time-min-milliseconds\`](../../../lib/rules/time-min-milliseconds/README.md): Specify the minimum number of milliseconds for time values.
  141.  
  142. ### Unit
  143.  
  144. - [\`unit-allowed-list\`](../../../lib/rules/unit-allowed-list/README.md): Specify a list of allowed units.
  145. - [\`unit-disallowed-list\`](../../../lib/rules/unit-disallowed-list/README.md): Specify a list of disallowed units.
  146.  
  147. ### Shorthand property
  148.  
  149. - [\`shorthand-property-no-redundant-values\`](../../../lib/rules/shorthand-property-no-redundant-values/README.md): Disallow redundant values in shorthand properties (Autofixable).
  150.  
  151. ### Value
  152.  
  153. - [\`value-no-vendor-prefix\`](../../../lib/rules/value-no-vendor-prefix/README.md): Disallow vendor prefixes for values (Autofixable).
  154.  
  155. ### Custom property
  156.  
  157. - [\`custom-property-pattern\`](../../../lib/rules/custom-property-pattern/README.md): Specify a pattern for custom properties.
  158.  
  159. ### Property
  160.  
  161. - [\`property-allowed-list\`](../../../lib/rules/property-allowed-list/README.md): Specify a list of allowed properties.
  162. - [\`property-disallowed-list\`](../../../lib/rules/property-disallowed-list/README.md): Specify a list of disallowed properties.
  163. - [\`property-no-vendor-prefix\`](../../../lib/rules/property-no-vendor-prefix/README.md): Disallow vendor prefixes for properties (Autofixable).
  164.  
  165. ### Declaration
  166.  
  167. - [\`declaration-no-important\`](../../../lib/rules/declaration-no-important/README.md): Disallow \`!important\` within declarations.
  168. - [\`declaration-property-max-values\`](../../../lib/rules/declaration-property-max-values/README.md): Limit the number of values for a list of properties within declarations.
  169. - [\`declaration-property-unit-allowed-list\`](../../../lib/rules/declaration-property-unit-allowed-list/README.md): Specify a list of allowed property and unit pairs within declarations.
  170. - [\`declaration-property-unit-disallowed-list\`](../../../lib/rules/declaration-property-unit-disallowed-list/README.md): Specify a list of disallowed property and unit pairs within declarations.
  171. - [\`declaration-property-value-allowed-list\`](../../../lib/rules/declaration-property-value-allowed-list/README.md): Specify a list of allowed property and value pairs within declarations.
  172. - [\`declaration-property-value-disallowed-list\`](../../../lib/rules/declaration-property-value-disallowed-list/README.md): Specify a list of disallowed property and value pairs within declarations.
  173.  
  174. ### Declaration block
  175.  
  176. - [\`declaration-block-no-redundant-longhand-properties\`](../../../lib/rules/declaration-block-no-redundant-longhand-properties/README.md): Disallow longhand properties that can be combined into one shorthand property.
  177. - [\`declaration-block-single-line-max-declarations\`](../../../lib/rules/declaration-block-single-line-max-declarations/README.md): Limit the number of declarations within a single-line declaration block.
  178.  
  179. ### Selector
  180.  
  181. - [\`selector-attribute-name-disallowed-list\`](../../../lib/rules/selector-attribute-name-disallowed-list/README.md): Specify a list of disallowed attribute names.
  182. - [\`selector-attribute-operator-allowed-list\`](../../../lib/rules/selector-attribute-operator-allowed-list/README.md): Specify a list of allowed attribute operators.
  183. - [\`selector-attribute-operator-disallowed-list\`](../../../lib/rules/selector-attribute-operator-disallowed-list/README.md): Specify a list of disallowed attribute operators.
  184. - [\`selector-attribute-quotes\`](../../../lib/rules/selector-attribute-quotes/README.md): Require or disallow quotes for attribute values.
  185. - [\`selector-class-pattern\`](../../../lib/rules/selector-class-pattern/README.md): Specify a pattern for class selectors.
  186. - [\`selector-combinator-allowed-list\`](../../../lib/rules/selector-combinator-allowed-list/README.md): Specify a list of allowed combinators.
  187. - [\`selector-combinator-disallowed-list\`](../../../lib/rules/selector-combinator-disallowed-list/README.md): Specify a list of disallowed combinators.
  188. - [\`selector-disallowed-list\`](../../../lib/rules/selector-disallowed-list/README.md): Specify a list of disallowed selectors.
  189. - [\`selector-id-pattern\`](../../../lib/rules/selector-id-pattern/README.md): Specify a pattern for ID selectors.
  190. - [\`selector-max-attribute\`](../../../lib/rules/selector-max-attribute/README.md): Limit the number of attribute selectors in a selector.
  191. - [\`selector-max-class\`](../../../lib/rules/selector-max-class/README.md): Limit the number of classes in a selector.
  192. - [\`selector-max-combinators\`](../../../lib/rules/selector-max-combinators/README.md): Limit the number of combinators in a selector.
  193. - [\`selector-max-compound-selectors\`](../../../lib/rules/selector-max-compound-selectors/README.md): Limit the number of compound selectors in a selector.
  194. - [\`selector-max-id\`](../../../lib/rules/selector-max-id/README.md): Limit the number of ID selectors in a selector.
  195. - [\`selector-max-pseudo-class\`](../../../lib/rules/selector-max-pseudo-class/README.md): Limit the number of pseudo-classes in a selector.
  196. - [\`selector-max-specificity\`](../../../lib/rules/selector-max-specificity/README.md): Limit the specificity of selectors.
  197. - [\`selector-max-type\`](../../../lib/rules/selector-max-type/README.md): Limit the number of type in a selector.
  198. - [\`selector-max-universal\`](../../../lib/rules/selector-max-universal/README.md): Limit the number of universal selectors in a selector.
  199. - [\`selector-nested-pattern\`](../../../lib/rules/selector-nested-pattern/README.md): Specify a pattern for the selectors of rules nested within rules.
  200. - [\`selector-no-qualifying-type\`](../../../lib/rules/selector-no-qualifying-type/README.md): Disallow qualifying a selector by type.
  201. - [\`selector-no-vendor-prefix\`](../../../lib/rules/selector-no-vendor-prefix/README.md): Disallow vendor prefixes for selectors (Autofixable).
  202. - [\`selector-pseudo-class-allowed-list\`](../../../lib/rules/selector-pseudo-class-allowed-list/README.md): Specify a list of allowed pseudo-class selectors.
  203. - [\`selector-pseudo-class-disallowed-list\`](../../../lib/rules/selector-pseudo-class-disallowed-list/README.md): Specify a list of disallowed pseudo-class selectors.
  204. - [\`selector-pseudo-element-allowed-list\`](../../../lib/rules/selector-pseudo-element-allowed-list/README.md): Specify a list of allowed pseudo-element selectors.
  205. - [\`selector-pseudo-element-colon-notation\`](../../../lib/rules/selector-pseudo-element-colon-notation/README.md): Specify single or double colon notation for applicable pseudo-elements (Autofixable).
  206. - [\`selector-pseudo-element-disallowed-list\`](../../../lib/rules/selector-pseudo-element-disallowed-list/README.md): Specify a list of disallowed pseudo-element selectors.
  207.  
  208. ### Rules
  209.  
  210. - [\`rule-selector-property-disallowed-list\`](../../../lib/rules/rule-selector-property-disallowed-list/README.md): Specify a list of disallowed properties for selectors within rules.
  211.  
  212. ### Media feature
  213.  
  214. - [\`media-feature-name-allowed-list\`](../../../lib/rules/media-feature-name-allowed-list/README.md): Specify a list of allowed media feature names.
  215. - [\`media-feature-name-disallowed-list\`](../../../lib/rules/media-feature-name-disallowed-list/README.md): Specify a list of disallowed media feature names.
  216. - [\`media-feature-name-no-vendor-prefix\`](../../../lib/rules/media-feature-name-no-vendor-prefix/README.md): Disallow vendor prefixes for media feature names (Autofixable).
  217. - [\`media-feature-name-value-allowed-list\`](../../../lib/rules/media-feature-name-value-allowed-list/README.md): Specify a list of allowed media feature name and value pairs.
  218.  
  219. ### Custom media
  220.  
  221. - [\`custom-media-pattern\`](../../../lib/rules/custom-media-pattern/README.md): Specify a pattern for custom media query names.
  222.  
  223. ### At-rule
  224.  
  225. - [\`at-rule-allowed-list\`](../../../lib/rules/at-rule-allowed-list/README.md): Specify a list of allowed at-rules.
  226. - [\`at-rule-disallowed-list\`](../../../lib/rules/at-rule-disallowed-list/README.md): Specify a list of disallowed at-rules.
  227. - [\`at-rule-no-vendor-prefix\`](../../../lib/rules/at-rule-no-vendor-prefix/README.md): Disallow vendor prefixes for at-rules (Autofixable).
  228. - [\`at-rule-property-required-list\`](../../../lib/rules/at-rule-property-required-list/README.md): Specify a list of required properties for an at-rule.
  229.  
  230. ### Comment
  231.  
  232. - [\`comment-pattern\`](../../../lib/rules/comment-pattern/README.md): Specify a pattern for comments.
  233. - [\`comment-word-disallowed-list\`](../../../lib/rules/comment-word-disallowed-list/README.md): Specify a list of disallowed words within comments.
  234.  
  235. ### General / Sheet
  236.  
  237. - [\`max-nesting-depth\`](../../../lib/rules/max-nesting-depth/README.md): Limit the depth of nesting.
  238. - [\`no-irregular-whitespace\`](../../../lib/rules/no-irregular-whitespace/README.md): Disallow irregular whitespace.
  239. - [\`no-unknown-animations\`](../../../lib/rules/no-unknown-animations/README.md): Disallow unknown animations.
  240. - [\`unicode-bom\`](../../../lib/rules/unicode-bom/README.md): Require or disallow Unicode BOM.
  241.  
  242. ## Stylistic issues
  243.  
  244. We have frozen these rules — we won't fix bugs nor add options, and we will deprecate then remove them in future releases. We recommend you use a pretty printer (like Prettier) alongside Stylelint rather than these rules. If you prefer to use Stylelint to enforce stylistic consistency, you can [migrate the rules you need to a plugin](../../developer-guide/plugins.md).
  245.  
  246. ### Not handled by pretty printers
  247.  
  248. #### Value
  249.  
  250. - [\`value-keyword-case\`](../../../lib/rules/value-keyword-case/README.md): Specify lowercase or uppercase for keywords values (Autofixable).
  251.  
  252. #### Function
  253.  
  254. - [\`function-name-case\`](../../../lib/rules/function-name-case/README.md): Specify lowercase or uppercase for function names (Autofixable).
  255.  
  256. #### Custom property
  257.  
  258. - [\`custom-property-empty-line-before\`](../../../lib/rules/custom-property-empty-line-before/README.md): Require or disallow an empty line before custom properties (Autofixable).
  259.  
  260. #### Selector
  261.  
  262. - [\`selector-type-case\`](../../../lib/rules/selector-type-case/README.md): Specify lowercase or uppercase for type selectors (Autofixable).
  263.  
  264. #### Rule
  265.  
  266. - [\`rule-empty-line-before\`](../../../lib/rules/rule-empty-line-before/README.md): Require or disallow an empty line before rules (Autofixable).
  267.  
  268. #### At-rule
  269.  
  270. - [\`at-rule-empty-line-before\`](../../../lib/rules/at-rule-empty-line-before/README.md): Require or disallow an empty line before at-rules (Autofixable).
  271.  
  272. #### Comment
  273.  
  274. - [\`comment-empty-line-before\`](../../../lib/rules/comment-empty-line-before/README.md): Require or disallow an empty line before comments (Autofixable).
  275. - [\`comment-whitespace-inside\`](../../../lib/rules/comment-whitespace-inside/README.md): Require or disallow whitespace on the inside of comment markers (Autofixable).
  276.  
  277. ### Handled by pretty printers
  278.  
  279. #### Color
  280.  
  281. - [\`color-hex-case\`](../../../lib/rules/color-hex-case/README.md): Specify lowercase or uppercase for hex colors (Autofixable).
  282.  
  283. #### Function
  284.  
  285. - [\`function-comma-newline-after\`](../../../lib/rules/function-comma-newline-after/README.md): Require a newline or disallow whitespace after the commas of functions (Autofixable).
  286. - [\`function-comma-newline-before\`](../../../lib/rules/function-comma-newline-before/README.md): Require a newline or disallow whitespace before the commas of functions (Autofixable).
  287. - [\`function-comma-space-after\`](../../../lib/rules/function-comma-space-after/README.md): Require a single space or disallow whitespace after the commas of functions (Autofixable).
  288. - [\`function-comma-space-before\`](../../../lib/rules/function-comma-space-before/README.md): Require a single space or disallow whitespace before the commas of functions (Autofixable).
  289. - [\`function-max-empty-lines\`](../../../lib/rules/function-max-empty-lines/README.md): Limit the number of adjacent empty lines within functions (Autofixable).
  290. - [\`function-parentheses-newline-inside\`](../../../lib/rules/function-parentheses-newline-inside/README.md): Require a newline or disallow whitespace on the inside of the parentheses of functions (Autofixable).
  291. - [\`function-parentheses-space-inside\`](../../../lib/rules/function-parentheses-space-inside/README.md): Require a single space or disallow whitespace on the inside of the parentheses of functions (Autofixable).
  292. - [\`function-whitespace-after\`](../../../lib/rules/function-whitespace-after/README.md): Require or disallow whitespace after functions (Autofixable).
  293.  
  294. #### Number
  295.  
  296. - [\`number-leading-zero\`](../../../lib/rules/number-leading-zero/README.md): Require or disallow a leading zero for fractional numbers less than 1 (Autofixable).
  297. - [\`number-no-trailing-zeros\`](../../../lib/rules/number-no-trailing-zeros/README.md): Disallow trailing zeros in numbers (Autofixable).
  298.  
  299. #### String
  300.  
  301. - [\`string-quotes\`](../../../lib/rules/string-quotes/README.md): Specify single or double quotes around strings (Autofixable).
  302.  
  303. #### Unit
  304.  
  305. - [\`unit-case\`](../../../lib/rules/unit-case/README.md): Specify lowercase or uppercase for units (Autofixable).
  306.  
  307. #### Value list
  308.  
  309. - [\`value-list-comma-newline-after\`](../../../lib/rules/value-list-comma-newline-after/README.md): Require a newline or disallow whitespace after the commas of value lists (Autofixable).
  310. - [\`value-list-comma-newline-before\`](../../../lib/rules/value-list-comma-newline-before/README.md): Require a newline or disallow whitespace before the commas of value lists.
  311. - [\`value-list-comma-space-after\`](../../../lib/rules/value-list-comma-space-after/README.md): Require a single space or disallow whitespace after the commas of value lists (Autofixable).
  312. - [\`value-list-comma-space-before\`](../../../lib/rules/value-list-comma-space-before/README.md): Require a single space or disallow whitespace before the commas of value lists (Autofixable).
  313. - [\`value-list-max-empty-lines\`](../../../lib/rules/value-list-max-empty-lines/README.md): Limit the number of adjacent empty lines within value lists (Autofixable).
  314.  
  315. #### Property
  316.  
  317. - [\`property-case\`](../../../lib/rules/property-case/README.md): Specify lowercase or uppercase for properties (Autofixable).
  318.  
  319. #### Declaration
  320.  
  321. - [\`declaration-bang-space-after\`](../../../lib/rules/declaration-bang-space-after/README.md): Require a single space or disallow whitespace after the bang of declarations (Autofixable).
  322. - [\`declaration-bang-space-before\`](../../../lib/rules/declaration-bang-space-before/README.md): Require a single space or disallow whitespace before the bang of declarations (Autofixable).
  323. - [\`declaration-colon-newline-after\`](../../../lib/rules/declaration-colon-newline-after/README.md): Require a newline or disallow whitespace after the colon of declarations (Autofixable).
  324. - [\`declaration-colon-space-after\`](../../../lib/rules/declaration-colon-space-after/README.md): Require a single space or disallow whitespace after the colon of declarations (Autofixable).
  325. - [\`declaration-colon-space-before\`](../../../lib/rules/declaration-colon-space-before/README.md): Require a single space or disallow whitespace before the colon of declarations (Autofixable).
  326. - [\`declaration-empty-line-before\`](../../../lib/rules/declaration-empty-line-before/README.md): Require or disallow an empty line before declarations (Autofixable).
  327.  
  328. #### Declaration block
  329.  
  330. - [\`declaration-block-semicolon-newline-after\`](../../../lib/rules/declaration-block-semicolon-newline-after/README.md): Require a newline or disallow whitespace after the semicolons of declaration blocks (Autofixable).
  331. - [\`declaration-block-semicolon-newline-before\`](../../../lib/rules/declaration-block-semicolon-newline-before/README.md): Require a newline or disallow whitespace before the semicolons of declaration blocks.
  332. - [\`declaration-block-semicolon-space-after\`](../../../lib/rules/declaration-block-semicolon-space-after/README.md): Require a single space or disallow whitespace after the semicolons of declaration blocks (Autofixable).
  333. - [\`declaration-block-semicolon-space-before\`](../../../lib/rules/declaration-block-semicolon-space-before/README.md): Require a single space or disallow whitespace before the semicolons of declaration blocks (Autofixable).
  334. - [\`declaration-block-trailing-semicolon\`](../../../lib/rules/declaration-block-trailing-semicolon/README.md): Require or disallow a trailing semicolon within declaration blocks (Autofixable).
  335.  
  336. #### Block
  337.  
  338. - [\`block-closing-brace-empty-line-before\`](../../../lib/rules/block-closing-brace-empty-line-before/README.md): Require or disallow an empty line before the closing brace of blocks (Autofixable).
  339. - [\`block-closing-brace-newline-after\`](../../../lib/rules/block-closing-brace-newline-after/README.md): Require a newline or disallow whitespace after the closing brace of blocks (Autofixable).
  340. - [\`block-closing-brace-newline-before\`](../../../lib/rules/block-closing-brace-newline-before/README.md): Require a newline or disallow whitespace before the closing brace of blocks (Autofixable).
  341. - [\`block-closing-brace-space-after\`](../../../lib/rules/block-closing-brace-space-after/README.md): Require a single space or disallow whitespace after the closing brace of blocks.
  342. - [\`block-closing-brace-space-before\`](../../../lib/rules/block-closing-brace-space-before/README.md): Require a single space or disallow whitespace before the closing brace of blocks (Autofixable).
  343. - [\`block-opening-brace-newline-after\`](../../../lib/rules/block-opening-brace-newline-after/README.md): Require a newline after the opening brace of blocks (Autofixable).
  344. - [\`block-opening-brace-newline-before\`](../../../lib/rules/block-opening-brace-newline-before/README.md): Require a newline or disallow whitespace before the opening brace of blocks (Autofixable).
  345. - [\`block-opening-brace-space-after\`](../../../lib/rules/block-opening-brace-space-after/README.md): Require a single space or disallow whitespace after the opening brace of blocks (Autofixable).
  346. - [\`block-opening-brace-space-before\`](../../../lib/rules/block-opening-brace-space-before/README.md): Require a single space or disallow whitespace before the opening brace of blocks (Autofixable).
  347.  
  348. #### Selector
  349.  
  350. - [\`selector-attribute-brackets-space-inside\`](../../../lib/rules/selector-attribute-brackets-space-inside/README.md): Require a single space or disallow whitespace on the inside of the brackets within attribute selectors (Autofixable).
  351. - [\`selector-attribute-operator-space-after\`](../../../lib/rules/selector-attribute-operator-space-after/README.md): Require a single space or disallow whitespace after operators within attribute selectors (Autofixable).
  352. - [\`selector-attribute-operator-space-before\`](../../../lib/rules/selector-attribute-operator-space-before/README.md): Require a single space or disallow whitespace before operators within attribute selectors (Autofixable).
  353. - [\`selector-combinator-space-after\`](../../../lib/rules/selector-combinator-space-after/README.md): Require a single space or disallow whitespace after the combinators of selectors (Autofixable).
  354. - [\`selector-combinator-space-before\`](../../../lib/rules/selector-combinator-space-before/README.md): Require a single space or disallow whitespace before the combinators of selectors (Autofixable).
  355. - [\`selector-descendant-combinator-no-non-space\`](../../../lib/rules/selector-descendant-combinator-no-non-space/README.md): Disallow non-space characters for descendant combinators of selectors (Autofixable).
  356. - [\`selector-max-empty-lines\`](../../../lib/rules/selector-max-empty-lines/README.md): Limit the number of adjacent empty lines within selectors (Autofixable).
  357. - [\`selector-pseudo-class-case\`](../../../lib/rules/selector-pseudo-class-case/README.md): Specify lowercase or uppercase for pseudo-class selectors (Autofixable).
  358. - [\`selector-pseudo-class-parentheses-space-inside\`](../../../lib/rules/selector-pseudo-class-parentheses-space-inside/README.md): Require a single space or disallow whitespace on the inside of the parentheses within pseudo-class selectors (Autofixable).
  359. - [\`selector-pseudo-element-case\`](../../../lib/rules/selector-pseudo-element-case/README.md): Specify lowercase or uppercase for pseudo-element selectors (Autofixable).
  360.  
  361. #### Selector list
  362.  
  363. - [\`selector-list-comma-newline-after\`](../../../lib/rules/selector-list-comma-newline-after/README.md): Require a newline or disallow whitespace after the commas of selector lists (Autofixable).
  364. - [\`selector-list-comma-newline-before\`](../../../lib/rules/selector-list-comma-newline-before/README.md): Require a newline or disallow whitespace before the commas of selector lists (Autofixable).
  365. - [\`selector-list-comma-space-after\`](../../../lib/rules/selector-list-comma-space-after/README.md): Require a single space or disallow whitespace after the commas of selector lists (Autofixable).
  366. - [\`selector-list-comma-space-before\`](../../../lib/rules/selector-list-comma-space-before/README.md): Require a single space or disallow whitespace before the commas of selector lists (Autofixable).
  367.  
  368. #### Media feature
  369.  
  370. - [\`media-feature-colon-space-after\`](../../../lib/rules/media-feature-colon-space-after/README.md): Require a single space or disallow whitespace after the colon in media features (Autofixable).
  371. - [\`media-feature-colon-space-before\`](../../../lib/rules/media-feature-colon-space-before/README.md): Require a single space or disallow whitespace before the colon in media features (Autofixable).
  372. - [\`media-feature-name-case\`](../../../lib/rules/media-feature-name-case/README.md): Specify lowercase or uppercase for media feature names (Autofixable).
  373. - [\`media-feature-parentheses-space-inside\`](../../../lib/rules/media-feature-parentheses-space-inside/README.md): Require a single space or disallow whitespace on the inside of the parentheses within media features (Autofixable).
  374. - [\`media-feature-range-operator-space-after\`](../../../lib/rules/media-feature-range-operator-space-after/README.md): Require a single space or disallow whitespace after the range operator in media features (Autofixable).
  375. - [\`media-feature-range-operator-space-before\`](../../../lib/rules/media-feature-range-operator-space-before/README.md): Require a single space or disallow whitespace before the range operator in media features (Autofixable).
  376.  
  377. #### Media query list
  378.  
  379. - [\`media-query-list-comma-newline-after\`](../../../lib/rules/media-query-list-comma-newline-after/README.md): Require a newline or disallow whitespace after the commas of media query lists (Autofixable).
  380. - [\`media-query-list-comma-newline-before\`](../../../lib/rules/media-query-list-comma-newline-before/README.md): Require a newline or disallow whitespace before the commas of media query lists.
  381. - [\`media-query-list-comma-space-after\`](../../../lib/rules/media-query-list-comma-space-after/README.md): Require a single space or disallow whitespace after the commas of media query lists (Autofixable).
  382. - [\`media-query-list-comma-space-before\`](../../../lib/rules/media-query-list-comma-space-before/README.md): Require a single space or disallow whitespace before the commas of media query lists (Autofixable).
  383.  
  384. #### At-rule
  385.  
  386. - [\`at-rule-name-case\`](../../../lib/rules/at-rule-name-case/README.md): Specify lowercase or uppercase for at-rules names (Autofixable).
  387. - [\`at-rule-name-newline-after\`](../../../lib/rules/at-rule-name-newline-after/README.md): Require a newline after at-rule names.
  388. - [\`at-rule-name-space-after\`](../../../lib/rules/at-rule-name-space-after/README.md): Require a single space after at-rule names (Autofixable).
  389. - [\`at-rule-semicolon-newline-after\`](../../../lib/rules/at-rule-semicolon-newline-after/README.md): Require a newline after the semicolon of at-rules (Autofixable).
  390. - [\`at-rule-semicolon-space-before\`](../../../lib/rules/at-rule-semicolon-space-before/README.md): Require a single space or disallow whitespace before the semicolons of at-rules.
  391.  
  392. #### General / Sheet
  393.  
  394. - [\`indentation\`](../../../lib/rules/indentation/README.md): Specify indentation (Autofixable).
  395. - [\`linebreaks\`](../../../lib/rules/linebreaks/README.md): Specify unix or windows linebreaks (Autofixable).
  396. - [\`max-empty-lines\`](../../../lib/rules/max-empty-lines/README.md): Limit the number of adjacent empty lines (Autofixable).
  397. - [\`max-line-length\`](../../../lib/rules/max-line-length/README.md): Limit the length of a line.
  398. - [\`no-eol-whitespace\`](../../../lib/rules/no-eol-whitespace/README.md): Disallow end-of-line whitespace (Autofixable).
  399. - [\`no-missing-end-of-source-newline\`](../../../lib/rules/no-missing-end-of-source-newline/README.md): Disallow missing end-of-source newlines (Autofixable).
  400. - [\`no-empty-first-line\`](../../../lib/rules/no-empty-first-line/README.md): Disallow empty first lines (Autofixable).
  401. - [\`no-extra-semicolons\`](../../../lib/rules/no-extra-semicolons/README.md): Disallow extra semicolons (Autofixable).
  402. `;
  403.  
  404. let heading = null;
  405. const headingForList = {
  406. 'Avoid errors': {},
  407. 'Enforce conventions': {},
  408. 'Stylistic issues': {},
  409. };
  410. ss.split('\n').forEach(l => {
  411. if (l.trim()) {
  412. if (l.trim().startsWith('## ')) {
  413. heading = l.trim().replace('## ', '');
  414. console.log(heading);
  415. } else if (l.trim().startsWith('- [`')) {
  416. const k = l.trim().split("]")[0].replace("[",'')
  417. .replace("`",'')
  418. .replace("`",'')
  419. .replace("- ",'');
  420. headingForList[heading][k] = 'Waiting...'
  421. }
  422. }
  423. });
  424. const allRules = {
  425. ...require('./limit-language-features').rules,
  426. ...require('./possible-errors').rules,
  427. ...require('./stylistic-issues').rules,
  428. }
  429. console.log("All rules count: ", Object.keys(allRules).length)
  430. Object.keys(allRules).forEach(key=>{
  431. Object.keys(headingForList).forEach(heading=>{
  432. if (headingForList[heading][key]) {
  433. headingForList[heading][key] = allRules[key];
  434. delete allRules[key]
  435. }
  436. })
  437. })
  438. console.log(JSON.stringify(headingForList,null, 2))Re
Advertisement
Add Comment
Please, Sign In to add comment