Skip to content

Latest commit

 

History

History
361 lines (242 loc) · 29.1 KB

rules.md

File metadata and controls

361 lines (242 loc) · 29.1 KB

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.

The built-in rules are geared towards standard CSS syntax. With the exception of the indentation rule, all the rules will ignore structures that contain non-standard syntax e.g. variable interpolation and mixins.

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 first by category and then by the thing they apply to.

Possible errors

Color

Font family

Function

String

Unit

Property

Keyframe declaration

Declaration block

Block

Selector

Media feature

At-rule

Comment

General / Sheet

Limit language features

Color

Function

Keyframes

Number

Time

Unit

Shorthand property

Value

Custom property

Property

Declaration

Declaration block

Selector

Media feature

Custom media

At-rule

Comment

General / Sheet

Stylistic issues

Color

  • color-hex-case: Specify lowercase or uppercase for hex colors (Autofixable).
  • color-hex-length: Specify short or long notation for hex colors (Autofixable).

Font family

Font weight

  • font-weight-notation: Require numeric or named (where possible) font-weight values. Also, when named values are expected, require only valid names.

Function

Number

String

  • string-quotes: Specify single or double quotes around strings (Autofixable).

Length

Unit

  • unit-case: Specify lowercase or uppercase for units (Autofixable).

Value

Value list

Custom property

Property

  • property-case: Specify lowercase or uppercase for properties (Autofixable).

Declaration

Declaration block

Block

Selector

Selector list

Rule

Media feature

Media query list

At-rule

Comment

General / Sheet