stylelint-config-jimdo v1.0.1
stylelint-config-jimdo
The standard shareable config for stylelint use inside Jimdo.
This config aims to enforce a common set of rules for writing CSS in all our Jimdo applications. It has rules that cover standard css, scss and also css modules. Like any other stylelint config you are free to extend this config for your application, but we hope that you don't need to, and instead we can try to improve this config and make it the "standard" for all our applications.
To see the rules that this config uses, please read the config itself.
Installation
yarn install --dev @jimdo/stylelint-config-jimdo
Usage
After you've installed stylelint-config-standard
locally within your project, just set your stylelint
config to:
{
"extends": "@jimdo/stylelint-config-jimdo"
}
Fixing linting issues
Stylelint can auto-fix a lot of the issues it reports. To set this up you can have a stylelint:fix
command in the scripts
section of your package.json, for example like this:
"stylelint": "stylelint 'src/**/*.scss'",
"stylelint:fix": "stylelint 'src/**/*.scss' --fix"
After that you can run yarn stylelint:fix
to have Stylelint fix all the issues it can fix.
Extending the config
If you really have to have your own rules, then simply add a "rules"
key to your config, then add your overrides and additions there.
For example, to change the at-rule-no-unknown
rule to use its ignoreAtRules
option, change the indentation
to tabs, turn off the number-leading-zero
rule,and add the unit-whitelist
rule:
{
"extends": "@jimdo/stylelint-config-jimdo",
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["extends", "ignores"]
}
],
"indentation": "tab",
"number-leading-zero": null,
"unit-whitelist": ["em", "rem", "s"]
}
}