-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
57 lines (57 loc) · 1.71 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
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'prettier',
'prettier/@typescript-eslint'
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true // Allows for the parsing of JSX
}
},
rules: {
// add the prettier plugin to run for eslint
'prettier/prettier': ['error'],
'@typescript-eslint/indent': ['error', 'tab'],
'@typescript-eslint/explicit-function-return-type': ['error']
},
settings: {
react: {
version: 'detect' // Tells eslint-plugin-react to automatically detect the version of React to use
}
},
plugins: ['jest'],
overrides: [
{
// gather all of our js files to turn off some ts rules
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/no-var-requires': ['off']
},
env: {
node: true
}
},
{
files: ['*.tsx'],
rules: {
// turn off explicit return types for tsx files (React components)
'@typescript-eslint/explicit-function-return-type': ['off']
}
},
{
// gather all of our unit test files to turn on jest globals
files: ['*.test.tsx'],
env: {
jest: true
}
}
]
};