-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc
121 lines (121 loc) · 3.17 KB
/
.eslintrc
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
"env": {
"es6": true,
"browser": true,
"node": true
},
"plugins": ["testing-library", "@chanzuckerberg/stories"],
"extends": [
"@chanzuckerberg/eslint-config-edu-js",
"@chanzuckerberg/eslint-config-edu-ts",
"plugin:prettier/recommended",
"plugin:storybook/recommended",
"plugin:testing-library/react",
"plugin:@chanzuckerberg/eslint-plugin-edu-react/recommended",
"plugin:@chanzuckerberg/stories/strict"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"src/**/*.test.{ts,tsx}",
"src/**/*.stories.{ts,tsx}",
"**/*.config.{js,ts,mjs}",
"**/*.setup.{js,ts}",
".storybook/**",
"scripts/stylelint/**",
"plopfile.js"
]
}
],
"import/order": [
"error",
{
"alphabetize": {
"order": "asc"
},
"groups": ["builtin", "external", "sibling", "parent", "index"],
"pathGroups": [
{
"pattern": "*.module.css",
"group": "index",
"patternOptions": { "matchBase": true },
"position": "after"
}
]
}
],
"@typescript-eslint/no-unused-vars": "warn",
"no-unused-vars": "off",
"react/jsx-boolean-value": "warn"
},
"overrides": [
{
"files": ["*.test.{js,ts}", "*.test.tsx", "**/test/**"],
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"],
"env": {
"jest/globals": true
}
},
{
"files": [
"config.js",
"*.config.js",
"main.ts",
"plopfile.js",
"src/**/*.js"
],
"env": {
"browser": false,
"node": true
}
},
{
"files": ["src/**/*.stories.{ts,tsx}"],
"rules": {
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": [".storybook"],
"message": "Do not import files from `.storybook/` into `src`. If needed, move files into `src/storyUtils` instead."
},
{
"group": ["**/docs/*"],
"message": "Do not import files from `docs/` into `src`. If needed, move files into `src/storyUtils` instead."
}
]
}
]
}
},
{
"files": ["src/**/*.{ts,tsx}"],
"excludedFiles": ["src/**/*.{stories,test,spec}.{ts,tsx}"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "lodash",
"message": "For better tree shaking, prefer deep imports from lodash (e.g. import at from 'lodash/at') instead of named (e.g. import {at} from 'lodash)"
}
],
"patterns": [
{
"group": ["**/tokens-dist/ts/colors"],
"message": "Do not import JavaScript color variables into component files. Use CSS variables in styles instead."
}
]
}
]
}
}
],
"ignorePatterns": ["!.storybook"]
}