1.0.31 • Published 3 months ago

stylelint-config-crisp v1.0.31

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Stylelint Config Crisp

Build and Release NPM Downloads

A Stylelint configuration that enforces Crisp's CSS rules.

😘 Maintainer: @eliottvincent

Usage

Just extend this configuration in your Stylelint config object:

{
  "extends": ["stylelint-config-crisp"]
}

Documentation

This is the list of configured syntaxes, plugins and rules used by Stylelint Config Crisp, and what they do.

Custom syntaxes

NameDescription
postcss-htmlAllows to parse <style> tags from Vue files

Configurations

NameDescription
@stylistic/stylelint-configA backport of stylistic rules that were deprecated in Stylelint 15.0.0
stylelint-config-standard-scssStandard rules specific to SCSS syntax

Plugins

NameDescription
stylelint-orderOrder-related linting rules

Rules

General rules

NameDescription
alpha-value-notationAlpha-values must use the number notation (instead of the percentage notation)
at-rule-empty-line-beforeRequires an empty line before at-rules - blockless at-rules are ignored (usefull for root .scss files with a lot of @import rules, organized in different groups)
block-no-emptyDisallows empty blocks
color-function-notationColor functions must use legacy notation (rgba(12, 122, 231, 0.2) instead of rgb(12 122 231 / 0.2))
color-hex-lengthHex colors must use long notation
color-no-invalid-hexDisallows invalid hex colors
declaration-block-no-redundant-longhand-propertiesDisallows redundant longhand properties - inset shorthand is ignored (prefer using the longhand properties top, right, bottom and left altogether) - overflow shorthand is ignored (prefer using the longhand properties overflow-x and overflow-y altogether)
declaration-block-single-line-max-declarationsAllows only 1 declaration per line
declaration-property-value-disallowed-listA list of disallowed property and value pairs within declaration - ^border: none is disallowed (prefer 0, for consistency) - outline: none is disallowed (prefer 0, for consistency)
keyframe-block-no-duplicate-selectorsRule is disabled, in order to allow cascade selectors within keyframe blocks (seems they are not supported by this rule, yet)
number-max-precisionAllows a maximum of 5 decimal places in numbers
media-feature-range-notationMedia feature ranges must use the prefix notation
no-descending-specificityRule is disabled, as we do not want to check source order
rule-empty-line-beforeRequires an empty line before multi-line rules - "first-nested" is reversed (for rules that are nested and the first child of their parent node, we don't want any empty line) - "after-comment" is ignored (for rules that follow a comment)
selector-class-patternRule is disabled as it conflicts with our BEM notation in class selectors
selector-not-notationEnforces simple notation for :not() pseudo-class selectors
selector-pseudo-class-no-unknownDisallows unknown pseudo-class selectors
selector-pseudo-element-colon-notationPseudo-elements must use the single colon notation

SCSS rules

NameDescription
scss/at-rule-conditional-no-parenthesesRule is disabled to allow parentheses in conditional at-rules (if, elsif, while)
scss/dollar-variable-empty-line-beforeRule is disabled to allow empty lines between logical variable blocks
scss/load-no-partial-leading-underscoreRule is disabled to allow @import-ing files with underscore in their name
scss/map-keys-quotesRequires quoted keys in maps
scss/no-global-function-namesRule is disabled to keep using global function names, instead of the new built-in module system
scss/operator-no-newline-afterRule is disabled to allow linebreaks after Sass operators

Stylistic rules

NameDescription
@stylistic/block-closing-brace-newline-afterRequires a newline after the closing brace of blocks - if and else at-rules are ignored
@stylistic/color-hex-caseEnforces lowercase for hex colors
@stylistic/declaration-colon-newline-afterRule is disabled to allow multi-line decleration without newline after the colon
@stylistic/indentationEnforces 2-spaces indentation - Indentation inside parentheses is ignored, as we increment the indentation for multi-line expressions
@stylistic/number-leading-zeroRequires a leading zero for fractional numbers less than 1
@stylistic/property-caseEnforces lowercase for properties
@stylistic/selector-pseudo-class-caseEnforces lowercase for pseudo-class selectors
@stylistic/selector-pseudo-element-caseEnforces lowercase for pseudo-element selectors
@stylistic/string-quotesEnforces double quotes around strings
@stylistic/unit-caseEnforces lowercase for units

Order rules

NameDescription
order/orderEnforces the order of content within declaration blocks: dollar variables, then declarations, then nested rules

Crisp rules

NameDescription
at-rule-conditional-parenthesesEnforces parentheses in conditions of at-rules (@if, @elseif, @while)
filename-class-matchEnsures that class name is derivated from filename (this rule is only applied to Vue files)
rule-empty-line-beforeRequires an empty line before multi-line rules the same way rule-empty-line-before does, but properly handles Sass interpolation #{} in selectors
selector-class-interpolationEnforces class selectors to use Sass interpolation (this rule is only applied to Vue files)

License

stylelint-config-crisp is released under the MIT License. See the bundled LICENSE file for details.

1.0.31

3 months ago

1.0.30

4 months ago

1.0.29

4 months ago

1.0.28

4 months ago

1.0.27

4 months ago

1.0.22

4 months ago

1.0.21

4 months ago

1.0.20

4 months ago

1.0.26

4 months ago

1.0.25

4 months ago

1.0.24

4 months ago

1.0.23

4 months ago

1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.2

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.0

5 months ago