-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy path.eslintrc
More file actions
100 lines (98 loc) · 3.57 KB
/
.eslintrc
File metadata and controls
100 lines (98 loc) · 3.57 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
"plugins": ["jest", "jsx-a11y"],
"extends": [
"@doist/eslint-config/recommended-type-checked",
"@doist/eslint-config/react",
"plugin:jest/recommended",
"@doist/eslint-config/simple-import-sort"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"impliedStrict": true
},
"sourceType": "module",
"project": ["tsconfig.json", "stories/tsconfig.json"]
},
"ignorePatterns": [
"dist/**",
"docs/**",
"lib/**",
"storybook-static/**",
"storybook-static-*/**",
"postcss.config.js",
"scripts/**",
"rollup.config.mjs",
"webpack.config.*"
],
"rules": {
"func-style": "off",
"import/no-default-export": "off", // Legacy API.
"react/no-find-dom-node": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
// Resolving jsx-runtime mismatched versions of React (e.g. v17 vs v18)
// See https://github.com/Doist/reactist/pull/979
"no-restricted-imports": "off"
},
"overrides": [
{
// Files in .react-compiler.rec.json with known CompileErrors.
// eslint-plugin-react-hooks@7+ flags the same issues via runtime checks.
// They're pre-existing accepted technical debt; suppress so the
// migration doesn't turn them into hard lint failures.
"files": [
"src/checkbox-field/use-fork-ref.ts",
"src/tabs/tabs.tsx",
"src/tooltip/tooltip.tsx"
],
"rules": {
"react-hooks/refs": "off",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/use-memo": "off",
"react-hooks/set-state-in-effect": "off",
"react/use": "off"
}
},
{
// Stories have looser typing requirements. Storybook's package
// exports (e.g. `storybook/actions`) aren't understood by the default ESLint
// import resolver, so `import/no-unresolved` is disabled for stories.
"files": ["stories/**/*", "**/*.stories.*", "**/*-stories-*.{ts,tsx}"],
"env": {
"browser": true
},
"rules": {
"react/no-unescaped-entities": "off",
"import/no-unresolved": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-floating-promises": "off"
}
},
{
// Jest tests keep no-floating-promises enabled so async userEvent,
// axe, and helper calls must be awaited.
"files": ["**/*.test.*"],
"env": {
"browser": true
},
"rules": {
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
],
"settings": {
"react": {
"version": "detect"
}
}
}