-
Notifications
You must be signed in to change notification settings - Fork 36
Lint Rule Comparison
Brett Jankord edited this page Nov 16, 2017
·
28 revisions
This is a comparison of scss-lint rules recommended by Sass Guidelines with similar stylelint rules and not a direct comparison of scss-lint rules with stylelint rules. scss-lint does an excellent job of linting .scss files. Stylelint also has the ability to lint .scss files and with the help of stylelint-scss, it can match a lot of the linter rules from scss-lint.
| scss-lint rule used in Sass Guidelines | Equivalent lint rules in stylelint |
|---|---|
BangFormat enabledspace_before_bangtruespace_after_bangfalse
|
declaration-bang-space-before / declaration-bang-space-afterdeclaration-bang-space-beforealwaysdeclaration-bang-space-afternever
|
BemDepth enabledmax_elements 1
|
- |
BorderZero enabledconventionzero
|
declaration-property-value-blacklist"/^border/": ["none"]
|
| ColorKeyword enabled |
color-named never
|
|
DebugStatement enabled |
at-rule-blacklist ["debug"]
|
|
DeclarationOrder enabled |
declaration-block-properties-orderalphabeticalPlugin: stylelint-order order/order [
[
"custom-properties",
"dollar-variables",
{
"type": "at-rule",
"name": "extend"
},
{
"type": "at-rule",
"name": "include",
"hasBlock": false
},
"declarations",
{
"type": "at-rule",
"hasBlock": true
},
{
"type": "at-rule",
"name": "include",
"hasBlock": true
},
{
"type": "rule",
"selector": "/^&:\\w/"
},
{
"type": "rule",
"selector": "/^&::\\w/"
},
"rules"
]
]
|
|
DisableLinterReason enabled |
stylelint-disable-reason always-before
|
ElsePlacement enabledstylesame_line
|
- |
EmptyLineBetweenBlocks enabledignore_single_line_blockstrue |
rule-nested-empty-line-before / rule-non-nested-empty-line-beforealways-multi-lineexceptfirst-nestedignoreafter-comment
|
| EmptyRule enabled |
block-no-empty true
|
FinalNewline enabledpresenttrue
|
no-missing-end-of-source-newline true |
HexLength enabledstyleshort
|
color-hex-lengthshort
|
HexNotation enabledstylelowercase
|
color-hex-caselower
|
|
HexValidation enabled |
color-no-invalid-hex true
|
| IdSelector enabled |
selector-no-id true
|
ImportPath enabledleading_underscorefalsefilename_extensionfalse
|
Plugin: stylelint-scss at-import-no-partial-leading-underscore trueat-import-partial-extension-blacklist ["scss"] |
Indentation enabledallow_non_nested_indentationtruecharacterspacewidth2
|
indentation - - number2
|
LeadingZero enabledstyleinclude_zero
|
number-leading-zeroalways
|
NameFormat enabledallow_leading_underscoretrueconventionhyphenated_lowercase
|
Plugin: stylelint-scss scss/at-function-pattern, scss/at-mixin-pattern, scss/dollar-variable-pattern ^[a-z]+([a-z0-9-]+[a-z0-9]+)?$
|
NestingDepth enabledmax_depthnumber 1
|
max-nesting-depth1
|
|
PlaceholderInExtend enabled |
Plugin: stylelint-scss scss/at-extend-no-missing-placeholder true
|
PrivateNamingConvention enabledprefix_
|
- |
PropertySpelling enabledextra_properties[]
|
property-no-unknown ignoreProperties[]
|
|
PseudoElement enabled |
selector-pseudo-element-colon-notation doubleselector-pseudo-element-no-unknown true
|
QualifyingElement enabledallow_element_with_attributefalseallow_element_with_classfalseallow_element_with_idfalse
|
selector-no-qualifying-type true |
SelectorDepth enabledmax_depth3
|
selector-max-compound-selectors3
|
SelectorFormat enabledconventionhyphenated_lowercaseclass_convention`^(?:u |
is |
|
Shorthand enabled |
shorthand-property-no-redundant-values true
|
SingleLinePerProperty enabledallow_single_line_rule_setsfalse |
declaration-block-semicolon-newline-afteralwaysdeclaration-block-single-line-max-declarations 1
|
|
SingleLinePerSelector enabled |
selector-list-comma-newline-after always
|
|
SpaceAfterComma enabled |
function-comma-space-afteralways-single-lineStylelint does not detect issues with commas within a mixin |
SpaceAfterPropertyColon enabledstyleone_space
|
declaration-colon-space-afteralways-single-line
|
|
SpaceAfterPropertyName enabled |
declaration-colon-space-before never
|
SpaceAfterVariableColon enabledstyleat_least_one_space
|
Plugin: stylelint-scss scss/dollar-variable-colon-space-after always |
| SpaceAfterVariableName enabled |
Plugin: stylelint-scss scss/dollar-variable-colon-space-before never
|
SpaceAroundOperator enabledstyleone_space |
- stylelint has function-calc-no-unspaced-operator but stylelint does not currently support checking the space around operator inside of scss specific code Issue logged with stylelint-scss |
SpaceBeforeBrace enabledallow_single_line_paddingtruestylespace
|
block-opening-brace-space-before - always
|
SpaceBetweenParens enabledspaces0
|
function-parentheses-space-insidenever
|
StringQuotes enabledstylesingle_quotes
|
string-quotessingle
|
|
TrailingSemicolon enabled |
declaration-block-trailing-semicolon alwaysdeclaration-block-semicolon-space-before never
|
|
TrailingZero enabled |
number-no-trailing-zeros true
|
|
UnnecessaryMantissa enabled |
number-no-trailing-zeros true
|
|
UnnecessaryParentReference enabled |
Plugin: stylelint-scss selector-no-redundant-nesting-selector true
|
|
UrlQuotes enabled |
function-url-quotes always
|
VendorPrefix enabledidentifier_listbase
|
property-no-vendor-prefix true selector-no-vendor-prefix true media-feature-name-no-vendor-prefix true at-rule-no-vendor-prefix true value-no-vendor-prefix true |
|
ZeroUnit enabled |
length-zero-no-unit true
|