forked from jpmorganchase/salt-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
77 lines (77 loc) · 1.97 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
project: [
"./tsconfig.json",
"./cypress/tsconfig.json",
"./site/tsconfig.json",
],
},
plugins: ["@typescript-eslint", "eslint-plugin-local-rules"],
extends: [
"plugin:import/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier",
"plugin:storybook/recommended",
"plugin:import/typescript", // Or Error: Unable to resolve path to module
],
rules: {
"import/no-extraneous-dependencies": "off",
},
overrides: [
{
files: ["packages/**/src/**/*.ts", "packages/**/src/**/*.tsx"],
rules: {
"local-rules/must-inject-css": 2,
},
},
{
extends: [
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
files: ["*.ts", "*.tsx"],
rules: {
"react-hooks/exhaustive-deps": [
"warn",
{
additionalHooks:
"(useIsomorphicLayoutEffect|useLayoutEffectOnce|useLayoutEffectSkipFirst)",
},
],
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-unsafe-assignment ": "off",
"@typescript-eslint/prefer-nullish-coalescing": [
"error",
{
ignorePrimitives: { boolean: true },
},
],
// TypeScript provides the same checks as part of standard type checking.
"import/named": "off",
"import/namespace": "off",
"import/default": "off",
"import/no-named-as-default-member": "off",
},
},
{
files: ["*.stories.*"],
rules: {
"react/prop-types": "off",
},
},
{
files: ["*.cy.tsx"],
plugins: ["cypress"],
},
],
settings: {
react: {
version: "detect",
},
},
ignorePatterns: [".eslintrc.js", "**/vite.config.ts"],
};