@prefabs.tech/stylelint-config
v0.8.0
Published
Stylelint config
Keywords
Readme
@prefabs.tech/stylelint-config
Custom stylelint configuration for CSS/SCSS linting across projects.
Supported configurations:
@prefabs.tech/stylelint-configfor CSS/SCSS linting in general projects@prefabs.tech/stylelint-config/vuefor CSS/SCSS linting in Vue projects
Installation and usage
Note: For CommonJS projects, use stylelint.config.mjs instead of stylelint.config.js.
For general linting:
Install dependencies:
npm i -D @prefabs.tech/stylelint-config stylelint stylelint-config-standard stylelint-orderCreate a
stylelint.config.jsfile:import stylelintConfig from "@prefabs.tech/eslint-config/stylelint.js"; export default stylelintConfig;For Vue projects:
Install dependencies:
npm i -D @prefabs.tech/stylelint-config stylelint stylelint-config-recommended-vue stylelint-orderCreate a
stylelint.config.jsfile:import stylelintConfig from "@prefabs.tech/eslint-config/stylelint-vue.js"; export default stylelintConfig;
Adding stylelint scripts
In your package.json, add the following commands to the scripts section:
"stylelint": "stylelint \"src/**/*.{css,vue}\"",
"stylelint:fix": "stylelint \"src/**/*.{css,vue}\" --fix",Running stylelint
Run the following command to lint your code:
npm run stylelintTo automatically fix issues, run:
npm run stylelint:fix