Socket
Socket
Sign inDemoInstall

stylelint-stylistic

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-stylistic

Plugin for endangered stylelint stylistic rules


Version published
Weekly downloads
18K
decreased by-12.11%
Maintainers
1
Weekly downloads
 
Created
Source

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.

stylelint-stylistic

main branch quality workflow latest tag release workflow NPM

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.

1. Getting started

Requirements

You will need stylelint 15.0.0 or higher as a peer dependency.

Installation

Install the package :

npm install stylelint-stylistic --save-dev

or

yarn add stylelint-stylistic --dev

Usage

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"
  ]
}

2. Rules

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.

RuleAuto-fixableCategory
stylistic/color-hex-case
Specify lowercase or uppercase for hex colors.
yesColor
stylistic/function-comma-newline-after
Require a newline or disallow whitespace after the commas of functions.
yesFunction
stylistic/function-comma-newline-before
Require a newline or disallow whitespace before the commas of functions.
yesFunction
stylistic/function-comma-space-after
Require a single space or disallow whitespace after the commas of functions.
yesFunction
stylistic/function-comma-space-before
Require a single space or disallow whitespace before the commas of functions.
yesFunction
stylistic/function-max-empty-lines
Limit the number of adjacent empty lines within functions.
yesFunction
stylistic/function-parentheses-newline-inside
Require a newline or disallow whitespace on the inside of the parentheses of functions.
yesFunction
stylistic/function-parentheses-space-inside
Require a single space or disallow whitespace on the inside of the parentheses of functions.
yesFunction
stylistic/function-whitespace-after
Require or disallow whitespace after functions.
yesFunction
stylistic/number-leading-zero
Require or disallow a leading zero for fractional numbers less than 1.
yesNumber
stylistic/number-no-trailing-zeros
Disallow trailing zeros in numbers.
yesNumber
stylistic/string-quotes
Specify single or double quotes around strings.
yesString
stylistic/unit-case
Specify lowercase or uppercase for units.
yesUnit
stylistic/value-list-comma-newline-after
Require a newline or disallow whitespace after the commas of value lists.
yesValue list
stylistic/value-list-comma-newline-before
Require a newline or disallow whitespace before the commas of value lists.
noValue list
stylistic/value-list-comma-space-after
Require a single space or disallow whitespace after the commas of value lists.
yesValue list
stylistic/value-list-comma-space-before
Require a single space or disallow whitespace before the commas of value lists.
yesValue list
stylistic/value-list-max-empty-lines
Limit the number of adjacent empty lines within value lists.
yesValue list
stylistic/property-case
Specify lowercase or uppercase for properties.
yesProperty
stylistic/declaration-bang-space-after
Require a single space or disallow whitespace after the bang of declarations.
yesDeclaration
stylistic/declaration-bang-space-before
Require a single space or disallow whitespace before the bang of declarations.
yesDeclaration
stylistic/declaration-colon-newline-after
Require a newline or disallow whitespace after the colon of declarations.
yesDeclaration
stylistic/declaration-colon-space-after
Require a single space or disallow whitespace after the colon of declarations.
yesDeclaration
stylistic/declaration-colon-space-before
Require a single space or disallow whitespace before the colon of declarations.
yesDeclaration
stylistic/declaration-block-semicolon-newline-after
Require a newline or disallow whitespace after the semicolons of declaration blocks.
yesDeclaration block
stylistic/declaration-block-semicolon-newline-before
Require a newline or disallow whitespace before the semicolons of declaration blocks.
noDeclaration block
stylistic/declaration-block-semicolon-space-after
Require a single space or disallow whitespace after the semicolons of declaration blocks.
yesDeclaration block
stylistic/declaration-block-semicolon-space-before
Require a single space or disallow whitespace before the semicolons of declaration blocks.
yesDeclaration block
stylistic/declaration-block-trailing-semicolon
Require or disallow a trailing semicolon within declaration blocks.
yesDeclaration block
stylistic/block-closing-brace-empty-line-before
Require or disallow an empty line before the closing brace of blocks.
yesBlock
stylistic/block-closing-brace-newline-after
Require a newline or disallow whitespace after the closing brace of blocks.
yesBlock
stylistic/block-closing-brace-newline-before
Require a newline or disallow whitespace before the closing brace of blocks.
yesBlock
stylistic/block-closing-brace-space-after
Require a single space or disallow whitespace after the closing brace of blocks.
noBlock
stylistic/block-closing-brace-space-before
Require a single space or disallow whitespace before the closing brace of blocks.
yesBlock
stylistic/block-opening-brace-newline-after
Require a newline after the opening brace of blocks.
yesBlock
stylistic/block-opening-brace-newline-before
Require a newline or disallow whitespace before the opening brace of blocks.
yesBlock
stylistic/block-opening-brace-space-after
Require a single space or disallow whitespace after the opening brace of blocks.
yesBlock
stylistic/block-opening-brace-space-before
Require a single space or disallow whitespace before the opening brace of blocks.
yesBlock
stylistic/selector-attribute-brackets-space-inside
Require a single space or disallow whitespace on the inside of the brackets within attribute selectors.
yesSelector
stylistic/selector-attribute-operator-space-after
Require a single space or disallow whitespace after operators within attribute selectors.
yesSelector
stylistic/selector-attribute-operator-space-before
Require a single space or disallow whitespace before operators within attribute selectors.
yesSelector
stylistic/selector-combinator-space-after
Require a single space or disallow whitespace after the combinators of selectors.
yesSelector
stylistic/selector-combinator-space-before
Require a single space or disallow whitespace before the combinators of selectors.
yesSelector
stylistic/selector-descendant-combinator-no-non-space
Disallow non-space characters for descendant combinators of selectors.
yesSelector
stylistic/selector-max-empty-lines
Limit the number of adjacent empty lines within selectors.
yesSelector
stylistic/selector-pseudo-class-case
Specify lowercase or uppercase for pseudo-class selectors.
yesSelector
stylistic/selector-pseudo-class-parentheses-space-inside
Require a single space or disallow whitespace on the inside of the parentheses within pseudo-class selectors.
yesSelector
stylistic/selector-pseudo-element-case
Specify lowercase or uppercase for pseudo-element selectors.
yesSelector
stylistic/selector-list-comma-newline-after
Require a newline or disallow whitespace after the commas of selector lists.
yesSelector list
stylistic/selector-list-comma-newline-before
Require a newline or disallow whitespace before the commas of selector lists.
yesSelector list
stylistic/selector-list-comma-space-after
Require a single space or disallow whitespace after the commas of selector lists.
yesSelector list
stylistic/selector-list-comma-space-before
Require a single space or disallow whitespace before the commas of selector lists.
yesSelector list
stylistic/media-feature-colon-space-after
Require a single space or disallow whitespace after the colon in media features.
yesMedia feature
stylistic/media-feature-colon-space-before
Require a single space or disallow whitespace before the colon in media features.
yesMedia feature
stylistic/media-feature-name-case
Specify lowercase or uppercase for media feature names.
yesMedia feature
stylistic/media-feature-parentheses-space-inside
Require a single space or disallow whitespace on the inside of the parentheses within media features.
yesMedia feature
stylistic/media-feature-range-operator-space-after
Require a single space or disallow whitespace after the range operator in media features.
yesMedia feature
stylistic/media-feature-range-operator-space-before
Require a single space or disallow whitespace before the range operator in media features.
yesMedia feature
stylistic/media-query-list-comma-newline-after
Require a newline or disallow whitespace after the commas of media query lists.
yesMedia query list
stylistic/media-query-list-comma-newline-before
Require a newline or disallow whitespace before the commas of media query lists.
noMedia query list
stylistic/media-query-list-comma-space-after
Require a single space or disallow whitespace after the commas of media query lists.
yesMedia query list
stylistic/media-query-list-comma-space-before
Require a single space or disallow whitespace before the commas of media query lists.
yesMedia query list
stylistic/at-rule-name-case
Specify lowercase or uppercase for at-rules names.
yesAt-rule
stylistic/at-rule-name-newline-after
Require a newline after at-rule names.
noAt-rule
stylistic/at-rule-name-space-after
Require a single space after at-rule names.
yesAt-rule
stylistic/at-rule-semicolon-newline-after
Require a newline after the semicolon of at-rules.
yesAt-rule
stylistic/at-rule-semicolon-space-before
Require a single space or disallow whitespace before the semicolons of at-rules.
noAt-rule
stylistic/indentation
Specify indentation.
yesGeneral / Sheet
stylistic/linebreaks
Specify unix or windows linebreaks.
yesGeneral / Sheet
stylistic/max-empty-lines
Limit the number of adjacent empty lines.
yesGeneral / Sheet
stylistic/max-line-length
Limit the length of a line.
noGeneral / Sheet
stylistic/no-empty-first-line
Disallow empty first lines.
yesGeneral / Sheet
stylistic/no-eol-whitespace
Disallow end-of-line whitespace.
yesGeneral / Sheet
stylistic/no-extra-semicolons
Disallow extra semicolons.
yesGeneral / Sheet
stylistic/no-missing-end-of-source-newline
Disallow missing end-of-source newlines.
yesGeneral / Sheet
stylistic/unicode-bom
Require or disallow Unicode BOM.
noGeneral / Sheet

3. Contribution

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.

Keywords

FAQs

Package last updated on 18 Dec 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc