1 | # Stylelint
|
2 |
|
3 | [![npm version](https://img.shields.io/npm/v/stylelint)](https://www.npmjs.com/package/stylelint)
|
4 | [![Build Status](https://github.com/stylelint/stylelint/workflows/Testing/badge.svg)](https://github.com/stylelint/stylelint/actions/workflows/testing.yml?query=branch%3Amain)
|
5 | [![npm downloads](https://img.shields.io/npm/dm/stylelint)](https://npmcharts.com/compare/stylelint?minimal=true)
|
6 |
|
7 | A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
|
8 |
|
9 | ## Features
|
10 |
|
11 | It's mighty as it:
|
12 |
|
13 | - has over **170 built-in rules** for modern CSS syntax and features
|
14 | - supports **plugins** so you can create your own rules
|
15 | - automatically **fixes problems** where possible
|
16 | - is **well tested** with over 15000 unit tests
|
17 | - supports **shareable configs** that you can extend or create
|
18 | - is **unopinionated** so that you can customize it to your exact needs
|
19 | - **complements pretty printers** like Prettier
|
20 | - has a **growing community** and is used by Google, GitHub and WordPress
|
21 |
|
22 | And can be extended to:
|
23 |
|
24 | - parse **CSS-like syntaxes** like SCSS, Sass, Less and SugarSS
|
25 | - extract **embedded styles** from HTML, Markdown and CSS-in-JS object & template literals
|
26 |
|
27 | ## How it'll help you
|
28 |
|
29 | It'll help you **avoid errors**, for example styles that are:
|
30 |
|
31 | - invalid, e.g. malformed hex colors and named grid areas
|
32 | - valid but with unintended consequences, e.g. duplicated selectors and overridden properties
|
33 |
|
34 | And **enforce conventions**, for example:
|
35 |
|
36 | - what units, functions, at-rules etc are allowed
|
37 | - consistent patterns for selector names, at-rule names, custom properties etc
|
38 | - maximum specificity or maximum quantity of each selector type
|
39 | - your perferred notation for color functions, font weight etc
|
40 |
|
41 | There are also rules for enforcing stylistic consistency, but we now recommend you use Stylelint alongside a pretty printer like Prettier. Linters and pretty printers are complementary tools that work together.
|
42 |
|
43 | ## Example output
|
44 |
|
45 | ![Example](example.png)
|
46 |
|
47 | ## Guides
|
48 |
|
49 | - User guide
|
50 | - [Getting started](docs/user-guide/get-started.md)
|
51 | - [Configuration](docs/user-guide/configure.md)
|
52 | - Rules
|
53 | - [List of rules](docs/user-guide/rules/list.md)
|
54 | - [About rules](docs/user-guide/rules/about.md)
|
55 | - [Combining rules](docs/user-guide/rules/combine.md)
|
56 | - [Using regex in rules](docs/user-guide/rules/regex.md)
|
57 | - Usage
|
58 | - [CLI](docs/user-guide/usage/cli.md)
|
59 | - [Node.js API](docs/user-guide/usage/node-api.md)
|
60 | - [PostCSS plugin](docs/user-guide/usage/postcss-plugin.md)
|
61 | - [Shared options](docs/user-guide/usage/options.md)
|
62 | - Integrations
|
63 | - [Editor integrations](docs/user-guide/integrations/editor.md)
|
64 | - [Task runner integrations](docs/user-guide/integrations/task-runner.md)
|
65 | - [Other integrations](docs/user-guide/integrations/other.md)
|
66 | - [Ignoring code](docs/user-guide/ignore-code.md)
|
67 | - [Errors & warnings](docs/user-guide/errors.md)
|
68 | - Developer guide
|
69 | - [Working on rules](docs/developer-guide/rules.md)
|
70 | - [Writing plugins](docs/developer-guide/plugins.md)
|
71 | - [Writing custom syntaxes](docs/developer-guide/syntaxes.md)
|
72 | - [Writing custom formatters](docs/developer-guide/formatters.md)
|
73 | - [Writing system tests](docs/developer-guide/system-tests.md)
|
74 | - [Writing processors](docs/developer-guide/processors.md)
|
75 | - Migration guide
|
76 | - [Migrating to 14.0.0](docs/migration-guide/to-14.md)
|
77 | - Maintainer guide
|
78 | - [Managing issues](docs/maintainer-guide/issues.md)
|
79 | - [Managing pull requests](docs/maintainer-guide/pull-requests.md)
|
80 | - [Performing releases](docs/maintainer-guide/releases.md)
|
81 | - About
|
82 | - [Vision](docs/about/vision.md)
|
83 | - [Linting](docs/about/linting.md)
|
84 | - [Semantic versioning](docs/about/semantic-versioning.md)
|
85 |
|
86 | ## Contributors
|
87 |
|
88 | Stylelint is maintained by volunteers. Without the code contributions from [all these fantastic people](https://github.com/stylelint/stylelint/graphs/contributors), Stylelint would not exist. [Become a contributor](CONTRIBUTING.md).
|
89 |
|
90 | ### Sponsors
|
91 |
|
92 | <object data="https://opencollective.com/stylelint/sponsors.svg?width=420&button=false" type="image/svg+xml">
|
93 | <img src="https://opencollective.com/stylelint/sponsors.svg?width=840&button=false" />
|
94 | </object>
|
95 |
|
96 | Thank you to all our sponsors! [Become a sponsor](https://opencollective.com/stylelint).
|
97 |
|
98 | ### Backers
|
99 |
|
100 | <object data="https://opencollective.com/stylelint/backers.svg?width=420&avatarHeight=48&button=false" type="image/svg+xml">
|
101 | <img src="https://opencollective.com/stylelint/backers.svg?width=840&avatarHeight=48&button=false" />
|
102 | </object>
|
103 |
|
104 | Thank you to all our backers! [Become a backer](https://opencollective.com/stylelint).
|
105 |
|
106 | ### Website hosting
|
107 |
|
108 | [![Deploys by Netlify](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com)
|
109 |
|
110 | ## License
|
111 |
|
112 | [The MIT License](https://raw.githubusercontent.com/stylelint/stylelint/main/LICENSE).
|