2019-12-02 10:49:14 +00:00
|
|
|
{
|
|
|
|
"env": {
|
2019-12-02 15:26:31 +00:00
|
|
|
"browser": true,
|
2023-06-30 08:07:13 +00:00
|
|
|
"es2021": true
|
2019-12-02 10:49:14 +00:00
|
|
|
},
|
2023-06-30 08:07:13 +00:00
|
|
|
"extends": [
|
|
|
|
"standard-with-typescript",
|
|
|
|
"plugin:react/recommended",
|
|
|
|
"prettier"
|
|
|
|
],
|
2019-12-02 10:49:14 +00:00
|
|
|
"parserOptions": {
|
2023-06-30 08:07:13 +00:00
|
|
|
"ecmaVersion": "latest",
|
|
|
|
"sourceType": "module",
|
|
|
|
"project": "./tsconfig.json"
|
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"react": {
|
|
|
|
"version": "detect"
|
|
|
|
}
|
2019-12-02 10:49:14 +00:00
|
|
|
},
|
2020-05-14 09:30:32 +00:00
|
|
|
"plugins": [
|
2023-06-30 08:07:13 +00:00
|
|
|
"react",
|
2020-05-14 09:30:32 +00:00
|
|
|
"import",
|
|
|
|
"local-rules",
|
2021-04-02 11:01:38 +00:00
|
|
|
"cypress",
|
2022-07-13 09:13:58 +00:00
|
|
|
"formatjs",
|
2023-06-30 08:07:13 +00:00
|
|
|
"react-refresh",
|
2022-11-28 13:56:46 +00:00
|
|
|
"react-hooks",
|
2023-06-30 08:07:13 +00:00
|
|
|
"simple-import-sort"
|
2020-05-14 09:30:32 +00:00
|
|
|
],
|
2022-12-07 10:20:09 +00:00
|
|
|
"overrides": [
|
|
|
|
{
|
2023-01-05 12:34:34 +00:00
|
|
|
"files": ["src/**/*.test.*", "src/**/*.stories.*"],
|
2022-12-07 10:20:09 +00:00
|
|
|
"rules": {
|
|
|
|
"react-refresh/only-export-components": "off"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2019-12-02 10:49:14 +00:00
|
|
|
"rules": {
|
2023-07-19 09:58:07 +00:00
|
|
|
// Custom rules:
|
2022-03-09 08:56:55 +00:00
|
|
|
"import/no-duplicates": "error",
|
2020-05-14 09:30:32 +00:00
|
|
|
"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
|
2023-06-30 08:07:13 +00:00
|
|
|
"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": [
|
2019-12-02 10:49:14 +00:00
|
|
|
"error",
|
|
|
|
{
|
2023-06-30 08:07:13 +00:00
|
|
|
"idInterpolationPattern": "[sha512:contenthash:base64:6]"
|
2019-12-02 10:49:14 +00:00
|
|
|
}
|
|
|
|
],
|
2023-06-30 08:07:13 +00:00
|
|
|
"local-rules/named-styles": "error",
|
2021-05-14 08:15:15 +00:00
|
|
|
"no-restricted-imports": [
|
|
|
|
"error",
|
|
|
|
{
|
2022-12-02 10:45:19 +00:00
|
|
|
"paths": ["lodash", "@material-ui/icons/Delete", "classnames"]
|
2021-05-14 08:15:15 +00:00
|
|
|
}
|
2023-06-30 08:07:13 +00:00
|
|
|
],
|
2023-07-06 12:37:22 +00:00
|
|
|
"no-console": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"allow": ["warn", "error"]
|
|
|
|
}
|
|
|
|
],
|
2023-07-19 09:58:07 +00:00
|
|
|
// 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",
|
2023-06-30 08:07:13 +00:00
|
|
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
|
|
"@typescript-eslint/no-confusing-void-expression": "off",
|
2023-07-19 09:58:07 +00:00
|
|
|
// Migration in progress:
|
|
|
|
// Tracked in https://github.com/saleor/saleor-dashboard/issues/3813
|
2023-06-30 08:07:13 +00:00
|
|
|
"@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",
|
2023-07-19 09:58:07 +00:00
|
|
|
"@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",
|
2023-08-03 12:33:51 +00:00
|
|
|
"no-case-declarations": "warn"
|
2019-12-02 10:49:14 +00:00
|
|
|
},
|
2022-02-21 13:32:38 +00:00
|
|
|
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts"]
|
2019-12-02 10:49:14 +00:00
|
|
|
}
|