.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / README.md
1 # stylelint
2
3 [![NPM version](https://img.shields.io/npm/v/stylelint.svg)](https://www.npmjs.org/package/stylelint) [![Build Status](https://travis-ci.org/stylelint/stylelint.svg?branch=master)](https://travis-ci.org/stylelint/stylelint) [![Build status](https://ci.appveyor.com/api/projects/status/wwajr0886e00g8je/branch/master?svg=true)](https://ci.appveyor.com/project/stylelint/stylelint/branch/master) [![NPM Downloads](https://img.shields.io/npm/dm/stylelint.svg)](https://www.npmjs.org/package/stylelint) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9282518)](https://www.bountysource.com/trackers/9282518-stylelint?utm_source=9282518&utm_medium=shield&utm_campaign=TRACKER_BADGE)
4
5 A mighty, modern CSS linter and fixer that helps you avoid errors and enforce consistent conventions in your stylesheets.
6
7 ## Features
8
9 -   **Over one hundred and sixty built-in rules.** Geared towards standard CSS syntax, these can:
10     -   **Catch possible errors:** e.g., invalid standard CSS syntax, duplicates, and overrides.
11     -   **Limit language features:** e.g.:
12         -   Disallow specific units, properties, functions, and at-rules.
13         -   Limit the specificity and quantity of selectors.
14         -   Enforce patterns for selectors and custom properties.
15     -   **Enforce stylistic conventions:** e.g., whitespace, case, notation, and quotes.
16 -   **Understands the latest CSS syntax:** Including custom properties, `calc()` and level 4 selectors.
17 -   **Completely unopinionated:** Only enable the rules you want, and configure them with options that tailor the linter to your needs.
18 -   **Support for plugins:** It's easy to create your own rules and add them to the linter, or make use of plugins written by the community.
19 -   **Automatically fixes some stylistic violations:** Save time by having stylelint fix your code with this *experimental* feature.
20 -   **Shareable configs:** If you don't want to craft your own config, you can extend a shareable config. Or you can craft your own config and share with your team and/or the community.
21 -   **Works with embedded styles:** Within `<style>` tags (used by Vue and Web Components) and Markdown code fences.
22 -   **Parses *CSS-like* syntaxes:** The linter is powered by [PostCSS](https://github.com/postcss/postcss), so it can be configured and extended to understand any syntax that PostCSS can parse, including SCSS, [SugarSS](https://github.com/postcss/sugarss), and Less.
23 -   **Options validator:** So that you can be confident that your config is valid.
24 -   **Well tested:** Over ten thousand tests cover the internals and rules.
25 -   **Growing community**: Used by [Facebook](https://code.facebook.com/posts/879890885467584/improving-css-quality-at-facebook-and-beyond/), [GitHub](https://github.com/primer/stylelint-config-primer), [Wikimedia](https://github.com/wikimedia/stylelint-config-wikimedia), [GSA](https://github.com/18F/stylelint-rules/), and [WordPress](https://github.com/ntwb/stylelint-config-wordpress/) among others.
26
27 ## Example output
28
29 ![Example](https://github.com/stylelint/stylelint/raw/master/example.png?raw=true)
30
31 ## Getting started
32
33 With stylelint, it's easy to start linting your CSS:
34
35 1.  Decide how you want to use stylelint:
36     -   [via the stylelint CLI](docs/user-guide/cli.md)
37     -   [via a plugin for your text editor](docs/user-guide/complementary-tools.md#editor-plugins) (atom, vscode etc)
38     -   [via a plugin for your build tool](docs/user-guide/complementary-tools.md#build-tool-plugins) (webpack, gulp etc)
39     -   [via the stylelint Node API](docs/user-guide/node-api.md)
40     -   [via the stylelint PostCSS plugin](docs/user-guide/postcss-plugin.md)
41 2.  Create your [configuration object](docs/user-guide/configuration.md) by either extending a shared config or crafting your own:
42     -   To extend a shared config, we suggest using either [`stylelint-config-standard`](https://github.com/stylelint/stylelint-config-standard) or [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended). We update the configs with each new release of stylelint, so it's easy to stay up to date. Both configs are geared towards standard CSS syntax. If you use non-standard syntax (like `@if` etc.) then you might want to use a community config designed for that syntax e.g. [`stylelint-config-recommended-scss`](https://github.com/kristerkari/stylelint-config-recommended-scss). The recommended config turns on just the [possible error](docs/user-guide/rules.md#possible-errors) rules. The standard config builds on top of the recommended config by additionally turning on over 60 of stylelint's [stylistic rules](docs/user-guide/rules.md#stylistic-issues) with sensible defaults. You can always override specific rules after extending either config. When using either config, you'll likely want to add (and configure to your specific needs) some of the rules that [limit language features](docs/user-guide/rules.md#limit-language-features). Alternately, you can [search for another](https://www.npmjs.com/browse/keyword/stylelint-config) community config and [extend](docs/user-guide/configuration.md#extends) that instead.
43     -   To craft your own config, first [learn about how rules are named and how they work together](docs/user-guide/about-rules.md), then either:
44         -   Start small and only learn about [the rules](docs/user-guide/rules.md) you want to turn on and enforce. *All of the rules are off by default*, and so you can start small, growing your config over time as you have a chance to explore more of the rules.
45         -   Or copy-paste [this example configuration](docs/user-guide/example-config.md), which lists all of stylelint's rules and their primary options. Then you can edit the options of each rule to your liking, and remove (or turn off with `null`) the rules that you don't care to enforce.
46 3.  Lint!
47
48 ## Guides
49
50 You'll find more detailed information on using stylelint and tailoring it to your needs in our guides:
51
52 -   [User guide](docs/user-guide.md) - Usage, configuration, FAQ and complementary tools.
53 -   [Developer guide](docs/developer-guide.md) - Contributing to stylelint and writing your own plugins & formatters.
54
55 ## Need help?
56
57 If you're looking for help or have a support question, then check out our [FAQ](docs/user-guide/faq.md) first. If the answer to your problem isn't there, then go to [stackoverflow](https://stackoverflow.com/questions/tagged/stylelint). stackoverflow is a huge Question and Answer community, and tagging your post there with "stylelint" will catch the stylelint team's attention.
58
59 If you think you've found a bug or if you have feature request, then create a [new GitHub issue](https://github.com/stylelint/stylelint/issues/new). Be sure to follow the issue template, answering each question, as this helps us greatly in understanding your problem or request.
60
61 Upgrading? Please read our [CHANGELOG](CHANGELOG.md) to learn what changes to expect in the latest version, whether that's new features, bug fixes, renamed rules, or whatever else.
62
63 ## Help out
64
65 There is always a lot of work to do, and already well over 150 rules to maintain. So please help out in any way that you can:
66
67 -   Chime in on any open [issue](https://github.com/stylelint/stylelint/issues) or [pull request](https://github.com/stylelint/stylelint/pulls).
68 -   Create, enhance, and debug rules (see our guide to ["Working on rules"](docs/developer-guide/rules.md)).
69 -   Improve [documentation](docs/).
70 -   Add new tests to *absolutely anything*.
71 -   Work on [improving performance of rules](docs/developer-guide/rules.md#improving-the-performance-of-a-new-or-an-existing-rule).
72 -   Open new issues about your ideas for making stylelint better, and pull requests to show us how your idea works.
73 -   Create or contribute to ecosystem tools, like the plugins for [Atom](https://github.com/AtomLinter/linter-stylelint) and [Sublime Text](https://github.com/kungfusheep/SublimeLinter-contrib-stylelint).
74
75 Interested in the project vision? Please read our [VISION document](VISION.md).
76
77 ## Semantic Versioning Policy
78
79 stylelint follows [semantic versioning](http://semver.org). However, due to the nature of stylelint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, based on ESLint's [semantic versioning policy](https://github.com/eslint/eslint#semantic-versioning-policy) we've defined the following semantic versioning policy for stylelint:
80
81 -   Patch release (intended to not break your lint build)
82     -   A bug fix in a rule that results in stylelint reporting fewer errors.
83     -   A bug fix to the CLI or core (including formatters).
84     -   Improvements to documentation.
85     -   Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
86     -   Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
87
88 -   Minor release (might break your lint build)
89     -   A bug fix in a rule that results in stylelint reporting more errors.
90     -   A new rule is created.
91     -   A new option to an existing rule that does not result in stylelint reporting more errors by default.
92     -   An existing rule is deprecated.
93     -   A new CLI capability is created.
94     -   New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.).
95     -   A new formatter is created.
96
97 -   Major release (likely to break your lint build)
98     -   A change in the documented behaviour of an existing rule results in stylelint reporting more errors by default.
99     -   An existing rule is removed.
100     -   An existing formatter is removed.
101     -   Part of the public API is removed or changed in an incompatible way.
102
103 According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"stylelint": "~7.2.0"` to guarantee the results of your builds.
104
105 [License](https://raw.githubusercontent.com/stylelint/stylelint/master/LICENSE)