-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
113 lines (113 loc) · 3.07 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
113
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:jsx-a11y/recommended',
'plugin:@next/next/recommended',
'prettier',
],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'default', format: null },
{ selector: 'enumMember', format: ['PascalCase'] },
{ selector: 'typeLike', format: ['PascalCase'] },
],
'import/no-duplicates': 'error',
'import/extensions': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
alphabetize: { order: 'asc' },
'newlines-between': 'never',
pathGroups: [
{
pattern: '{next,next/**,react}',
group: 'external',
position: 'before',
},
{
pattern: '{src,pages,__tests__}/**',
group: 'parent',
position: 'before',
},
],
},
],
'import/newline-after-import': 'error',
'import/no-named-default': 'error',
'import/no-named-as-default-member': 'off',
'import/no-anonymous-default-export': 'error',
'import/no-useless-path-segments': 'error',
'import/dynamic-import-chunkname': 'error',
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
curly: 'error',
eqeqeq: 'error',
'no-console': 'error',
'@typescript-eslint/no-loss-of-precision': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'react/jsx-no-useless-fragment': 'error',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
paths: ['.'], // Allows to import url starting from 'src'
},
},
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.test.tsx', '__tests__/**.*'],
rules: {
'import/no-anonymous-default-export': 'off',
'@typescript-eslint/no-empty-function': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
},
},
{
files: ['onesky/**.ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
};