【发布时间】:2021-10-17 07:18:27
【问题描述】:
我正在关注 this Ionic/Vue 3 tutorial,但在为项目提供服务时出现此错误:
我的项目级 .eslintrc.js 似乎没有生效。在其中,我对该规则进行了覆盖:
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-deprecated-slot-attribute': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-use-before-define': ["error", { "functions": false, "classes": false }]
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
jest: true
}
}
]
}
我做错了什么?
【问题讨论】:
-
Here's the repo (我省略了
/node_modules以减小存储库大小。)正如您从我的问题中的错误中看到的那样,它引用了默认的 ESLint 配置,并且似乎忽略了覆盖在项目根目录中我自己的 ESLint 配置中。谢谢。
标签: typescript vue.js ionic-framework eslint