UNPKG

2.12 kBMarkdownView Raw
1# stylelint-config-prettier
2
3> **Note**
4> As of Stylelint v15 [all style-related rules have been deprecated](https://stylelint.io/migration-guide/to-15#deprecated-stylistic-rules). If you are using v15 or higher and are not making use of these deprecated rules, [this plugin is no longer necessary](https://stylelint.io/migration-guide/to-15#:~:text=Additionally%2C%20you%20may%20no%20longer%20need%20to%20extend%20Prettier%27s%20Stylelint%20config).
5
6[![NPM version][npm-img]][npm-url] [![Downloads][downloads-img]][npm-url]
7
8Turns off all rules that are unnecessary or might conflict with Prettier. This lets you use your favorite shareable config without letting its stylistic choices get in the way when using Prettier.
9
10## Installation
11
12Install `stylelint-config-prettier`:
13
14```
15npm install --save-dev stylelint-config-prettier
16```
17
18Then, append `stylelint-config-prettier` to the [`extends` array](https://stylelint.io/user-guide/configuration/#extends) in your `.stylelintrc.*` file. Make sure to put it **last,** so it will override other configs.
19
20```js
21{
22 "extends": [
23 // other configs ...
24 "stylelint-config-prettier"
25 ]
26}
27```
28
29## CLI helper tool
30
31`stylelint-config-prettier` is shipped with a little CLI tool to help you check if your configuration contains any rules that are in conflict with Prettier.
32
33In order to execute the CLI tool, first add a script for it to `package.json`:
34
35```json
36{
37 "scripts": {
38 "stylelint-check": "stylelint-config-prettier-check"
39 }
40}
41```
42
43Then run `npm run stylelint-check`.
44
45## Attribution
46
47- Inspired by [`eslint-config-prettier`](https://npm.im/eslint-config-prettier).
48- CLI helper inspired by [`tslint-config-prettier`](https://github.com/alexjoverm/tslint-config-prettier).
49- Original disabled ruleset copied from [`prettier-stylelint`](https://npm.im/prettier-stylelint).
50
51----
52
53[MIT](license)
54
55[downloads-img]: https://img.shields.io/npm/dm/stylelint-config-prettier.svg?style=flat-square
56[npm-img]: https://img.shields.io/npm/v/stylelint-config-prettier.svg?style=flat-square
57[npm-url]: https://npmjs.org/package/stylelint-config-prettier