-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
89 lines (84 loc) · 2.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
const globalRules = {
'no-console': 'off',
'no-underscore-dangle': 'off',
'no-restricted-exports': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-unescaped-entities': 'off',
'react/require-default-props': 'off',
'import/prefer-default-export': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
['^\\u0000'],
['^node:'],
['^react(/.+)?$', '^next(/.+)?$', '^@?\\w'],
['^'],
['^\\.'],
],
},
],
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-null': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/new-for-builtins': 'off',
'unicorn/filename-case': 'off',
'sonarjs/prefer-single-boolean-return': 'error',
'sonarjs/no-nested-template-literals': 'error',
'sonarjs/no-element-overwrite': 'error',
};
module.exports = {
extends: ['airbnb', 'plugin:unicorn/recommended', 'next/core-web-vitals', 'prettier'],
plugins: ['simple-import-sort', 'sonarjs'],
rules: {
...globalRules,
'import/prefer-default-export': 'off',
},
overrides: [
{
files: ['./*.js'],
rules: {
'unicorn/prefer-module': 'off',
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['*.ts?(x)'],
parserOptions: {
project: './tsconfig.json',
},
extends: [
'airbnb',
'airbnb-typescript',
'plugin:unicorn/recommended',
'next/core-web-vitals',
'prettier',
],
rules: {
...globalRules,
'global-require': 'off',
'unicorn/prefer-module': 'off',
},
},
{
files: ['src/**/*'],
parserOptions: {
project: './tsconfig.json',
},
extends: [
'airbnb',
'airbnb-typescript',
'plugin:unicorn/recommended',
'next/core-web-vitals',
'prettier',
],
rules: {
...globalRules,
},
},
],
};