加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.eslintrc.json 5.96 KB
一键复制 编辑 原始数据 按行查看 历史
{
"env":{
"browser":false,
"commonjs":true,
"es2021":true,
"es6":true,
"node":true,
"jest":true
},
"globals":{
},
"parser":"babel-eslint",
"parserOptions":{
"ecmaVersion":12,
"sourceType":"module",
"ecmaFeatures":{
"jsx":true,
"generators":true,
"experimentalObjectRestSpread":true,
"objectLiteralDuplicateProperties":false
}
},
"plugins":[
"jsx-a11y",
"react"
],
"extends": [
"eslint:recommended",
"prettier"
],
"rules":{
"complexity":[
"error",
15
],
"no-console":"off",
"prefer-template":"warn",
"react/jsx-boolean-value":"warn",
"react/jsx-curly-spacing":"off",
"react/jsx-handler-names":[
"off",
{
"eventHandlerPrefix":"handle",
"eventHandlerPropPrefix":"on"
}
],
"react/jsx-filename-extension":[
"warn",
{
"extensions":[
".jsx",
".js"
]
}
],
"react/jsx-key":"off",
"react/jsx-max-props-per-line":[
"off",
{
"maximum":1
}
],
"react/jsx-no-target-blank":"warn",
"react/jsx-no-undef":"warn",
"react/jsx-pascal-case":[
"error",
{
"allowAllCaps":true,
"ignore":[
]
}
],
"react/jsx-uses-react":[
"warn"
],
"react/jsx-uses-vars":"warn",
"react/no-children-prop":"warn",
"react/no-deprecated":"warn",
"react/no-did-mount-set-state":[
"error"
],
"react/no-did-update-set-state":[
"error"
],
"react/no-direct-mutation-state":"error",
"react/no-is-mounted":"error",
"react/no-multi-comp":[
"warn",
{
"ignoreStateless":true
}
],
"react/no-unescaped-entities":"warn",
"react/prefer-es6-class":[
"error",
"always"
],
"react/react-in-jsx-scope":"warn",
"react/require-extension":[
"off",
{
"extensions":[
".jsx"
]
}
],
"react/require-render-return":"warn",
"react/self-closing-comp":"warn",
"react/sort-comp":[
"warn",
{
"order":[
"static-methods",
"lifecycle",
"/^on.+$/",
"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/",
"everything-else",
"/^render.+$/",
"render"
]
}
],
"array-callback-return":"warn",
"default-case":[
"warn",
{
"commentPattern":"^no default$"
}
],
"eqeqeq":[
"warn",
"allow-null"
],
"guard-for-in":"warn",
"no-array-constructor":"warn",
"no-caller":"warn",
"no-cond-assign":[
"warn",
"always"
],
"no-const-assign":"error",
"no-control-regex":"warn",
"no-delete-var":"error",
"no-dupe-args":"error",
"no-dupe-class-members":"error",
"no-dupe-keys":"error",
"no-duplicate-case":"error",
"no-empty-character-class":"warn",
"no-empty-pattern":"error",
"no-eval":"error",
"no-ex-assign":"error",
"no-extend-native":"warn",
"no-extra-bind":"warn",
"no-extra-label":"error",
"no-fallthrough":"warn",
"no-func-assign":"warn",
"no-implied-eval":"error",
"no-invalid-regexp":"error",
"no-iterator":"error",
"no-label-var":"error",
"no-labels":[
"error",
{
"allowLoop":false,
"allowSwitch":false
}
],
"no-lone-blocks":"error",
"no-loop-func":"warn",
"no-multi-str":"warn",
"no-native-reassign":"error",
"no-negated-in-lhs":"error",
"no-new-func":"error",
"no-new-object":"warn",
"no-new-symbol":"warn",
"no-new-wrappers":"error",
"no-obj-calls":"error",
"no-octal":"warn",
"no-octal-escape":"warn",
"no-redeclare":"error",
"no-regex-spaces":"warn",
"no-restricted-syntax":[
"warn",
"LabeledStatement",
"WithStatement"
],
"no-script-url":"warn",
"no-self-assign":"error",
"no-self-compare":"error",
"no-sequences":"error",
"no-shadow-restricted-names":"error",
"no-sparse-arrays":"error",
"no-template-curly-in-string":"warn",
"no-this-before-super":"warn",
"no-throw-literal":"warn",
"no-undef":"error",
"no-unreachable":"warn",
"no-unused-expressions":[
"warn",
{
"allowShortCircuit":true,
"allowTernary":true
}
],
"no-unused-labels":"error",
"no-unused-vars":[
"warn",
{
"vars":"local",
"args":"none"
}
],
"no-use-before-define":[
"warn",
"nofunc"
],
"no-useless-computed-key":"warn",
"no-useless-concat":"warn",
"no-useless-constructor":"error",
"no-useless-escape":"error",
"no-useless-rename":[
"error",
{
"ignoreDestructuring":false,
"ignoreImport":false,
"ignoreExport":false
}
],
"no-var":"error",
"no-with":"error",
"operator-assignment":[
"warn",
"always"
],
"radix":"warn",
"require-yield":"warn",
"strict":[
"warn",
"never"
],
"use-isnan":"warn",
"valid-typeof":"error"
},
"settings":{
"import/resolver":{
"node":{
"extensions":[
".mjs",
".js",
".jsx",
".json"
]
}
},
"import/extensions":[
".js",
".mjs",
".jsx"
],
"import/core-modules":[
],
"import/ignore":[
"node_modules",
"\\.(json|css|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$"
]
},
"ignorePatterns":[
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化