saleor-dashboard/.eslintrc.json
Michał Droń 6cc8f78746
Turn off ESLint rules with small benefit-to-effort ratio (#3951)
* Turn off ESLint rules

* Move fast-refresh to migration section

* Add changeset
2023-07-19 11:58:07 +02:00

118 lines
3.8 KiB
JSON

{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"standard-with-typescript",
"plugin:react/recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"settings": {
"react": {
"version": "detect"
}
},
"plugins": [
"react",
"import",
"local-rules",
"cypress",
"formatjs",
"react-refresh",
"react-hooks",
"simple-import-sort"
],
"overrides": [
{
"files": ["src/**/*.test.*", "src/**/*.stories.*"],
"rules": {
"react-refresh/only-export-components": "off"
}
}
],
"rules": {
// Custom rules:
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": "off", // imports are handled by simple-import-sort/sort
"import/no-internal-modules": "off", // imports are handled by simple-import-sort/sort
"import/order": "off", // imports are handled by simple-import-sort/sort
"sort-imports": "off", // imports are handled by simple-import-sort/sort
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"react-hooks/rules-of-hooks": "error",
"formatjs/enforce-id": [
"error",
{
"idInterpolationPattern": "[sha512:contenthash:base64:6]"
}
],
"local-rules/named-styles": "error",
"no-restricted-imports": [
"error",
{
"paths": ["lodash", "@material-ui/icons/Delete", "classnames"]
}
],
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
],
// Decided to turn off:
"react/prop-types": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
// Migration in progress:
// Tracked in https://github.com/saleor/saleor-dashboard/issues/3813
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/prefer-reduce-type-parameter": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/return-await": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"multiline-ternary": "off",
"no-extra-boolean-cast": "off",
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"react-refresh/only-export-components": "off",
"array-callback-return": "off",
"import/export": "off",
"n/no-callback-literal": "off",
"no-case-declarations": "off",
"no-empty-pattern": "off",
"no-fallthrough": "off",
"no-new": "off",
"no-prototype-builtins": "off",
"no-unreachable": "off",
"no-useless-catch": "off",
"no-useless-escape": "off",
"prefer-promise-reject-errors": "off",
"react/display-name": "off",
"react/jsx-key": "off",
"symbol-description": "warn"
},
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts"]
}