Welcome to @jahia/stylelint-config
Provide Jahia Stylelint shareable config to lint your style.
We extend this configurations :
We use this plugins :
- stylelint-order to check the order of content and properties within declaration blocks
- stylelint-scss to check scss synthax
Install
Add stylelint and this package to the devDependencies of the project.
This can be accomplished using yarn with the following command:
yarn add -D stylelint @jahia/stylelint-config
or using npm with the following one:
npm i -D stylelint @jahia/eslint-config
Configure
Create a file named .stylelintrc.json as a sibling of your package.json, with the following content:
```json
{
"extends": "@jahia/stylelint-config"
}
```
Update the scripts in your package.json to something like:
```json
{
"build": "yarn stylelint && yarn webpack",
"stylelint": "stylelint './src/**/*.scss'",
"stylelint:fix": "stylelint './src/**/*.scss' --fix ."
}
```
Additionally you may want to add a file .stylelintignore as a sibling of your package.json, with the following content:
node node_modules target build
Also depending on your need your can override some rules in the .stylelintrc.json file by redefining them.
IDE integrate stylelint configuration or has a stylelint plugin to do it, do not forget to activate it
- For IntelliJ : Activating and configuring Stylelint
- For Atom : Install linter-stylelint
- For VS Code : Install vscode-stylelint
Usage
If you added the scripts in your package.json, you can do:
yarn stylelint
or with npm:
npm run stylelint
Author
Jahia
- Website: https://www.jahia.com
- Twitter: @Jahia
- Github: @Jahia
Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ️ if this project helped you!
License
Copyright 2019 Jahia.
This project is JAHIA'S DUAL LICENSING licensed.
This README was generated with by readme-md-generator