-
Notifications
You must be signed in to change notification settings - Fork 38
/
.eslintrc.js
84 lines (84 loc) · 2.16 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
module.exports = {
root: true,
env: {
node: true,
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
'plugin:prettier/recommended',
],
plugins: ['import', 'react', 'jsx-a11y'],
overrides: [
{
// Typescript
files: ['**/*.ts?(x)'],
extends: [
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
ecmaFeatures: { jsx: true },
project: ['./tsconfig.json', './packages/*/tsconfig.json'],
},
rules: {
'@typescript-eslint/consistent-type-exports': 'warn',
'@typescript-eslint/consistent-type-imports': 'warn',
},
},
{
files: ['storefront/**/*'],
extends: ['plugin:@next/next/recommended'],
},
],
rules: {
// https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
// Disabled because we use Typescript types for props
'react/prop-types': ['off'],
'react/jsx-no-bind': 'off',
'react/display-name': 'off',
'import/no-unresolved': 'error',
'import/namespace': ['error', { allowComputed: true }],
'import/no-named-as-default': 'off',
'@next/next/no-html-link-for-pages': ['error', 'apps/storefront/pages/'],
'import/order': [
'warn',
{
'newlines-between': 'always',
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
},
],
},
settings: {
react: {
version: '18',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
};