• Stars
    star
    10,971
  • Rank 3,083 (Top 0.07 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A mighty CSS linter that helps you avoid errors and enforce conventions.

Stylelint

npm version Build Status npm downloads

A mighty CSS linter that helps you avoid errors and enforce conventions.

Features

It's mighty as it:

  • has over 100 built-in rules for modern CSS syntax and features
  • supports plugins so you can create your own custom rules
  • automatically fixes problems where possible
  • supports shareable configs that you can create or extend
  • can be customized to your exact needs
  • has 15k unit tests making it robust
  • is trusted by companies worldwide like Google and GitHub

And it can be extended to:

  • extract embedded styles from HTML, Markdown and CSS-in-JS template literals
  • parse CSS-like languages like SCSS, Sass, Less and SugarSS

How it'll help you

It'll help you avoid errors, for example:

  • invalid things, e.g. malformed grid areas
  • valid things that are problematic, e.g. duplicate selectors
  • unknown things, e.g. misspelled property names

And enforce conventions, for example:

  • disallow things, e.g. specific units
  • enforce naming patterns, e.g. for custom properties
  • set limits, e.g. the number of ID selectors
  • specify notations, e.g. for modern color functions

We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

Example output

Example

Guides

Contributors

Stylelint is maintained by volunteers. Without the code contributions from all these fantastic people, Stylelint would not exist. Become a contributor.

Sponsors

Thank you to all our sponsors! Become a sponsor.

Backers

Thank you to all our backers! Become a backer.

Website hosting

Deploys by Netlify

License

The MIT License.

More Repositories

1

stylelint-config-standard

The standard shareable config for Stylelint
JavaScript
1,370
star
2

awesome-stylelint

A list of awesome Stylelint plugins, configs, etc.
497
star
3

stylelint-config-recommended

The recommended shareable config for Stylelint
JavaScript
377
star
4

vscode-stylelint

The official Visual Studio Code extension for Stylelint
TypeScript
310
star
5

eslint-config-stylelint

Stylelint org's shareable config for eslint
JavaScript
59
star
6

stylelint.io

The source of the Stylelint website
JavaScript
28
star
7

stylelint-demo

The online demo on the Stylelint website
TypeScript
14
star
8

jest-preset-stylelint

Common configuration options for Jest in Stylelint environments.
JavaScript
14
star
9

stylelint.github.io

Generated static website (do not push to here)
HTML
6
star
10

create-stylelint

The npm init script for Stylelint
JavaScript
6
star
11

stylelint-rule-tester

An easy way to test stylelint rules.
JavaScript
4
star
12

prettier-config

Stylelint org's shareable config for prettier
JavaScript
4
star
13

stylelint-test-rule-tape

A stylelint rule tester using tape
JavaScript
3
star
14

css-parser

Universal CSS parser
3
star
15

npm-package-json-lint-config

Stylelint org's config for npm-package-json-lint.
JavaScript
3
star
16

remark-preset

Stylelint org's shareable preset for remark
JavaScript
3
star
17

.github

Stylelint org-wide GitHub settings
2
star
18

stylelint-test-rule-node

A Stylelint rule tester using Node.js built-in test runner
JavaScript
2
star
19

changelog-to-github-release-action

GitHub Action to convert CHANGELOG file to GitHub Release
JavaScript
1
star
20

vscode-stylelint-test

A VS Code Test Repo
JavaScript
1
star