Commit 9f700d1f by 杨周龙

优化eslint

1 parent 17c162d4
Showing with 14 additions and 12 deletions
const isDebug = process.env.NODE_ENV === 'development' ? 1 : 2
module.exports = {
"env": {
"node": true,
......@@ -36,7 +38,7 @@ module.exports = {
"Promise": true
},
"rules": {
"no-console": [1, { "allow": ["error"] }],
"no-console": [isDebug, { "allow": ["error"] }],
"consistent-return": 2,
"curly": [2, "multi-or-nest"],
"dot-location": 0,
......@@ -46,13 +48,13 @@ module.exports = {
"no-lone-blocks": 2,
"no-return-await": 2,
"no-unused-expressions": 2,
"no-label-var": 1,
"no-label-var": isDebug,
"array-bracket-spacing": 2,
"brace-style": 0,
"comma-spacing": 1,
"consistent-this": 1,
"comma-spacing": isDebug,
"consistent-this": isDebug,
"eol-last": 0,
"multiline-ternary": [1, "always-multiline"],
"multiline-ternary": [2, "always-multiline"],
"new-cap": [2, { "capIsNew": false }],
"no-trailing-spaces": 0,
"semi": ["error", "never"],
......@@ -65,7 +67,7 @@ module.exports = {
"key-spacing": 2,
"comma-dangle": ["error", "never"],
"react-hooks/exhaustive-deps": 0,
"no-empty-function": 1,
"no-empty-function": isDebug,
"react-native/no-inline-styles": 0,
"react/forbid-prop-types": 0,
"react/prop-types": 0,
......@@ -73,16 +75,16 @@ module.exports = {
"prefer-promise-reject-errors": 0,
"react/no-array-index-key": 2,
"react/no-unused-state": 2,
"react/jsx-indent-props": 1,
"react/jsx-no-comment-textnodes": 1,
"react/jsx-indent-props": isDebug,
"react/jsx-no-comment-textnodes": isDebug,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-target-blank": [1, { "enforceDynamicLinks": "always" }],
"react/jsx-no-target-blank": [isDebug, { "enforceDynamicLinks": "always" }],
"react/jsx-no-undef": 2,
"react/jsx-props-no-multi-spaces": 1,
"react/jsx-tag-spacing": 1,
"react/jsx-props-no-multi-spaces": isDebug,
"react/jsx-tag-spacing": isDebug,
"react/jsx-uses-vars": 2,
"react/jsx-wrap-multilines": 2,
"react-hooks/rules-of-hooks": 2,
"no-unused-vars": process.env.NODE_ENV === 'development' ? 1 : 2
"no-unused-vars": isDebug
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!