Default stylelint configuration for all werk85 projects
yarn add stylelint-config-werk85 stylelint -D
Create a .stylelintrc.json
file in your project root and add the following content
{
"extends": "stylelint-config-werk85"
}
{
"extends": [
"stylelint-config-werk85",
"stylelint-config-werk85/scss"
]
}
It is recommended to install the vscode-styled-components
Extension for having syntax highlighting and IntelliSense for styled-components as well.
{
"extends": [
"stylelint-config-werk85",
"stylelint-config-werk85/styled"
]
}
Following additions to your project are recommended
For convenience you can add the following npm scripts to your package.json
{
"scripts": {
"lint:styles": "stylelint src/**/*.{scss,tsx}",
"lint:styles:fix": "yarn lint:styles --fix",
}
}
To ensure usage of recommended extension you can add following to .vscode/extensions.json
within your project.
{
"recommendations": [
"styled-components.vscode-styled-components",
"stylelint.vscode-stylelint"
]
}
Make sure to have in your or the workspace VSCode settings the following defined:
"stylelint.validate": [
"css",
"scss"
]