-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
74 lines (73 loc) · 2.34 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
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
extends: [
'xo',
'xo-react',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'prettier/react',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: [
'jest',
'filenames'
],
rules: {
'new-cap': 'off',
'react/jsx-sort-props': 'off',
'react/jsx-no-bind': 'warn',
'react/no-deprecated': 'warn',
'react/no-unused-prop-types': 'off',
'react/require-default-props': 'off',
'valid-jsdoc': 'off',
'padding-line-between-statements': 'off',
'lines-between-class-members': 'off',
'capitalized-comments': 'off',
'no-multi-assign': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-function-return-type': ['error', {allowHigherOrderFunctions: true, allowTypedFunctionExpressions: true}],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'warn', // ONLY WHILE WE STILL HAVE JS FILES
'filenames/match-regex': [2, '^[a-z0-9\\-\\.]+$']
},
overrides: [
{
files: ['**/*.{js,jsx}'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'dot-notation': 'warn',
'no-else-return': 'warn',
'no-unneeded-ternary': 'warn',
'react/jsx-curly-brace-presence': 'warn',
'react/jsx-fragments': 'warn',
'react/no-array-index-key': 'warn',
'react/no-unsafe': 'warn',
'react/button-has-type': 'warn'
}
},
{
files: ['**/*.tsx'],
rules: {
'react/prop-types': 'off'
}
}
],
env: {
'jest/globals': true,
browser: true
},
globals: {
'__DEV__': true,
'__DEVTOOLS__': true,
'__VERSION__': true
},
settings: {
react: {
version: 'detect'
}
}
};