Socket
Book a DemoInstallSign in
Socket

stylelint-config-crisp

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-config-crisp

Custom Stylelint Rules for Crisp

latest
Source
npmnpm
Version
1.0.36
Version published
Maintainers
1
Created
Source

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.

Keywords

stylelint

FAQs

Package last updated on 17 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts