forked from mathieutu/resap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
85 lines (85 loc) · 3.03 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
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['airbnb', 'plugin:@typescript-eslint/recommended', 'plugin:@next/next/recommended'],
plugins: ['@typescript-eslint/eslint-plugin'],
root: true,
env: {
browser: true,
node: true,
jest: true,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: { delimiter: 'comma', requireLast: true },
singleline: { delimiter: 'comma', requireLast: false },
}],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-interface': 'off',
'arrow-parens': 'off', // Erreur avec les generics de TS.
'import/extensions': 'off',
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/label-has-associated-control': ['error', {
labelComponents: [],
labelAttributes: [],
controlComponents: [],
assert: 'either',
depth: 25,
}],
// 'max-len': ['error', { code: 120, ignorePattern: '^\\s*.*(c|C)lassName=' }],
'max-len': 'off',
'no-console': 'error',
'no-restricted-syntax': ['error',
{ selector: 'CallExpression[callee.name=\'dump\']', message: 'Dump expresions are not allowed' },
{ selector: 'CallExpression[callee.name=\'dumpParams\']', message: 'Dump expresions are not allowed' },
],
'object-curly-newline': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
'react/prop-types': 'off',
'react/jsx-key': ['error', { checkFragmentShorthand: true, checkKeyMustBeforeSpread: true }],
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/state-in-constructor': ['error', 'never'],
'spaced-comment': ['error', 'always', { markers: ['/'] }],
indent: 'off',
semi: ['error', 'never'],
},
overrides: [
{
files: ['**/*.js'],
rules: {
semi: ['error', 'always'],
'global-require': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
},
},
{
files: ['src/pages/**/*'],
rules: {
'import/no-default-export': 'off',
'import/prefer-default-export': 'error',
},
},
],
settings: {
'import/resolver': {
node: {
extensions: ['.json', '.d.ts', '.ts', '.tsx', '.js'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
};