-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.cjs
More file actions
84 lines (82 loc) · 2.45 KB
/
eslint.config.cjs
File metadata and controls
84 lines (82 loc) · 2.45 KB
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
const OFF = 0;
const WARNING = 1;
const ERROR = 2;
const isProduction = process.env.NODE_ENV === 'production';
module.exports = [
{
files: ['**/*.{ts,tsx,js,jsx}'],
languageOptions: {
ecmaVersion: 2018,
sourceType: 'module',
parser: require('@typescript-eslint/parser'),
globals: {
browser: true,
jest: true,
jasmine: true,
},
},
plugins: {
react: require('eslint-plugin-react'),
'react-hooks': require('eslint-plugin-react-hooks'),
prettier: require('eslint-plugin-prettier'),
'@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
'no-inline-styles': require('eslint-plugin-no-inline-styles'),
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'no-console': isProduction ? ERROR : WARNING,
'no-eval': ERROR,
'react-hooks/rules-of-hooks': ERROR,
'react-hooks/exhaustive-deps': ERROR,
'max-params': [ERROR, 3],
'no-debugger': ERROR,
'no-nested-ternary': ERROR,
'object-shorthand': ERROR,
semi: [ERROR, 'always'],
'no-extra-semi': OFF,
quotes: [ERROR, 'single', { avoidEscape: true }],
'no-inline-styles/no-inline-styles': ERROR,
'no-unused-vars': OFF,
'no-use-before-define': OFF,
'react/react-in-jsx-scope': OFF,
'@typescript-eslint/no-non-null-assertion': ERROR,
},
},
{
files: ['**/*.test.tsx', '**/*.test.ts'],
plugins: {
vitest: require('eslint-plugin-vitest'),
jasmine: require('eslint-plugin-jasmine'),
},
rules: {
'custom-rules/no-arrow-function-inline': OFF,
'custom-rules/prefer-use-callback': OFF,
'@typescript-eslint/typedef': OFF,
'vitest/prefer-called-with': [ERROR],
'vitest/consistent-test-it': ERROR,
'vitest/max-expects': [ERROR, { max: 2 }],
'vitest/no-disabled-tests': ERROR,
'vitest/no-focused-tests': ERROR,
'vitest/prefer-hooks-in-order': ERROR,
'vitest/prefer-hooks-on-top': ERROR,
'vitest/prefer-lowercase-title': [
ERROR,
{
ignore: ['describe'],
},
],
'jasmine/new-line-between-declarations': ERROR,
'jasmine/new-line-before-expect': ERROR,
'jasmine/expect-matcher': ERROR,
'jasmine/no-suite-dupes': [ERROR, 'branch'],
'jasmine/no-spec-dupes': [ERROR, 'branch'],
},
},
{
ignores: ['node_modules/*', 'eslint.config.cjs', 'coverage/*'],
},
];