{ "env": { "es6": true, "browser": true, "jest": true }, "extends": [ "airbnb", "prettier", "plugin:@typescript-eslint/recommended", "plugin:jsx-a11y/recommended", "plugin:testing-library/react", "plugin:jest-dom/recommended" ], "plugins": [ "simple-import-sort", "prettier", "react-hooks", "@typescript-eslint", "jsx-a11y", "testing-library", "jest-dom" ], "rules": { "sort-imports": "off", "simple-import-sort/imports": [ "error", { "groups": [ ["^react", "^classcat", "^enzyme", "^exenv", "^lodash", "^styled-components", "^@storybook"], ["^[^.]"], ["^\\."] ] } ], "prettier/prettier": [ "error", { "printWidth": 100, "trailingComma": "all", "singleQuote": true, "semi": false, "arrowParens": "avoid" } ], "import/no-extraneous-dependencies": 0, "import/no-unresolved": 0, "import/extensions": 0, "import/prefer-default-export": 0, "react/forbid-prop-types": [2, { "forbid": ["any"] }], "react/no-typos": 0, "react/sort-comp": 0, "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "error", "react/destructuring-assignment": 0, "react/jsx-props-no-spreading": "off", "react/static-property-placement": "off", "react/state-in-constructor": "off", "react/jsx-fragments": ["error", "element"], "no-constant-condition": 0, "no-param-reassign": ["error", { "props": false }], "no-console": ["error", { "allow": ["warn"] }], "no-underscore-dangle": 0, "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], // Disabled as it is only an optimisation rule with a too heavy drawback. // See https://github.com/blablacar/kairos/pull/4865 "no-return-await": 0, "object-curly-newline": 0, "semi": ["error", "never"], "function-paren-newline": 0, "lines-between-class-members": 0, "camelcase": 0, "curly": [2, "all"], "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/explicit-function-return-type": 0, "@typescript-eslint/camelcase": 0, "@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-extra-semi": 0, "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-var-requires": 0, "@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }], "@typescript-eslint/consistent-type-definitions": ["error", "type"], "@typescript-eslint/array-type": ["error", { "default": "generic", "readonly": "generic" }], "@typescript-eslint/ban-types": 0, "@typescript-eslint/ban-ts-comment": "off", "no-use-before-define": "off", "arrow-body-style": "off", "jest-dom/prefer-in-document": "off", "react/jsx-filename-extension": ["error", { "extensions": [".js", ".tsx", ".mdx"] }] }, "overrides": [ { "files": ["*.ts", "*.tsx"], "rules": { "no-shadow": "off", "@typescript-eslint/no-shadow": "error", "@typescript-eslint/no-extra-semi": "off", // disabling explicit-function-return-type for now as it adds ~600 eslint errors "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/member-delimiter-style": 0, "@typescript-eslint/no-explicit-any": 0, "react/require-default-props": "off" } }, { // Allow restricted imports and require for tests. "files": ["*.unit.ts", "*.unit.tsx", "*.unit.js", "*.unit.jsx"], "rules": { "no-restricted-imports": ["off"], "no-restricted-modules": ["off"] } }, { "files": ["src/**/*"], "rules": { "import/no-default-export": "warn" } }, { "files": ["story.tsx", "*.unit.tsx"], "rules": { "no-alert": 0, "jsx-a11y/anchor-is-valid": 0, "jsx-a11y/anchor-has-content": 0 } }, { "files": ["*.mdx"], "extends": [ "plugin:mdx/recommended" ], "rules": { "max-len": 0, "react/jsx-indent": 0, "prettier/prettier": 0 } } ] }