ascendancyy / vue-cli-plugin-stylelint

Vue cli 3.x plugin for stylelint
46 stars 15 forks source link
stylelint vue-cli

@ascendancyy/vue-cli-plugin-stylelint

stylelint plugin for vue-cli

Injected commands

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.

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 @ascendancyy/vue-cli-plugin-stylelint
vue invoke @ascendancyy/vue-cli-plugin-stylelint

There is also a shorthand to invoke the plugin
vue invoke @ascendancyy/stylelint

webpack-chain Injections