加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.eslintrc.json 8.88 KB
一键复制 编辑 原始数据 按行查看 历史
shren 提交于 2021-07-01 02:22 . filemgr refactoring
{
"env": {
"browser": true,
"es6": true
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".d.ts"]
}
},
"react": {
"version": "detect"
}
},
"extends": [
"airbnb-base",
"plugin:@typescript-eslint/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"jsx": true,
"useJSXTextNode": true
},
"ignorePatterns": ["lib.*.d.ts"],
"rules": {
"array-callback-return": "warn",
"arrow-parens": ["warn", "as-needed", { "requireForBlockBody": true }],
"class-methods-use-this": "off",
"comma-dangle": ["error", "never"],
"curly": ["warn", "multi-line"],
"default-case": ["warn", { "commentPattern": "^no default$" }],
"dot-location": ["warn", "property"],
"eqeqeq": ["warn", "smart"],
"getter-return": "warn",
"guard-for-in": "off",
"import/extensions": ["error", "never"],
"import/first": "error",
"import/newline-after-import": "warn",
"import/no-amd": "error",
"import/no-duplicates": "off",
"import/no-webpack-loader-syntax": "error",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"indent": ["error", 4, { "SwitchCase": 1 }],
"jsx-quotes": ["error", "prefer-double"],
"lines-between-class-members": "off",
"max-classes-per-file": "off",
"max-len": "off",
"new-parens": "warn",
"no-array-constructor": "off",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-caller": "warn",
"no-cond-assign": ["warn", "except-parens"],
"no-const-assign": "warn",
"no-control-regex": "warn",
"no-continue": "off",
"no-delete-var": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "off",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-empty": ["warn", { "allowEmptyCatch": true }],
"no-empty-character-class": "warn",
"no-empty-pattern": "warn",
"no-eval": "warn",
"no-ex-assign": "warn",
"no-extend-native": "warn",
"no-extra-bind": "warn",
"no-extra-label": "warn",
"no-fallthrough": "warn",
"no-func-assign": "warn",
"no-implied-eval": "warn",
"no-invalid-regexp": "warn",
"no-iterator": "warn",
"no-lonely-if": "off",
"no-label-var": "warn",
"no-labels": ["warn", { "allowLoop": true, "allowSwitch": false }],
"no-lone-blocks": "warn",
"no-loop-func": "off",
"no-mixed-operators": "off",
"no-multi-str": "warn",
"no-native-reassign": "warn",
"no-negated-in-lhs": "warn",
"no-nested-ternary": "off",
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-param-reassign": ["error", { "props": false }],
"no-plusplus": "off",
"no-prototype-builtins": "off",
"no-redeclare": "off",
"no-regex-spaces": "warn",
"no-restricted-globals": "off",
"no-restricted-properties": [
"error",
{
"object": "require",
"property": "ensure",
"message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting"
},
{
"object": "System",
"property": "import",
"message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting"
}
],
"no-restricted-syntax": [
"error",
{
"selector": "LabeledStatement",
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
},
{
"selector": "WithStatement",
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
}
],
"no-return-assign": "off",
"no-shadow": "off",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-shadow-restricted-names": "warn",
"no-sparse-arrays": "off",
"no-template-curly-in-string": "warn",
"no-this-before-super": "warn",
"no-throw-literal": "warn",
"no-trailing-spaces": "warn",
"no-undef": "off",
"no-underscore-dangle": "off",
"no-use-before-define": "off",
"no-unreachable": "warn",
"no-unused-labels": "warn",
"no-unused-vars": "off",
"no-useless-computed-key": "warn",
"no-useless-concat": "warn",
"no-useless-constructor": "off",
"no-useless-escape": "warn",
"no-useless-rename": [
"warn",
{
"ignoreDestructuring": false,
"ignoreImport": false,
"ignoreExport": false
}
],
"no-with": "warn",
"no-whitespace-before-property": "warn",
"object-curly-newline": ["error", {
"ObjectExpression": { "multiline": true, "consistent": true },
"ObjectPattern": { "multiline": true, "consistent": true },
"ImportDeclaration": { "multiline": true, "consistent": true },
"ExportDeclaration": { "multiline": true, "consistent": true }
}],
"prefer-destructuring": "off",
"prefer-template":"off",
"quotes": ["error", "double", { "avoidEscape": true }],
"semi": "off",
"spaced-comment": [2, "always", { "markers": ["/"] }],
"radix": "off",
"react/forbid-foreign-prop-types": ["warn", { "allowInPropTypes": true }],
"react/jsx-no-comment-textnodes": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-target-blank": "warn",
"react/jsx-no-undef": "error",
"react/jsx-pascal-case": [
"warn",
{
"allowAllCaps": true,
"ignore": []
}
],
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/no-danger-with-children": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-is-mounted": "warn",
"react/no-typos": "error",
"react/react-in-jsx-scope": "error",
"react/require-render-return": "error",
"react/style-prop-object": "warn",
"require-yield": "warn",
"rest-spread-spacing": ["warn", "never"],
"strict": ["warn", "never"],
"unicode-bom": ["warn", "never"],
"use-isnan": "warn",
"valid-typeof": "warn",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/class-name-casing": "off",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/member-delimiter-style": [
"warn",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-duplicate-imports": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-array-constructor": "warn",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": true
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/no-useless-constructor": "warn",
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/semi": ["error", "always"]
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react"]
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化