Files
react-native-devtools-frontend/node_modules/stylelint/docs/user-guide/get-started.md
T
Mathias Bynens 79e2cf0633 Add stylelint dependency
This also adds CC-BY-4.0 to the list of accepted licenses.

DISABLE_THIRD_PARTY_CHECK=update dependencies

Bug: chromium:1083142
Change-Id: I8612de2fba52dae32eeb71af79d5aacfde52142b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2220097
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-11 06:20:04 +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-whitelist, 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.