@ivuorinen/stylelint-config
v1.4.2
Published
ivuorinen's shareable configuration for stylelint.
Maintainers
Readme
@ivuorinen/stylelint-config
ivuorinen's shareable configuration for
stylelint.
Table of Contents
Installation
Install this config as a devDependencies:
# npm
npm install @ivuorinen/stylelint-config --save-dev
# Yarn
yarn add @ivuorinen/stylelint-config --devAfter installing it, a .stylelintrc.json file will be created automatically in the project's root folder with the following configuration:
{
"extends": ["@ivuorinen/stylelint-config/css"]
}The file is only written when this package is a direct dependency of the project being installed, and never when it arrives as a transitive dependency of something else. It is also skipped when a stylelint config already exists. Every outcome is logged during install, so if no file appears the reason is in the install output.
To suppress it entirely, set IVUORINEN_STYLELINT_NO_POSTINSTALL=1. Note that
npm 11 gates install scripts by default, so on a first install you may see
npm warn allow-scripts instead of a config file — in that case just create the
file by hand with the contents above.
Usage
This package provides configuration for CSS and SCSS, you can choose which one you want to extend.
Whitespace and formatting rules are not included — stylelint 16 removed them, and a formatter such as Prettier is the right tool for that job.
CSS (Default)
{
"extends": ["@ivuorinen/stylelint-config/css"]
}The bare package name is equivalent:
{
"extends": ["@ivuorinen/stylelint-config"]
}SCSS
{
"extends": ["@ivuorinen/stylelint-config/scss"]
}The SCSS config enforces two rules about @use/@forward paths that are worth
calling out, because they were silently inert before stylelint-scss 7 renamed
them:
| Rule | Effect |
| --- | --- |
| scss/load-partial-extension: 'never' | @use './tokens.scss' errors; write @use './tokens' |
| scss/load-no-partial-leading-underscore: true | @use './_mixins' errors; write @use './mixins' |
Extending the config
The defined rules can be modified by adding other configurations, plugins or custom rules:
{
"extends": ["@ivuorinen/stylelint-config/css", "some-other-config-you-use"],
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind", "apply", "screen"]
}
]
}
}SCSS consumers should configure scss/at-rule-no-unknown instead — the SCSS entry
point disables the core at-rule-no-unknown and delegates to the SCSS-aware
version.
Documentations
Read the stylelint docs for more information.
Contributing
If you are interested in helping contribute, please take a look at our contribution guidelines and open an issue or pull request.
Changelog
See CHANGELOG for a human-readable history of changes.
License
Distributed under the MIT License. See LICENSE for more information.
Dependency license note
[email protected], reached transitively via stylelint, ships no license field
in its package.json, so license scanners report it as UNKNOWN. Its repository
states MIT. Recorded here so consumers with a license allowlist can allow it
deliberately rather than treating it as an unreviewed gap. Every other package in
the tree is MIT or MIT-compatible.
