-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
58 lines (58 loc) · 1.43 KB
/
.eslintrc.cjs
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
module.exports = {
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
// always try to resolve types under `<root>@types` directory
// even it doesn't contain any source code, like `@types/unist`
alwaysTryTypes: true,
},
},
},
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'airbnb',
'airbnb-typescript',
'plugin:import/recommended',
'plugin:import/typescript',
'next',
'plugin:@next/next/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
project: true,
tsconfigRootDir: __dirname,
},
overrides: [
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['./**/*.cjs', './**/*.js'],
},
],
plugins: ['import', 'react', '@typescript-eslint'],
rules: {
'no-unused-vars': ['error', { args: 'none' }],
'max-len': ['error', { code: 120 }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'import/no-unresolved': 'error',
'import/extensions': 'off',
'react/jsx-filename-extension': [2, { extensions: ['.jsx', '.ts', '.tsx'] }],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'off',
},
globals: {
JSX: true,
},
};