代码校验 (Linting)
请确认在你的 ESLint 配置文件中使用该插件要导入的配置:
接下来从命令行运行:
请确保它是作为一个 pre-loader 运用的:
// webpack.config.js
module.exports = {
rules: [
{
enforce: 'pre',
test: /\.(js|vue)$/,
exclude: /node_modules/
}
]
}
stylelint
支持在 Vue 单文件组件的样式部分的代码校验。
接下来从命令行运行:
另一个选项是使用 stylelint-webpack-plugin: