algorighm/.eslintrc.json

38 lines
1.4 KiB
JSON

{
"env": {
"browser": true,
"es2021": true
},
"extends": ["airbnb-base"],
"plugins": ["prettier"], // 配合prettier
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
// "ignores": ["leetcode/*"],
"rules": {
"no-plusplus": "off", // 允许i++,i--
"no-use-before-define": "off", // 无需在调用前面定义,之后定义也可以
"no-console": "off",
"no-continue": "off", // 允许使用continue
"no-bitwise": "off", // 允许使用位运算
"max-classes-per-file": "off", // 允许一个文件写多个类
"func-names": "off", // 允许具名函数
"no-restricted-syntax": "off", // 允许for of
"no-constant-condition": "off", // 允许while(true)
"default-case": "off", // 允许switch不写default
"no-fallthrough": "off", // 允许case穿透
"prefer-destructuring": ["error", {"object": false, "array": false}],
"import/extensions": [
"error",
"ignorePackages", // 忽略 node_modules 内的包
{
"mjs": "always", // 不允许省略 .mjs 后缀
"js": "always", // 不允许省略 .js 后缀
"ts": "always" // 不允许省略 .ts 后缀
}
],
"no-param-reassign": "off"
}
}