stylelint-config-crisp 1.0.30 → 1.0.31
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.
- package/README.md +65 -52
- package/package.json +1 -1
- package/rules/at-rule-conditional-parentheses.js +6 -0
package/README.md
CHANGED
|
@@ -20,74 +20,87 @@ Just extend this configuration in your Stylelint config object:
|
|
|
20
20
|
This is the list of configured syntaxes, plugins and rules used by Stylelint Config Crisp, and what they do.
|
|
21
21
|
|
|
22
22
|
### Custom syntaxes
|
|
23
|
-
|
|
23
|
+
| Name | Description |
|
|
24
|
+
| :- | :- |
|
|
25
|
+
| [postcss-html](https://github.com/ota-meshi/postcss-html) | Allows to parse `<style>` tags from Vue files |
|
|
24
26
|
|
|
25
27
|
### Configurations
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
| Name | Description |
|
|
29
|
+
| :- | :- |
|
|
30
|
+
| [@stylistic/stylelint-config](https://github.com/stylelint-stylistic/stylelint-config) | A backport of stylistic rules that were deprecated in [Stylelint 15.0.0](https://github.com/stylelint/stylelint/blob/15.0.0/docs/migration-guide/to-15.md) |
|
|
31
|
+
| [stylelint-config-standard-scss](https://github.com/stylelint-scss/stylelint-config-standard-scss) | Standard rules specific to SCSS syntax |
|
|
32
|
+
| | |
|
|
28
33
|
|
|
29
34
|
### Plugins
|
|
30
|
-
|
|
35
|
+
| Name | Description |
|
|
36
|
+
| :- | :- |
|
|
37
|
+
| [stylelint-order](https://github.com/hudochenkov/stylelint-order) | Order-related linting rules |
|
|
31
38
|
|
|
32
39
|
### Rules
|
|
33
40
|
|
|
34
41
|
#### General rules
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- [selector-class-pattern](https://stylelint.io/user-guide/rules/selector-class-pattern/): Rule is **disabled** as it conflicts with our BEM notation in class selectors
|
|
57
|
-
- [selector-not-notation](https://stylelint.io/user-guide/rules/selector-not-notation/): Enforces simple notation for `:not()` pseudo-class selectors
|
|
58
|
-
- [selector-pseudo-class-no-unknown](https://stylelint.io/user-guide/rules/selector-pseudo-class-no-unknown/): Disallows unknown pseudo-class selectors
|
|
59
|
-
- [selector-pseudo-element-colon-notation](https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation/): Pseudo-elements must use the single colon notation
|
|
42
|
+
|
|
43
|
+
| Name | Description |
|
|
44
|
+
| :- | :- |
|
|
45
|
+
| [alpha-value-notation](https://stylelint.io/user-guide/rules/alpha-value-notation/) | Alpha-values must use the number notation (instead of the percentage notation) |
|
|
46
|
+
| [at-rule-empty-line-before](https://stylelint.io/user-guide/rules/at-rule-empty-line-before/) | Requires an empty line before at-rules <br /> - `blockless` at-rules are ignored (usefull for root `.scss` files with a lot of `@import` rules, organized in different groups) |
|
|
47
|
+
| [block-no-empty](https://stylelint.io/user-guide/rules/block-no-empty/) | Disallows empty blocks |
|
|
48
|
+
| [color-function-notation](https://stylelint.io/user-guide/rules/color-function-notation/) | Color functions must use legacy notation (`rgba(12, 122, 231, 0.2)` instead of `rgb(12 122 231 / 0.2)`) |
|
|
49
|
+
| [color-hex-length](https://stylelint.io/user-guide/rules/color-hex-length/) | Hex colors must use long notation |
|
|
50
|
+
| [color-no-invalid-hex](https://stylelint.io/user-guide/rules/color-no-invalid-hex/) | Disallows invalid hex colors |
|
|
51
|
+
| [declaration-block-no-redundant-longhand-properties](https://stylelint.io/user-guide/rules/declaration-block-no-redundant-longhand-properties/) | Disallows redundant longhand properties <br /> - `inset` shorthand is ignored (prefer using the longhand properties `top`, `right`, `bottom` and `left` altogether) <br /> - `overflow` shorthand is ignored (prefer using the longhand properties `overflow-x` and `overflow-y` altogether)|
|
|
52
|
+
| [declaration-block-single-line-max-declarations](https://stylelint.io/user-guide/rules/declaration-block-single-line-max-declarations/) | Allows only 1 declaration per line |
|
|
53
|
+
| [declaration-property-value-disallowed-list](https://stylelint.io/user-guide/rules/declaration-property-value-disallowed-list/) | A list of disallowed property and value pairs within declaration <br /> - `^border: none` is disallowed (prefer `0`, for consistency) <br /> - `outline: none` is disallowed (prefer `0`, for consistency) |
|
|
54
|
+
| [keyframe-block-no-duplicate-selectors](https://stylelint.io/user-guide/rules/keyframe-block-no-duplicate-selectors/) | Rule is **disabled**, in order to allow cascade selectors within keyframe blocks (seems they are not supported by this rule, yet) |
|
|
55
|
+
| [number-max-precision](https://stylelint.io/user-guide/rules/number-max-precision/) | Allows a maximum of 5 decimal places in numbers |
|
|
56
|
+
| [media-feature-range-notation](https://stylelint.io/user-guide/rules/media-feature-range-notation/) | Media feature ranges must use the `prefix` notation |
|
|
57
|
+
| [no-descending-specificity](https://stylelint.io/user-guide/rules/no-descending-specificity/) | Rule is **disabled**, as we do not want to check source order |
|
|
58
|
+
| [rule-empty-line-before](https://stylelint.io/user-guide/rules/rule-empty-line-before/) | Requires an empty line before multi-line rules <br /> - `"first-nested"` is reversed (for rules that are nested and the first child of their parent node, we don't want any empty line) <br /> - `"after-comment"` is ignored (for rules that follow a comment) |
|
|
59
|
+
| [selector-class-pattern](https://stylelint.io/user-guide/rules/selector-class-pattern/) | Rule is **disabled** as it conflicts with our BEM notation in class selectors |
|
|
60
|
+
| [selector-not-notation](https://stylelint.io/user-guide/rules/selector-not-notation/) | Enforces simple notation for `:not()` pseudo-class selectors |
|
|
61
|
+
| [selector-pseudo-class-no-unknown](https://stylelint.io/user-guide/rules/selector-pseudo-class-no-unknown/) | Disallows unknown pseudo-class selectors |
|
|
62
|
+
| [selector-pseudo-element-colon-notation](https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation/) | Pseudo-elements must use the single colon notation |
|
|
60
63
|
|
|
61
64
|
#### SCSS rules
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
|
|
66
|
+
| Name | Description |
|
|
67
|
+
| :- | :- |
|
|
68
|
+
| [scss/at-rule-conditional-no-parentheses](https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/at-rule-conditional-no-parentheses) | Rule is **disabled** to allow parentheses in conditional at-rules (if, elsif, while) |
|
|
69
|
+
| [scss/dollar-variable-empty-line-before](https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/dollar-variable-empty-line-before) | Rule is **disabled** to allow empty lines between logical variable blocks |
|
|
70
|
+
| [scss/load-no-partial-leading-underscore](https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/load-no-partial-leading-underscore) | Rule is **disabled** to allow `@import`-ing files with underscore in their name |
|
|
71
|
+
| [scss/map-keys-quotes](https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/map-keys-quotes) | Requires quoted keys in maps |
|
|
72
|
+
| [scss/no-global-function-names](https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/no-global-function-names) | Rule is **disabled** to keep using global function names, instead of the new built-in module system |
|
|
73
|
+
| [scss/operator-no-newline-after](https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/operator-no-newline-after) | Rule is **disabled** to allow linebreaks after Sass operators |
|
|
68
74
|
|
|
69
75
|
#### Stylistic rules
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
|
|
77
|
+
| Name | Description |
|
|
78
|
+
| :- | :- |
|
|
79
|
+
| [@stylistic/block-closing-brace-newline-after](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/block-closing-brace-newline-after) | Requires a newline after the closing brace of blocks <br /> - `if` and `else` at-rules are ignored |
|
|
80
|
+
| [@stylistic/color-hex-case](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/color-hex-case) | Enforces lowercase for hex colors |
|
|
81
|
+
| [@stylistic/declaration-colon-newline-after](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/declaration-colon-newline-after) | Rule is **disabled** to allow multi-line decleration without newline after the colon |
|
|
82
|
+
| [@stylistic/indentation](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/indentation) | Enforces 2-spaces indentation <br /> - Indentation inside parentheses is ignored, as we increment the indentation for multi-line expressions |
|
|
83
|
+
| [@stylistic/number-leading-zero](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/number-leading-zero) | Requires a leading zero for fractional numbers less than 1 |
|
|
84
|
+
| [@stylistic/property-case](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/property-case) | Enforces lowercase for properties |
|
|
85
|
+
| [@stylistic/selector-pseudo-class-case](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/selector-pseudo-class-case) | Enforces lowercase for pseudo-class selectors |
|
|
86
|
+
| [@stylistic/selector-pseudo-element-case](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/selector-pseudo-element-case) | Enforces lowercase for pseudo-element selectors |
|
|
87
|
+
| [@stylistic/string-quotes](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/string-quotes) | Enforces double quotes around strings |
|
|
88
|
+
| [@stylistic/unit-case](https://github.com/stylelint-stylistic/stylelint-stylistic/tree/main/lib/rules/unit-case) | Enforces lowercase for units |
|
|
82
89
|
|
|
83
90
|
#### Order rules
|
|
84
|
-
|
|
91
|
+
|
|
92
|
+
| Name | Description |
|
|
93
|
+
| :- | :- |
|
|
94
|
+
| [order/order](https://github.com/hudochenkov/stylelint-order/tree/master/rules/order) | Enforces the order of content within declaration blocks: dollar variables, then declarations, then nested rules |
|
|
85
95
|
|
|
86
96
|
#### Crisp rules
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
|
|
98
|
+
| Name | Description |
|
|
99
|
+
| :- | :- |
|
|
100
|
+
| [at-rule-conditional-parentheses](https://github.com/crisp-oss/stylelint-config-crisp/blob/master/rules/at-rule-conditional-parentheses.js) | Enforces parentheses in conditions of at-rules (`@if`, `@elseif`, `@while`) |
|
|
101
|
+
| [filename-class-match](https://github.com/crisp-oss/stylelint-config-crisp/blob/master/rules/filename-class-match.js) | Ensures that class name is derivated from filename (this rule is only applied to Vue files) |
|
|
102
|
+
| [rule-empty-line-before](https://github.com/crisp-oss/stylelint-config-crisp/blob/master/rules/rule-empty-line-before.js) | Requires an empty line before multi-line rules the same way [rule-empty-line-before](https://stylelint.io/user-guide/rules/rule-empty-line-before/) does, but properly handles Sass interpolation `#{}` in selectors |
|
|
103
|
+
| [selector-class-interpolation](https://github.com/crisp-oss/stylelint-config-crisp/blob/master/rules/selector-class-interpolation.js) | Enforces class selectors to use Sass interpolation (this rule is only applied to Vue files) |
|
|
91
104
|
|
|
92
105
|
## License
|
|
93
106
|
|
package/package.json
CHANGED
|
@@ -29,10 +29,16 @@ const ruleFunction = (primaryOption, secondaryOptions, context) => {
|
|
|
29
29
|
if (["if", "while"].includes(rule.name) || elseIf === true) {
|
|
30
30
|
let params = rule.params;
|
|
31
31
|
|
|
32
|
+
// Remove `if `
|
|
32
33
|
if (elseIf === true) {
|
|
33
34
|
params = params.slice(3);
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
// Remove `not `
|
|
38
|
+
if (params.startsWith("not ")) {
|
|
39
|
+
params = params.slice(4);
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
if (!params.startsWith("(") || !params.endsWith(")")) {
|
|
37
43
|
stylelint.utils.report({
|
|
38
44
|
ruleName,
|