-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
100 lines (100 loc) · 3.09 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['react-hooks'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:prettier/recommended',
'nextjs',
],
ignorePatterns: ['node_modules/', '**/__tests__/', '**/__mocks__/'],
settings: {
'import/resolver': {
'babel-module': {
alias: {
'@@': './src',
'@@components': './src/components',
'@@pages': './src/pages',
'@@utils': './src/utils',
'@@lib': './src/lib',
},
},
},
react: {
version: 'detect',
},
},
rules: {
'import/no-unresolved': 'off', // eslint has weird import issues, so just ignore them now
'import/extensions': 'off',
'import/no-cycle': 'off',
'react/jsx-curly-newline': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'prettier/prettier': 'warn',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'comma-dangle': [1, 'always-multiline'],
'no-shadow': 'off',
/**
* The following import rules are disabled as they are provided
* by typescript directly.
* See https://github.com/typescript-eslint/typescript-eslint/blob/f335c504bcf75623d2d671e2e784b047e5e186b9/docs/getting-started/linting/FAQ.md#eslint-plugin-import
*/
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default-member': 'off',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
groups: [
'builtin',
'external',
'internal',
['index', 'sibling', 'parent'],
],
pathGroups: [
{
pattern:
'@@{modules,components,screens,utils,assets,styled-components}',
group: 'internal',
position: 'before',
},
],
'newlines-between': 'always',
},
],
'react/prop-types': 'off',
'react/jsx-props-no-spreading': 'off',
'react/display-name': 'off',
'react/jsx-filename-extension': [
1,
{ extensions: ['.js', '.jsx', '.tsx'] },
],
},
};