Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # stylelint-config-eyeo | 1 # stylelint-config-eyeo |
2 | 2 |
3 A [Stylelint](https://stylelint.io) configuration that checks for compliance | 3 A [Stylelint](https://stylelint.io) configuration that checks for compliance |
4 with the [Adblock Plus coding style guide](https://adblockplus.org/coding-style# html-css) | 4 with the [Adblock Plus coding style guide](https://adblockplus.org/coding-style# html-css) |
5 which is used for all eyeo projects. | 5 which is used for all eyeo projects. |
6 | 6 |
7 ## Installation | 7 ## Installation |
8 | 8 |
9 npm install -g stylelint | 9 npm install -g stylelint |
10 | 10 |
11 This command requires administrator privileges so you might need to use `sudo`. | 11 This command requires administrator privileges so you might need to use `sudo`. |
12 | 12 |
13 Next, either install stylelint-config-eyeo within your project. For example: | 13 Next, either install stylelint-config-eyeo within your project. For example: |
14 | 14 |
15 npm install --save-dev stylelint-config-eyeo | 15 npm install --save-dev stylelint-config-eyeo |
Thomas Greiner
2017/09/15 16:58:29
Is this worth mentioning? Considering that there a
ire
2017/09/18 07:36:20
I was trying to follow the style that was used in
Thomas Greiner
2017/11/14 13:18:31
Sounds reasonable.
| |
16 | 16 |
17 Or, install stylelint-config-eyeo globally. For example: | 17 Or, install stylelint-config-eyeo globally. For example: |
18 | 18 |
19 npm install --g stylelint-config-eyeo | 19 npm install -g stylelint-config-eyeo |
Thomas Greiner
2017/09/15 16:58:29
Detail: This should be either `-g` or `--global`.
ire
2017/09/18 07:36:20
Good catch, I meant `-g`. Done.
| |
20 | 20 |
21 ## Usage | 21 ## Usage |
22 | 22 |
23 To lint a CSS (or CSS-like, e.g. SCSS, SugarCSS, Less) file using Stylelint | 23 To lint a CSS (or CSS-like, e.g. SCSS, SugarCSS, Less) file using Stylelint |
24 you run the `stylelint` command with the file as an argument. For example: | 24 you run the `stylelint` command with the file as an argument. For example: |
25 | 25 |
26 stylelint example.css | 26 stylelint example.css |
27 | 27 |
28 For advanced usage see `stylelint --help`. | 28 For advanced usage see `stylelint --help`. |
29 | 29 |
30 In order to use stylelint-config-eyeo, your project's Stylelint configuration | 30 In order to use stylelint-config-eyeo, your project's Stylelint configuration |
31 should extend from it. A minimal example looks like this: | 31 should extend from it. A minimal example looks like this: |
32 | 32 |
33 { | 33 { |
34 "extends": "stylelint-config-eyeo" | 34 "extends": "stylelint-config-eyeo" |
35 } | 35 } |
36 | 36 |
37 If you've globally installed stylelint-config-eyeo using the `-g` flag, then | 37 If you've globally installed stylelint-config-eyeo using the `-g` flag, then |
38 you'll need to use the absolute path to stylelint-config-eyeo in your config. | 38 you'll need to use the absolute path to stylelint-config-eyeo in your config. |
39 | 39 |
40 { | 40 { |
41 "extends": "/absolute/path/to/stylelint-config-eyeo" | 41 "extends": "/absolute/path/to/stylelint-config-eyeo" |
42 } | 42 } |
43 | 43 |
44 For projects without a Stylelint configuration you can create your own | 44 For projects without a Stylelint configuration you can create your own |
45 personal configuration in `~/.stylelintrc.json`. | 45 personal configuration in `~/.stylelintrc.json`. |
LEFT | RIGHT |