This package has been deprecated in favor of @stylistic/stylelint-plugin
As I have very few free time to take care of this plugin, I have decided to share support of it with firefoxic. As such, the new package will continue support for stylelint 16 and future update. Please note this current package will still be usable with stylelint 15 but will no longer receive fixes.
Plugin for endangered stylelint stylistic rules.
As of its version 15, the popular stylelint package will slowly deprecate and remove 76 stylistic rules.
The proposed solution was to move to other specialized formatting packages like prettier, but it proved to be a tedious task on large projects. Not all of them are able to shift easily and fix the potential conflicts between different linters / formatters (especially on hybrid linting environments such as CSS-in-JS).
As these endangered rules were working quite well, and alongside the stylelint recommendation, I have decided to move them to this package in order to maintain them. Only a soft migration will be need to keep them in your projects.
You will need stylelint 15.0.0 or higher as a peer dependency.
Install the package :
npm install stylelint-stylistic --save-dev
or
yarn add stylelint-stylistic --dev
Append the plugin to your stylelint configuration plugins :
{
"plugins": [
"stylelint-stylistic"
]
}
Or alternatively, if you wish to use the plugin default config, you can directly extend it :
{
"extends": [
"stylelint-stylistic/config"
]
}
All rules were moved, according to stylelint
plugin convention, to the stylistic
scope. If you already have some of them in your configuration, juste changed any rule
to stylistic/rule
.
Rule | Auto-fixable | Category |
---|---|---|
stylistic/color-hex-case Specify lowercase or uppercase for hex colors. |
yes | Color |
stylistic/function-comma-newline-after Require a newline or disallow whitespace after the commas of functions. |
yes | Function |
stylistic/function-comma-newline-before Require a newline or disallow whitespace before the commas of functions. |
yes | Function |
stylistic/function-comma-space-after Require a single space or disallow whitespace after the commas of functions. |
yes | Function |
stylistic/function-comma-space-before Require a single space or disallow whitespace before the commas of functions. |
yes | Function |
stylistic/function-max-empty-lines Limit the number of adjacent empty lines within functions. |
yes | Function |
stylistic/function-parentheses-newline-inside Require a newline or disallow whitespace on the inside of the parentheses of functions. |
yes | Function |
stylistic/function-parentheses-space-inside Require a single space or disallow whitespace on the inside of the parentheses of functions. |
yes | Function |
stylistic/function-whitespace-after Require or disallow whitespace after functions. |
yes | Function |
stylistic/number-leading-zero Require or disallow a leading zero for fractional numbers less than 1. |
yes | Number |
stylistic/number-no-trailing-zeros Disallow trailing zeros in numbers. |
yes | Number |
stylistic/string-quotes Specify single or double quotes around strings. |
yes | String |
stylistic/unit-case Specify lowercase or uppercase for units. |
yes | Unit |
stylistic/value-list-comma-newline-after Require a newline or disallow whitespace after the commas of value lists. |
yes | Value list |
stylistic/value-list-comma-newline-before Require a newline or disallow whitespace before the commas of value lists. |
no | Value list |
stylistic/value-list-comma-space-after Require a single space or disallow whitespace after the commas of value lists. |
yes | Value list |
stylistic/value-list-comma-space-before Require a single space or disallow whitespace before the commas of value lists. |
yes | Value list |
stylistic/value-list-max-empty-lines Limit the number of adjacent empty lines within value lists. |
yes | Value list |
stylistic/property-case Specify lowercase or uppercase for properties. |
yes | Property |
stylistic/declaration-bang-space-after Require a single space or disallow whitespace after the bang of declarations. |
yes | Declaration |
stylistic/declaration-bang-space-before Require a single space or disallow whitespace before the bang of declarations. |
yes | Declaration |
stylistic/declaration-colon-newline-after Require a newline or disallow whitespace after the colon of declarations. |
yes | Declaration |
stylistic/declaration-colon-space-after Require a single space or disallow whitespace after the colon of declarations. |
yes | Declaration |
stylistic/declaration-colon-space-before Require a single space or disallow whitespace before the colon of declarations. |
yes | Declaration |
stylistic/declaration-block-semicolon-newline-after Require a newline or disallow whitespace after the semicolons of declaration blocks. |
yes | Declaration block |
stylistic/declaration-block-semicolon-newline-before Require a newline or disallow whitespace before the semicolons of declaration blocks. |
no | Declaration block |
stylistic/declaration-block-semicolon-space-after Require a single space or disallow whitespace after the semicolons of declaration blocks. |
yes | Declaration block |
stylistic/declaration-block-semicolon-space-before Require a single space or disallow whitespace before the semicolons of declaration blocks. |
yes | Declaration block |
stylistic/declaration-block-trailing-semicolon Require or disallow a trailing semicolon within declaration blocks. |
yes | Declaration block |
stylistic/block-closing-brace-empty-line-before Require or disallow an empty line before the closing brace of blocks. |
yes | Block |
stylistic/block-closing-brace-newline-after Require a newline or disallow whitespace after the closing brace of blocks. |
yes | Block |
stylistic/block-closing-brace-newline-before Require a newline or disallow whitespace before the closing brace of blocks. |
yes | Block |
stylistic/block-closing-brace-space-after Require a single space or disallow whitespace after the closing brace of blocks. |
no | Block |
stylistic/block-closing-brace-space-before Require a single space or disallow whitespace before the closing brace of blocks. |
yes | Block |
stylistic/block-opening-brace-newline-after Require a newline after the opening brace of blocks. |
yes | Block |
stylistic/block-opening-brace-newline-before Require a newline or disallow whitespace before the opening brace of blocks. |
yes | Block |
stylistic/block-opening-brace-space-after Require a single space or disallow whitespace after the opening brace of blocks. |
yes | Block |
stylistic/block-opening-brace-space-before Require a single space or disallow whitespace before the opening brace of blocks. |
yes | Block |
stylistic/selector-attribute-brackets-space-inside Require a single space or disallow whitespace on the inside of the brackets within attribute selectors. |
yes | Selector |
stylistic/selector-attribute-operator-space-after Require a single space or disallow whitespace after operators within attribute selectors. |
yes | Selector |
stylistic/selector-attribute-operator-space-before Require a single space or disallow whitespace before operators within attribute selectors. |
yes | Selector |
stylistic/selector-combinator-space-after Require a single space or disallow whitespace after the combinators of selectors. |
yes | Selector |
stylistic/selector-combinator-space-before Require a single space or disallow whitespace before the combinators of selectors. |
yes | Selector |
stylistic/selector-descendant-combinator-no-non-space Disallow non-space characters for descendant combinators of selectors. |
yes | Selector |
stylistic/selector-max-empty-lines Limit the number of adjacent empty lines within selectors. |
yes | Selector |
stylistic/selector-pseudo-class-case Specify lowercase or uppercase for pseudo-class selectors. |
yes | Selector |
stylistic/selector-pseudo-class-parentheses-space-inside Require a single space or disallow whitespace on the inside of the parentheses within pseudo-class selectors. |
yes | Selector |
stylistic/selector-pseudo-element-case Specify lowercase or uppercase for pseudo-element selectors. |
yes | Selector |
stylistic/selector-list-comma-newline-after Require a newline or disallow whitespace after the commas of selector lists. |
yes | Selector list |
stylistic/selector-list-comma-newline-before Require a newline or disallow whitespace before the commas of selector lists. |
yes | Selector list |
stylistic/selector-list-comma-space-after Require a single space or disallow whitespace after the commas of selector lists. |
yes | Selector list |
stylistic/selector-list-comma-space-before Require a single space or disallow whitespace before the commas of selector lists. |
yes | Selector list |
stylistic/media-feature-colon-space-after Require a single space or disallow whitespace after the colon in media features. |
yes | Media feature |
stylistic/media-feature-colon-space-before Require a single space or disallow whitespace before the colon in media features. |
yes | Media feature |
stylistic/media-feature-name-case Specify lowercase or uppercase for media feature names. |
yes | Media feature |
stylistic/media-feature-parentheses-space-inside Require a single space or disallow whitespace on the inside of the parentheses within media features. |
yes | Media feature |
stylistic/media-feature-range-operator-space-after Require a single space or disallow whitespace after the range operator in media features. |
yes | Media feature |
stylistic/media-feature-range-operator-space-before Require a single space or disallow whitespace before the range operator in media features. |
yes | Media feature |
stylistic/media-query-list-comma-newline-after Require a newline or disallow whitespace after the commas of media query lists. |
yes | Media query list |
stylistic/media-query-list-comma-newline-before Require a newline or disallow whitespace before the commas of media query lists. |
no | Media query list |
stylistic/media-query-list-comma-space-after Require a single space or disallow whitespace after the commas of media query lists. |
yes | Media query list |
stylistic/media-query-list-comma-space-before Require a single space or disallow whitespace before the commas of media query lists. |
yes | Media query list |
stylistic/at-rule-name-case Specify lowercase or uppercase for at-rules names. |
yes | At-rule |
stylistic/at-rule-name-newline-after Require a newline after at-rule names. |
no | At-rule |
stylistic/at-rule-name-space-after Require a single space after at-rule names. |
yes | At-rule |
stylistic/at-rule-semicolon-newline-after Require a newline after the semicolon of at-rules. |
yes | At-rule |
stylistic/at-rule-semicolon-space-before Require a single space or disallow whitespace before the semicolons of at-rules. |
no | At-rule |
stylistic/indentation Specify indentation. |
yes | General / Sheet |
stylistic/linebreaks Specify unix or windows linebreaks. |
yes | General / Sheet |
stylistic/max-empty-lines Limit the number of adjacent empty lines. |
yes | General / Sheet |
stylistic/max-line-length Limit the length of a line. |
no | General / Sheet |
stylistic/no-empty-first-line Disallow empty first lines. |
yes | General / Sheet |
stylistic/no-eol-whitespace Disallow end-of-line whitespace. |
yes | General / Sheet |
stylistic/no-extra-semicolons Disallow extra semicolons. |
yes | General / Sheet |
stylistic/no-missing-end-of-source-newline Disallow missing end-of-source newlines. |
yes | General / Sheet |
stylistic/unicode-bom Require or disallow Unicode BOM. |
no | General / Sheet |
All contributions are welcome, I will read all pull requests. For now, my focus will be to move all the rules to TS modules, and try to improve them.
The project uses yarn as a package manager. Once installed, clone the repository, and install the dependencies :
yarn reinstall
You will then be able to compile the library :
yarn build
Some examples are available in the examples
folder as a playground zone.