-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
68 lines (68 loc) · 2.19 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
module.exports = {
env: {
es6: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
plugins: ['react', '@typescript-eslint'],
extends: ['airbnb-base', 'eslint:recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended'],
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 11,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
rules: {
quotes: ['error', 'single'],
semi: ['error', 'always'],
'@typescript-eslint/indent': ['error', 2],
indent: 0, // pour ne pas avoir l'erreur en doublon
'linebreak-style': ['error', 'unix'],
'react/display-name': 'off',
'react/hook-use-state': 'error',
'max-len': ['error', { code: 120, tabWidth: 2 }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'no-console': ['error', { allow: ['error'] }],
// Un-used AirBnb rules
'implicit-arrow-linebreak': 0,
'import/no-extraneous-dependencies': 0,
'import/extensions': ['error', 'never'],
'import/prefer-default-export': 0,
'import/no-unresolved': 0,
'no-underscore-dangle': 0,
'no-use-before-define': 0,
'func-names': 0,
'global-require': 0,
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
},
],
'object-curly-newline': ['error', { consistent: true }],
'operator-linebreak': ['error', 'before', { overrides: { '&&': 'after', '||': 'after', '=': 'after' } }],
'arrow-parens': [2, 'as-needed', { requireForBlockBody: true }],
'@typescript-eslint/no-unused-vars': 'error', // eslint ne gère pas les types, typescript les gère à sa place
'no-unused-vars': 'off', // Pour ne pas avoir l'erreur en doublon
'prefer-destructuring': ['error', { VariableDeclarator: { object: true, array: false } }],
'function-paren-newline': ['error', 'consistent'],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
},
globals: {
__DEV__: true,
Platform: true,
JSX: true,
FormData: true,
},
};