-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
118 lines (118 loc) · 2.7 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
114
115
116
117
118
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
'formatjs',
'testing-library',
'jest-dom',
'@mizdra/layout-shift',
'react-hooks',
'lodash',
'@calm/react-intl',
'simple-import-sort',
'import',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:testing-library/dom',
'plugin:jest-dom/recommended',
'plugin:@next/next/recommended',
],
root: true,
env: {
browser: true,
jest: true,
},
rules: {
'@calm/react-intl/missing-formatted-message': [
'error',
{
noTrailingWhitespace: true,
ignoreLinks: false,
enforceLabels: true,
enforceImageAlts: true,
enforceInputProps: true,
},
],
'@calm/react-intl/missing-attribute': [
'error',
{
noTrailingWhitespace: true,
noSpreadOperator: true,
requireDescription: false,
formatDefineMessages: true,
requireIdAsString: true,
requireDefaultMessage: true,
},
],
'@calm/react-intl/missing-values': 2,
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '_',
argsIgnorePattern: '_',
},
],
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
},
],
'no-mixed-spaces-and-tabs': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'testing-library/prefer-screen-queries': 'off',
'testing-library/await-async-utils': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'formatjs/no-offset': 'error',
'@mizdra/layout-shift/require-size-attributes': 2,
'react/jsx-curly-brace-presence': ['error', 'never'],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'lodash/import-scope': ['error', 'method'],
'simple-import-sort/imports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
},
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: [
'*.spec.ts',
'*.spec.tsx',
'**/__mocks__/**/*',
'**/__tests__/**/*',
'src/lib/test/**/*',
'testSetup.ts',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@calm/react-intl/missing-formatted-message': 'off',
'@calm/react-intl/missing-attribute': 'off',
'@calm/react-intl/missing-values': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '_',
argsIgnorePattern: '_',
caughtErrorsIgnorePattern: '_',
},
],
'testing-library/no-node-access': 'off',
},
},
],
};