-
Notifications
You must be signed in to change notification settings - Fork 323
/
.eslintrc.js
112 lines (111 loc) · 2.79 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
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
// @ts-check
module.exports = {
ignorePatterns: [
'**/storefront-api-types.ts',
'**/storefront-api-types.d.ts',
'examples/**',
],
root: true,
plugins: ['eslint-plugin-tsdoc'],
extends: [
'plugin:node/recommended',
'plugin:hydrogen/recommended',
'plugin:hydrogen/typescript',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
rules: {
'jest/no-disabled-tests': 'off',
'jest/no-export': 'off',
'jsx-a11y/iframe-has-title': 'off',
'no-console': 'off',
'no-constant-condition': 'off',
'jest/no-done-callback': 'off',
'tsdoc/syntax': 'error',
'node/no-missing-import': [
'error',
{
allowModules: ['types', 'testUtils', '@shopify/hydrogen'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'],
},
],
'node/no-extraneous-import': [
'error',
{
allowModules: ['@shopify/hydrogen', '@shopify/react-testing'],
},
],
'node/no-extraneous-require': [
'error',
{
allowModules: ['@shopify/hydrogen'],
},
],
'node/no-unpublished-import': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'node/no-unsupported-features/es-builtins': [
'error',
// We need to manually specify a min-version since we can't use `engine`
{
version: '>=14.0.0',
ignores: [],
},
],
'node/no-unsupported-features/node-builtins': [
'error',
// We need to manually specify a min-version since we can't use `engine`
{
version: '>=14.0.0',
ignores: [],
},
],
'prefer-const': [
'warn',
{
destructuring: 'all',
},
],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
overrides: [
{
files: ['packages/eslint-plugin/**'],
rules: {
'hydrogen/server-component-banned-hooks': 'off',
'hydrogen/prefer-image-component': 'off',
'jsx-a11y/img-redundant-alt': 'off',
'no-prototype-builtins': 'off',
},
},
{
files: ['packages/hydrogen/**'],
rules: {
'hydrogen/prefer-gql': 'off',
},
},
{
files: ['packages/playground/**'],
rules: {
'node/no-extraneous-import': 'off',
'node/no-extraneous-require': 'off',
},
},
{
files: ['**/*.example.*'],
rules: {
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/jsx-key': 'off',
'react-hooks/rules-of-hooks': 'off',
'node/no-extraneous-import': 'off',
'node/no-missing-import': 'off',
},
},
],
};