代码拉取完成,页面将自动刷新
/* eslint-env node */
// require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
"env": {
"browser": true,
"es2021": true,
"node": true//生成的 eslint 配置默认会 vue 的部分语法不是很兼容(由于 `eslint` 没有解析 `.vue` 后缀文件的能力,需要额外的解析器用来解析 `.vue` 后缀的文件),需要额外修改一下配置,在 `parserOptions` 前面一行加上 `parser: "vue-eslint-parser",` 用来解析 `.vue` 文件。
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
// "airbnb",//使用 airbnb 的语法规范
'./.eslintrc-auto-import.json'//去掉并解决eslint中对自动引入的组件模块提示no-undef的提示
],
"parser": "vue-eslint-parser",//在 `parserOptions` 前面一行加上 `parser: "vue-eslint-parser",` 用来解析 `.vue` 文件。
parserOptions: {
"ecmaVersion": 'latest',
// 为了去掉Did you mean `{'>'}` or `>`?的eslint报错
"parser":"@typescript-eslint/parser",
ecmaFeatures : {
jsx : false
}
},
rules: {
// "no-empty": "error",//禁止出现空语句块
// "no-multi-spaces": "off",//禁止使用多个空格
// "semi": ["error", "never"], // 不加分号 //要求或禁止使用分号代替 ASI
// "eqeqeq": "error",//要求使用 === 和 !==
// "no-trailing-spaces": "error",//禁用行尾空格
// "no-multiple-empty-lines": "error",//禁止出现多行空行
// "func-call-spacing": "error",//要求或禁止在函数标识符和其调用之间有空格
// "space-in-parens": "error",//强制在圆括号内使用一致的空格
// "object-curly-spacing": ["error", "always"],//强制在大括号中使用一致的空格
// "@typescript-eslint/explicit-module-boundary-types": "off", // ts每个函数都要显式声明返回值//
// "@typescript-eslint/no-explicit-any": "off", // 关闭any警告//
"no-var": "error",//要求使用 let 或 const 而不是 var
// // 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',//禁用 console
'no-debugger': 'off',//禁用 debugger
// "no-undef":"warn",
'vue/multi-word-component-names': "off", //关闭命名规则校验
// "@typescript-eslint/no-unused-vars": ["off"],//有未使用的变量,不提示警告
// "@typescript-eslint/no-unused-vars": ["error"],//有未使用的变量,提示报错
},
"globals": {
"defineOptions": true, //解决'defineOptions' is not defined.eslintno-undef
"WwLogin": true, //解决'defineOptions' is not defined.eslintno-undef
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。