Skip to content

Webgem/stylelint-codeguide

 
 

Repository files navigation

stylelint-codeguide

License: MIT Test Status NPM version Vulnerabilities count

An updatable collection of stylistic rules for Stylelint (in plugin form).

About

This plugin was based on the stylelint-scss plugin with the replacement of its rules with the removed rules of stylelint itself, and a few other changes.

Purpose

Stylelint has deprecated 76 of the rules that enforce stylistic conventions.

stylelint-codeguide returns these rules to keep styles consistent with your codeguide. In addition, new rules may be added in the future.

The plugin follows Stylelint's guidelines.

Installation and usage

Add stylelint-codeguide and stylelint itself to your project:

npm install --save-dev stylelint stylelint-codeguide

Create the .stylelintrc config file (or open the existing one), add stylelint-codeguide to the plugins array and the rules you need to the rules list. All rules from stylelint-codeguide need to be namespaced with codeguide/:

{
	"plugins": [
		"stylelint-codeguide"
	],
	"rules": {
		// syntax rules from stylelint:
		"color-function-notation": "modern",
		"selector-max-compound-selectors": 2,
		// ...
		// stylistic rules from stylelint-codeguide:
		"codeguide/color-hex-case": "lower",
		"codeguide/number-leading-zero": "always",
		"codeguide/unit-case": "lower"
	}
}

Please refer to Stylelint docs for detailed info on using this linter.

Important documents

About

A collection of stylistic rules for Stylelintin in a form of a plugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%