diff options
author | Sebastian <sebasjm@gmail.com> | 2021-08-23 16:46:06 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-08-23 16:48:30 -0300 |
commit | 38acabfa6089ab8ac469c12b5f55022fb96935e5 (patch) | |
tree | 453dbf70000cc5e338b06201af1eaca8343f8f73 /@linaria/docs/LINTING.md | |
parent | f26125e039143b92dc0d84e7775f508ab0cdcaa8 (diff) | |
download | node-vendor-38acabfa6089ab8ac469c12b5f55022fb96935e5.tar.gz node-vendor-38acabfa6089ab8ac469c12b5f55022fb96935e5.tar.bz2 node-vendor-38acabfa6089ab8ac469c12b5f55022fb96935e5.zip |
Diffstat (limited to '@linaria/docs/LINTING.md')
-rw-r--r-- | @linaria/docs/LINTING.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/@linaria/docs/LINTING.md b/@linaria/docs/LINTING.md new file mode 100644 index 0000000..542d93e --- /dev/null +++ b/@linaria/docs/LINTING.md @@ -0,0 +1,44 @@ +# Linting + +## stylelint + +For linting styles with [stylelint](https://stylelint.io/), we provide our custom config tailored for linaria - `@linaria/stylelint`. + +### Installation + +You need to install `stylelint` and optionally your favorite config (such as `stylelint-config-recommended`) in your project: + +```bash +yarn add --dev stylelint stylelint-config-recommended +``` + +### Configuring stylelint + +All you need to do is to set your config to extend from `@linaria/stylelint`. + +Here's the example `.stylelintrc` configuration file: + +```json +{ + "extends": [ + "stylelint-config-recommended", + "@linaria/stylelint" + ] +} +``` + +Please refer to the [official stylelint documentation](https://stylelint.io/user-guide/configuration/) for more info about configuration. + +The preprocessor will use the [options from the configuration file](/docs/CONFIGURATION.md) for processing your files. + +### Linting your files + +Add the following to your `package.json` scripts: + +```json +"lint:css": "stylelint src/**/*.js" +``` + +Now, you can run `yarn lint:css` to lint the CSS in your JS files with stylelint. + +For more information refer to [stylelint documentation](https://stylelint.io/user-guide/cli/). |