Code Monkey home page Code Monkey logo

Stylelint Stylistic

License: MIT Test Status NPM version Vulnerabilities count

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

About and purpose

Stylelint has removed 76 rules that enforce stylistic conventions. This project returns these rules to keep styles consistent with your codeguide. In addition, new rules may be added in the future.

Installation and usage

Add @stylistic/stylelint-plugin and stylelint itself to your project:

npm add -D stylelint @stylistic/stylelint-plugin

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

{
	"plugins": [
		"@stylistic/stylelint-plugin"
	],
	"rules": {
		// syntax rules from stylelint:
		"color-function-notation": "modern",
		"selector-max-compound-selectors": 2,

		// stylistic rules from @stylistic/stylelint-plugin:
		"@stylistic/color-hex-case": "lower",
		"@stylistic/number-leading-zero": "always",
		"@stylistic/unit-case": "lower"
	}
}

To avoid listing a lot of rules, you can use @stylistic/stylelint-config, which returns the stylistic rules removed in stylelint-config-standard and stylelint-config-recommended.


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

Need more?

ESLint deprecates stylistic rules, too. But you can continue to use them thanks to ESLint Stylistic.

Important documents

stylelint-stylistic's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.