vue/multi-word-component-names是用于检测当前的组件名称是否使用驼峰或多单词命名,eslint默认是要求检测,可以手动关闭检测

修改.eslintrc.js文件的规则如下:
module.exports = {
root: true,
env: {
node: true,
},
extends: ['plugin:vue/essential', 'eslint:recommended', 'plugin:prettier/recommended'],
parserOptions: {
// parser: '@babel/eslint-parser',
},
rules: {
// 去掉函数()前面的空格
'space-before-function-paren': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// 关闭驼峰命名规则
'vue/multi-word-component-names': 0,
},
}

本文档展示了如何在ESLint配置文件`.eslintrc.js`中关闭`vue/multi-word-component-names`规则,允许使用驼峰式或多单词命名组件。通过将该规则设置为0,你可以自定义组件命名规范,无需遵循默认的检测。

1万+

被折叠的 条评论
为什么被折叠?



