@prefabs.tech/stylelint-config
v0.9.1
Published
Stylelint config
Downloads
926
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/vue.jsfor 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/stylelint-config"; export default stylelintConfig;For Vue projects:
Install dependencies:
npm i -D @prefabs.tech/stylelint-config stylelint stylelint-config-recommended-vue stylelint-config-html postcss-html stylelint-orderCreate a
stylelint.config.jsfile:import stylelintConfig from "@prefabs.tech/stylelint-config/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