stylelint-config-dabapps
Version:
DabApps stylelint config
53 lines (43 loc) • 1.43 kB
Markdown
# Stylelint Config [](https://travis-ci.com/dabapps/stylelint-config-dabapps)
## About
This repository includes a default stylelint config.
## Install
Install a specific version of the stylelint config with NPM. you can see a full list of versions [here](https://github.com/dabapps/stylelint-config-dabapps/releases).
```
npm i stylelint-config-dabapps@x.x.x --save-dev
```
This will update your package.json automatically.
```
"devDependencies": {
"stylelint-config-dabapps": "x.x.x"
}
```
# Configuration
## NPM Scripts
Add the following script to your frontend tests in the project's package.json:
```
{
"scripts": {
"lint-css": "stylelint 'src/less/**/*.less'"
"lint": npm run lint-css && ...,
}
}
```
## Default Config
Create a `.stylelintrc.json` file in the root directory of the project. For most projects you can just stick the default config in there:
```
{
"extends": "stylelint-config-dabapps"
}
```
## Custom Config
Usually in older projects you might need to disable some [rules](https://stylelint.io/user-guide/rules). You can do this by setting the specific rules you want to disable to `null` (or overriding the value) in the "rules" config:
```
{
"extends": "stylelint-config-dabapps",
"rules": {
"unit-blacklist": null,
"max-nesting-depth": 10,
}
}
```