-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.eslintrc.cjs
99 lines (92 loc) · 2.5 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
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
'use strict';
module.exports = {
extends: ['airbnb', 'airbnb/hooks', 'plugin:import/typescript'],
plugins: ['compat', 'react-hooks'],
parserOptions: {
ecmaVersion: 2022,
},
rules: {
'arrow-body-style': 'off',
'no-underscore-dangle': ['error', { allow: ['_id'] }],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
}],
// Not true anymore
'react/react-in-jsx-scope': 'off',
'react/no-unused-prop-types': ['error', { skipShapeProps: true }],
'react/forbid-prop-types': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'react/static-property-placement': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/function-component-definition': ['off', {
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
}],
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
},
settings: {
polyfills: [
'Array.from',
'Number.isFinite',
'Number.isNaN',
'Object.assign',
'Object.is',
'Object.values',
'Promise',
'AbortController',
'fetch',
'Headers',
'URL',
'CSS.escape',
],
},
overrides: [
{
files: ['**/*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
},
{
files: ['src/reducers/*'],
rules: {
// Reducers use default params differently
'default-param-last': 'off',
'no-param-reassign': ['error', {
props: true,
ignorePropertyModificationsFor: ['state'],
}],
},
},
{
files: ['src/**/*.{js,jsx}'],
rules: {
'compat/compat': 'error',
},
},
{
files: ['tasks/**/*.{js,jsx}', '*.config.js', '.eslintrc.js', 'test/*.js'],
parserOptions: {
sourceType: 'script',
},
rules: {
strict: ['error', 'global'],
'no-console': 'off',
},
},
{
files: ['**/__tests__/**/*.{js,jsx}'],
plugins: ['eslint-plugin-jest', 'eslint-plugin-jest-dom', 'eslint-plugin-testing-library'],
extends: ['plugin:jest/recommended', 'plugin:jest-dom/recommended', 'plugin:testing-library/react'],
env: {
jest: true,
},
},
],
};