https://github.com/winjs-dev/vue-cli-plugin-stylelint
stylelint plugin for vue-cli
https://github.com/winjs-dev/vue-cli-plugin-stylelint
Last synced: 8 months ago
JSON representation
stylelint plugin for vue-cli
- Host: GitHub
- URL: https://github.com/winjs-dev/vue-cli-plugin-stylelint
- Owner: winjs-dev
- Created: 2020-07-17T02:26:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-28T03:28:51.000Z (over 5 years ago)
- Last Synced: 2025-08-17T06:30:03.366Z (10 months ago)
- Language: JavaScript
- Size: 340 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @winner-fed/vue-cli-plugin-stylelint
> stylelint plugin for vue-cli
## Injected commands
- **`vue-cli-service lint:style`**
```
Usage: vue-cli-service lint:style [options] [...files]
Options:
--no-fix do not auto-fix errors
--options list additional stylelint cli options
```
Lints and fixes files. If no specific files are given, it lints all vue files, html files, and stylesheets in `src`.
## Configuration (vue.config.js, "vue" in package.json)
Lint on (re)build with `stylelint-webpack-plugin` can be enabled with the `lintStyleOnBuild` option. You can also provide additional options to stylelint. See available options on the stylelint [website](https://stylelint.io/user-guide/node-api/#options).
``` js
module.exports = {
// ...
pluginOptions: {
lintStyleOnBuild: true,
stylelint: {
fix: true, // boolean (default: true)
files: '', // string | [string] (default: ['src/**/*.{vue,htm,html,css,sss,less,scss}'])
// See https://stylelint.io/developer-guide/formatters/
formatter: () => {} // function (default: require('stylelint-codeframe-formatter'))
// etc...
}
}
}
```
## Installing in an already created project
```
npm install -D @winner-fed/vue-cli-plugin-stylelint
vue invoke @winner-fed/vue-cli-plugin-stylelint
```
> There is also a shorthand to invoke the plugin
> `vue invoke @winner-fed/stylelint`
## webpack-chain Injections
- `config.plugin('stylelint')`
- `config.plugin('stylelint').use('stylelint-webpack-plugin')`
- `config.plugin('friendly-errors').tap(/* Adds additional transformer and formatter */)`