mirror of
https://github.com/thangisme/notes.git
synced 2024-11-01 02:37:25 -04:00
27 KiB
27 KiB
Rules
Rules determine what the linter looks for and complains about. All the rules are turned off by default and none have default values for their options. The rules follow a consistent naming convention and have been designed to work in conjunction with one another, you can read more about this in the "About rules" section.
In addition to these rules there are plugins, which are rules built by the community that support methodologies, toolsets, non-standard CSS features, or very specific use cases. Don't forget to look at the list of plugins for more ways to lint.
List of rules
Here are all the rules within stylelint, grouped by the thing they apply to.
Color
color-hex-case
: Specify lowercase or uppercase for hex colors.color-hex-length
: Specify short or long notation for hex colors.color-named
: Require (where possible) or disallow named colors.color-no-hex
: Disallow hex colors.color-no-invalid-hex
: Disallow invalid hex colors.
Font family
font-family-name-quotes
: Specify whether or not quotation marks should be used around font family names.font-family-no-duplicate-names
: Disallow duplicate font family names.
Font weight
font-weight-notation
: Require numeric or named (where possible)font-weight
values.
Function
function-blacklist
: Specify a blacklist of disallowed functions.function-calc-no-unspaced-operator
: Disallow an unspaced operator withincalc
functions.function-comma-newline-after
: Require a newline or disallow whitespace after the commas of functions.function-comma-newline-before
: Require a newline or disallow whitespace before the commas of functions.function-comma-space-after
: Require a single space or disallow whitespace after the commas of functions.function-comma-space-before
: Require a single space or disallow whitespace before the commas of functions.function-linear-gradient-no-nonstandard-direction
: Disallow direction values inlinear-gradient()
calls that are not valid according to the standard syntax.function-max-empty-lines
: Limit the number of adjacent empty lines within functions.function-name-case
: Specify lowercase or uppercase for function names.function-parentheses-newline-inside
: Require a newline or disallow whitespace on the inside of the parentheses of functions.function-parentheses-space-inside
: Require a single space or disallow whitespace on the inside of the parentheses of functions.function-url-data-uris
: Require or disallow data URIs for urls.function-url-no-scheme-relative
: Disallow scheme-relative urls.function-url-quotes
: Require or disallow quotes for urls.function-url-scheme-whitelist
: Specify a whitelist of allowed url schemes.function-whitelist
: Specify a whitelist of allowed functions.function-whitespace-after
: Require or disallow whitespace after functions.
Number
number-leading-zero
: Require or disallow a leading zero for fractional numbers less than 1.number-max-precision
: Limit the number of decimal places allowed in numbers.number-no-trailing-zeros
: Disallow trailing zeros in numbers.
String
string-no-newline
: Disallow (unescaped) newlines in strings.string-quotes
: Specify single or double quotes around strings.
Length
length-zero-no-unit
: Disallow units for zero lengths.
Time
time-min-milliseconds
: Specify the minimum number of milliseconds for time values.time-no-imperceptible
: Disallowanimation
andtransition
less than or equal to 100ms (deprecated).
Unit
unit-blacklist
: Specify a blacklist of disallowed units.unit-case
: Specify lowercase or uppercase for units.unit-no-unknown
: Disallow unknown units.unit-whitelist
: Specify a whitelist of allowed units.
Value
value-keyword-case
: Specify lowercase or uppercase for keywords values.value-no-vendor-prefix
: Disallow vendor prefixes for values.
Value list
value-list-comma-newline-after
: Require a newline or disallow whitespace after the commas of value lists.value-list-comma-newline-before
: Require a newline or disallow whitespace before the commas of value lists.value-list-comma-space-after
: Require a single space or disallow whitespace after the commas of value lists.value-list-comma-space-before
: Require a single space or disallow whitespace before the commas of value lists.value-list-max-empty-lines
: Limit the number of adjacent empty lines within value lists.
Custom property
custom-property-empty-line-before
: Require or disallow an empty line before custom properties.custom-property-no-outside-root
: Disallow custom properties outside of:root
rules (deprecated).custom-property-pattern
: Specify a pattern for custom properties.
Shorthand property
shorthand-property-no-redundant-values
: Disallow redundant values in shorthand properties.
Property
property-blacklist
: Specify a blacklist of disallowed properties.property-case
: Specify lowercase or uppercase for properties.property-no-unknown
: Disallow unknown properties.property-no-vendor-prefix
: Disallow vendor prefixes for properties.property-whitelist
: Specify a whitelist of allowed properties.
Keyframe declaration
keyframe-declaration-no-important
: Disallow!important
within keyframe declarations.
Declaration
declaration-bang-space-after
: Require a single space or disallow whitespace after the bang of declarations.declaration-bang-space-before
: Require a single space or disallow whitespace before the bang of declarations.declaration-colon-newline-after
: Require a newline or disallow whitespace after the colon of declarations.declaration-colon-space-after
: Require a single space or disallow whitespace after the colon of declarations.declaration-colon-space-before
: Require a single space or disallow whitespace before the colon of declarations.declaration-empty-line-before
: Require or disallow an empty line before declarations.declaration-no-important
: Disallow!important
within declarations.declaration-property-unit-blacklist
: Specify a blacklist of disallowed property and unit pairs within declarations.declaration-property-unit-whitelist
: Specify a whitelist of allowed property and unit pairs within declarations.declaration-property-value-blacklist
: Specify a blacklist of disallowed property and value pairs within declarations.declaration-property-value-whitelist
: Specify a whitelist of allowed property and value pairs within declarations.
Declaration block
declaration-block-no-duplicate-properties
: Disallow duplicate properties within declaration blocks.declaration-block-no-ignored-properties
: Disallow property values that are ignored due to another property value in the same rule (deprecated).declaration-block-no-redundant-longhand-properties
: Disallow longhand properties that can be combined into one shorthand property.declaration-block-no-shorthand-property-overrides
: Disallow shorthand properties that override related longhand properties within declaration blocks.declaration-block-properties-order
: Specify the order of properties within declaration blocks (deprecated).declaration-block-semicolon-newline-after
: Require a newline or disallow whitespace after the semicolons of declaration blocks.declaration-block-semicolon-newline-before
: Require a newline or disallow whitespace before the semicolons of declaration blocks.declaration-block-semicolon-space-after
: Require a single space or disallow whitespace after the semicolons of declaration blocks.declaration-block-semicolon-space-before
: Require a single space or disallow whitespace before the semicolons of declaration blocks.declaration-block-single-line-max-declarations
: Limit the number of declaration within single line declaration blocks.declaration-block-trailing-semicolon
: Require or disallow a trailing semicolon within declaration blocks.
Block
block-closing-brace-empty-line-before
: Require or disallow an empty line before the closing brace of blocks.block-closing-brace-newline-after
: Require a newline or disallow whitespace after the closing brace of blocks.block-closing-brace-newline-before
: Require a newline or disallow whitespace before the closing brace of blocks.block-closing-brace-space-after
: Require a single space or disallow whitespace after the closing brace of blocks.block-closing-brace-space-before
: Require a single space or disallow whitespace before the closing brace of blocks.block-no-empty
: Disallow empty blocks.block-no-single-line
: Disallow single-line blocks (deprecated).block-opening-brace-newline-after
: Require a newline after the opening brace of blocks.block-opening-brace-newline-before
: Require a newline or disallow whitespace before the opening brace of blocks.block-opening-brace-space-after
: Require a single space or disallow whitespace after the opening brace of blocks.block-opening-brace-space-before
: Require a single space or disallow whitespace before the opening brace of blocks.
Selector
selector-attribute-brackets-space-inside
: Require a single space or disallow whitespace on the inside of the brackets within attribute selectors.selector-attribute-operator-blacklist
: Specify a blacklist of disallowed attribute operators.selector-attribute-operator-space-after
: Require a single space or disallow whitespace after operators within attribute selectors.selector-attribute-operator-space-before
: Require a single space or disallow whitespace before operators within attribute selectors.selector-attribute-operator-whitelist
: Specify a whitelist of allowed attribute operators.selector-attribute-quotes
: Require or disallow quotes for attribute values.selector-class-pattern
: Specify a pattern for class selectors.selector-combinator-space-after
: Require a single space or disallow whitespace after the combinators of selectors.selector-combinator-space-before
: Require a single space or disallow whitespace before the combinators of selectors.selector-descendant-combinator-no-non-space
: Disallow non-space characters for descendant combinators of selectors.selector-id-pattern
: Specify a pattern for id selectors.selector-max-compound-selectors
: Limit the number of compound selectors in a selector.selector-max-specificity
: Limit the specificity of selectors.selector-nested-pattern
: Specify a pattern for the selectors of rules nested within rules.selector-no-attribute
: Disallow attribute selectors.selector-no-combinator
: Disallow combinators in selectors.selector-no-empty
: Disallow empty selectors (deprecated).selector-no-id
: Disallow id selectors.selector-no-qualifying-type
: Disallow qualifying a selector by type.selector-no-type
: Disallow type selectors.selector-no-universal
: Disallow the universal selector.selector-no-vendor-prefix
: Disallow vendor prefixes for selectors.selector-pseudo-class-blacklist
: Specify a blacklist of disallowed pseudo-class selectors.selector-pseudo-class-case
: Specify lowercase or uppercase for pseudo-class selectors.selector-pseudo-class-no-unknown
: Disallow unknown pseudo-class selectors.selector-pseudo-class-parentheses-space-inside
: Require a single space or disallow whitespace on the inside of the parentheses within pseudo-class selectors.selector-pseudo-class-whitelist
: Specify a whitelist of allowed pseudo-class selectors.selector-pseudo-element-case
: Specify lowercase or uppercase for pseudo-element selectors.selector-pseudo-element-colon-notation
: Specify single or double colon notation for applicable pseudo-elements.selector-pseudo-element-no-unknown
: Disallow unknown pseudo-element selectors.selector-root-no-composition
: Disallow the composition of:root
in selectors (deprecated).selector-type-case
: Specify lowercase or uppercase for type selector.selector-type-no-unknown
: Disallow unknown type selectors.selector-max-empty-lines
: Limit the number of adjacent empty lines within selectors.
Selector list
selector-list-comma-newline-after
: Require a newline or disallow whitespace after the commas of selector lists.selector-list-comma-newline-before
: Require a newline or disallow whitespace before the commas of selector lists.selector-list-comma-space-after
: Require a single space or disallow whitespace after the commas of selector lists.selector-list-comma-space-before
: Require a single space or disallow whitespace before the commas of selector lists.
Root rule
root-no-standard-properties
: Disallow standard properties inside:root
rules (deprecated).
Rule
rule-empty-line-before
: Require or disallow an empty line before rules.rule-nested-empty-line-before
: Require or disallow an empty line before nested rules (deprecated).rule-non-nested-empty-line-before
: Require or disallow an empty line before non-nested rules (deprecated).
Media feature
media-feature-colon-space-after
: Require a single space or disallow whitespace after the colon in media features.media-feature-colon-space-before
: Require a single space or disallow whitespace before the colon in media features.media-feature-name-blacklist
: Specify a blacklist of disallowed media feature names.media-feature-name-case
: Specify lowercase or uppercase for media feature names.media-feature-name-no-unknown
: Disallow unknown media feature names.media-feature-name-no-vendor-prefix
: Disallow vendor prefixes for media feature names.media-feature-name-whitelist
: Specify a whitelist of allowed media feature names.media-feature-no-missing-punctuation
: Disallow missing punctuation for non-boolean media features (deprecated).media-feature-parentheses-space-inside
: Require a single space or disallow whitespace on the inside of the parentheses within media features.media-feature-range-operator-space-after
: Require a single space or disallow whitespace after the range operator in media features.media-feature-range-operator-space-before
: Require a single space or disallow whitespace before the range operator in media features.
Custom media
custom-media-pattern
: Specify a pattern for custom media query names.
Media query list
media-query-list-comma-newline-after
: Require a newline or disallow whitespace after the commas of media query lists.media-query-list-comma-newline-before
: Require a newline or disallow whitespace before the commas of media query lists.media-query-list-comma-space-after
: Require a single space or disallow whitespace after the commas of media query lists.media-query-list-comma-space-before
: Require a single space or disallow whitespace before the commas of media query lists.
At-rule
at-rule-blacklist
: Specify a blacklist of disallowed at-rules.at-rule-empty-line-before
: Require or disallow an empty line before at-rules.at-rule-name-case
: Specify lowercase or uppercase for at-rules names.at-rule-name-newline-after
: Require a newline after at-rule names.at-rule-name-space-after
: Require a single space after at-rule names.at-rule-no-unknown
: Disallow unknown at-rules.at-rule-no-vendor-prefix
: Disallow vendor prefixes for at-rules.at-rule-semicolon-newline-after
: Require a newline after the semicolon of at-rules.at-rule-whitelist
: Specify a whitelist of allowed at-rules.
stylelint-disable
comment
stylelint-disable-reason
: Require a reason comment before or afterstylelint-disable
comments (deprecated).
Comment
comment-empty-line-before
: Require or disallow an empty line before comments.comment-no-empty
: Disallow empty comments.comment-whitespace-inside
: Require or disallow whitespace on the inside of comment markers.comment-word-blacklist
: Specify a blacklist of disallowed words within comments.
General / Sheet
indentation
: Specify indentation.max-empty-lines
: Limit the number of adjacent empty lines.max-line-length
: Limit the length of a line.max-nesting-depth
: Limit the depth of nesting.no-browser-hacks
: Disallow browser hacks that are irrelevant to the browsers you are targeting (deprecated).no-descending-specificity
: Disallow selectors of lower specificity from coming after overriding selectors of higher specificity.no-duplicate-selectors
: Disallow duplicate selectors.no-empty-source
: Disallow empty sources.no-eol-whitespace
: Disallow end-of-line whitespace.no-extra-semicolons
: Disallow extra semicolons.no-indistinguishable-colors
: Disallow colors that are suspiciously close to being identical (deprecated).no-invalid-double-slash-comments
: Disallow double-slash comments (//...
) which are not supported by CSS.no-missing-end-of-source-newline
: Disallow missing end-of-source newlines.no-unknown-animations
: Disallow unknown animations.no-unsupported-browser-features
: Disallow features that are unsupported by the browsers that you are targeting (deprecated).