forked from Shopify/hydrogen-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
83 lines (82 loc) · 2.11 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
// @ts-check
module.exports = {
ignorePatterns: ['**/storefront-api-types.ts'],
root: true,
plugins: ['eslint-plugin-tsdoc'],
extends: ['plugin:node/recommended', 'plugin:hydrogen/typescript'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
rules: {
'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/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',
},
},
],
};