diff --git a/.eslintrc.json b/.eslintrc.json index 7127ce766..8217d28ca 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,78 +1,79 @@ { "root": true, "env": { "es6": true }, "extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:flowtype/recommended", "plugin:import/errors", "plugin:import/warnings", "plugin:prettier/recommended", "prettier" ], "parser": "babel-eslint", "plugins": ["react", "react-hooks", "flowtype", "monorepo", "import"], "rules": { // Prettier is configured to keep lines to 80 chars, but there are two issues: // - It doesn't handle comments (leaves them as-is) // - It makes all import statements take one line (reformats them) // We want ESLint to warn us in the first case, but not in the second case // since Prettier forces us in the second case. By setting code to 5000, we // make sure ESLint defers to Prettier for import statements. "max-len": ["error", { "code": 5000, "comments": 80, "ignoreUrls": true }], "flowtype/require-valid-file-annotation": ["error", "always"], "flowtype/require-exact-type": ["error", "never"], "curly": "error", "linebreak-style": "error", "semi": "error", "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", "monorepo/no-relative-import": "error", "no-empty": ["error", { "allowEmptyCatch": true }], "import/no-unresolved": 0, "no-unused-vars": ["error", { "ignoreRestSiblings": true }], "react/prop-types": ["error", { "skipUndeclared": true }], "no-shadow": 1, "no-var": "error", "import/extensions": ["error", "always"], "import/order": [ "warn", { "newlines-between": "always", "alphabetize": { "order": "asc", "caseInsensitive": true }, "groups": [["builtin", "external"], "internal"] } ], "prefer-const": "error", "react/jsx-curly-brace-presence": [ "error", { "props": "never", "children": "ignore" } ], - "eqeqeq": ["error", "always"] + "eqeqeq": ["error", "always"], + "no-constant-condition": ["error", { "checkLoops": false }] }, "settings": { "react": { "version": "detect" }, "import/ignore": ["react-native"], "import/internal-regex": "^(lib|native|keyserver|web)/" }, "overrides": [ { "files": "*.cjs", "env": { "node": true, "commonjs": true }, "rules": { "flowtype/require-valid-file-annotation": 0, "flowtype/require-exact-type": 0 } } ] }