forked from Shopify/ui-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
74 lines (73 loc) · 2 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
module.exports = {
extends: [
'plugin:@shopify/typescript',
'plugin:@shopify/jest',
'plugin:@shopify/prettier',
'plugin:@shopify/react',
],
ignorePatterns: [
'build/',
'examples/',
'node_modules/',
'packages/*/build/',
'packages/*/*.d.ts',
'packages/*/*.js',
'!packages/*/.eslintrc.js',
'packages/*/*.mjs',
'packages/*/*.node',
'packages/*/*.esnext',
],
rules: {
// Codebase was originally written without some strict Shopify conventions
'import/order': 'off',
'@typescript-eslint/naming-convention': 'off',
// This rule is just bad
'@typescript-eslint/consistent-indexed-object-style': 'off',
},
overrides: [
{
files: ['loom.config.ts', 'config/loom/**/*'],
rules: {
// Doesn’t understand that loom dependencies come from the root package.json
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['**/.eslintrc.js'],
env: {node: true},
},
{
files: ['*.stories.*', '*.test.*', '*.example.*'],
rules: {
'@shopify/jsx-no-hardcoded-content': 'off',
},
},
{
files: ['packages/ui-extensions-react/src/surfaces/*/hooks/**'],
rules: {
// This is necessary because https://github.com/Shopify/generate-docs
// cannot yet infer return types.
'@typescript-eslint/explicit-function-return-type': 'error',
},
},
{
files: ['packages/ui-extensions-react/src/surfaces/*/hooks/tests/**'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
{
files: [
'packages/ui-extensions/docs/surfaces/**/*.example.*',
'packages/ui-extensions/src/surfaces/**/*.example.*',
],
rules: {
'no-console': 'off',
'react/react-in-jsx-scope': 'off',
'@shopify/checkout-web/custom-error-subclassing': 'off',
'import/no-extraneous-dependencies': 'off',
'promise/catch-or-return': 'off',
},
},
],
};