Files
react-native-devtools-frontend/node_modules/stylelint/docs/user-guide/get-started.md
T
Tim van der Lippe efb716af67 Update linter packages
- Updates stylelint to 13.8.0
- Updates ESLint to 7.14.0
- Updates @typescript-eslint to 4.9.0

DISABLE_THIRD_PARTY_CHECK=NPM update
R=jacktfranklin@chromium.org

Change-Id: I207e204607ede782710e042c17d6510c7f696905
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2566806
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-01 16:04:40 +00:00

2.4 KiB

Getting started

1. Use npm to install stylelint and its standard configuration:

npm install --save-dev stylelint stylelint-config-standard

2. Create a .stylelintrc.json configuration file in the root of your project:

{
  "extends": "stylelint-config-standard"
}

3. Run stylelint on, for example, all the CSS files in your project:

npx stylelint "**/*.css"

This will lint your CSS for possible errors and stylistic issues.

Customize

Now that you're up and running, you'll likely want to customize stylelint to meet your needs.

Your configuration

You'll want to customize your configuration.

For example, you may want to use the popular:

You'll find more configs and plugins listed in awesome stylelint.

To further customize your stylelint configuration, you can adapt your:

We recommend you add rules that limit language features to your configuration, e.g. unit-allowed-list, selector-class-pattern and selector-max-id. These are powerful rules that you can use to enforce non-stylistic consistency in your code.

Your usage

You don't have to use the Command Line Interface; you can also use the:

There are also integrations for editors, task-runners and others too. Our extension for Visual Studio Code is a popular choice that lets you see violations inline in your editor.