forked from PROJET-3CS/client-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
92 lines (92 loc) · 2.35 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
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
extends: [
'airbnb',
'eslint-config-prettier',
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
tsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'eslint-plugin-prettier'],
ignorePatterns: ['App.tsx'],
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.ts'] }],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'import/no-extraneous-dependencies': 0,
'no-param-reassign': ['error', { props: false }],
'no-underscore-dangle': 0,
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-unused-vars': 'warn',
indent: ['error', 1],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'no-console': 1, // Warning to reduce console logs used throughout app
'react/prop-types': 0, // Not using prop-types because we have TypeScript
'newline-before-return': 1,
'no-useless-return': 1,
'prefer-const': 1,
'default-case': 1, // require `default` cases in `switch` statements
'default-case-last': 1, // enforce default clauses in switch statements to be last
eqeqeq: 1, // require the use of `===` and `!==`
'no-empty-function': 1,
'no-multi-spaces': 1,
'require-await': 1,
camelcase: 'error',
'max-lines': ['error', 200],
'max-nested-callbacks': ['error', 3],
'arrow-body-style': ['error', 'always'], // require braces around arrow function bodies
'no-duplicate-imports': 'error', // disallow duplicate module imports
'no-var': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true,
},
AssignmentExpression: {
array: true,
object: true,
},
},
{
enforceForRenamedProperties: false,
},
],
},
}