-
Notifications
You must be signed in to change notification settings - Fork 25
/
.eslintrc
155 lines (155 loc) · 4.69 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{
"extends": [
"plugin:@shopify/typescript",
"plugin:@shopify/react",
"plugin:@shopify/jest",
"plugin:@shopify/node",
"plugin:@shopify/polaris",
"plugin:@shopify/prettier"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"func-style": "off",
"no-process-env": "off",
"no-warning-comments": "off",
"no-negated-condition": "off",
"no-console": "error",
"consistent-return": "off",
"match-default-export-name": "off",
"jsx-use-translation-function": "off",
"lines-around-comment": [
"error",
{
"beforeBlockComment": false,
"allowBlockStart": false
}
],
"babel/no-unused-expressions": "off",
"import/named": "off",
"import/no-default-export": ["error"],
"react/button-has-type": "off",
"react/no-array-index-key": "off",
"react/jsx-fragments": ["error", "element"],
"react/no-unsafe": ["error", {"checkAliases": true}],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/consistent-type-imports": "error",
"@shopify/jsx-no-complex-expressions": "off",
"@shopify/jsx-prefer-fragment-wrappers": "off",
"import/no-useless-path-segments": "off",
"@shopify/react-prefer-private-members": "off",
"@typescript-eslint/array-type": ["error", {"defaultOption": "array"}],
"@typescript-eslint/naming-convention": "off",
"jsx-a11y/label-has-for": [
2,
{
"required": {
"some": ["nesting", "id"]
},
"allowChildren": false
}
],
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/control-has-associated-label": "off",
"jsx-a11y/role-supports-aria-props": "off",
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-noninteractive-element-to-interactive-role": "off",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "test-utilities/legacy",
"message": "Please import the modern testing library from 'test-utilities' instead"
}
]
}
],
"camelcase": [
"error",
{
"allow": [
"UNSTABLE_colors",
"UNSTABLE_cssCustomProperties",
"UNSTABLE_telemetry"
]
}
]
},
"overrides": [
{
"files": ["./packages/**/src/**/*.{ts,tsx}"],
"excludedFiles": ["./packages/**/src/**/*.test.{ts,tsx}"],
"extends": ["plugin:@shopify/typescript-type-checking"],
"parserOptions": {
"project": [
"./packages/polaris-viz/tsconfig.json",
"./packages/polaris-viz-core/tsconfig.json",
"./packages/polaris-viz-native/tsconfig.json"
]
},
"rules": {
"@typescript-eslint/prefer-readonly": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/unbound-method": "off"
}
},
{
"files": ["**/loom.config.ts", "sandbox/**/*"],
"rules": {
// We disable `import/no-extraneous-dependencies` for test files because it
// would force releases of `@shopify/react-testing` (and similar devDependencies)
// to cause unnecessary package bumps in every package that consumes them.
// Test files with extraneous dependencies won't cause runtime errors in production.
"import/no-extraneous-dependencies": "off",
"no-use-before-define": "off",
"@shopify/jsx-no-hardcoded-content": "off",
"import/no-default-export": "off",
"eslint-comments/no-unused-disable": "off",
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"import/no-anonymous-default-export": "off",
"no-console": "off",
"id-length": "off",
"@shopify/prefer-module-scope-constants": "off"
}
},
{
"files": ["./packages/**/src/**/*.test.{ts,tsx}"],
"rules": {
"jest/no-truthy-falsy": "off",
"@shopify/no-ancestor-directory-import": "off",
"@shopify/jsx-no-hardcoded-content": "off",
"jest/expect-expect": [
"error",
{
"assertFunctionNames": ["expect", "expectToThrow"]
}
]
}
},
{
"files": ["**/*.stories.{ts,tsx}"],
"parserOptions": {
"project": ["./tsconfig.json"]
},
"rules": {
"import/no-default-export": "off"
}
},
{
"files": ["documentation/code/**/*.tsx"],
"rules": {
"react/no-unused-prop-types": "off",
"@shopify/strict-component-boundaries": "off"
}
}
]
}