-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
65 lines (64 loc) · 2.51 KB
/
index.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
module.exports = {
extends: 'airbnb',
plugins: ['@typescript-eslint', 'react-hooks'],
// Override di Airbnb
rules: {
'arrow-parens': ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'class-methods-use-this': 'off',
'curly': ['error', 'multi-line'],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'indent': ['error', 4],
'react/jsx-filename-extension': [2, { extensions: ['.jsx', '.tsx'] }],
'react/jsx-indent': ['error', 4],
'no-restricted-syntax': 'off',
'quote-props': ['error', 'consistent-as-needed'],
'strict': ['error', 'global'],
// object literals
'object-curly-newline': ['error', { multiline: true, consistent: true }],
'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
'object-shorthand': ['error'],
'no-case-declarations': 'off',
// perchè.. sì
'no-plusplus': 'off',
'no-shadow': 'off',
'no-continue': 'off',
'radix': 'off',
// Evitiamo i conflitti con typescript-eslint
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
}],
'no-use-before-define': 'off',
'react/jsx-indent-props': 'off',
// Non rilevante
'react/no-unused-state': 'off',
// Inutili
'react/prop-types': 'off',
'react/require-default-props': 'off',
'react/no-unused-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-unescaped-entities': 'off',
// React
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
'react/jsx-handler-names': ['error', {
eventHandlerPrefix: 'on|handle',
eventHandlerPropPrefix: 'on',
checkLocalVariables: true,
}],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// Non ncessari con la versione 17 di React
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'import/extensions': 'off',
'no-param-reassign': 'off',
'no-undef-init': 'off',
'max-len': ['error', { code: 192 }],
},
};