2 Star 0 Fork 0

叶码/xy-pc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.eslintrc.cjs 2.60 KB
一键复制 编辑 原始数据 按行查看 历史
叶码 提交于 2024-07-08 16:24 +08:00 . feat: chushihau
/* 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
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ye-code/xy-a.git
git@gitee.com:ye-code/xy-a.git
ye-code
xy-a
xy-pc
master

搜索帮助