-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
75 lines (75 loc) · 2.26 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
module.exports = {
root: true,
env: {
browser: true,
es6: true,
jest: true
},
extends: [
// creates consistency with eslint rules of create-react-app
// this config extends from create-react-app (see .env file)
'react-app',
// covers rules from eslint, react, react-a11y (covers NOT react-hooks => airbnb/hooks)
'airbnb-typescript',
'airbnb/hooks',
'plugin:jest/recommended',
// disables javascript rules from eslint:recommended conflicting with typescript
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// adds additional typescript rules which require type checking support
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// prettier, prettier/react, prettier/@typescript-eslint
// disable stylistic rules for javascript, react, typescript
'prettier',
'prettier/react',
'prettier/@typescript-eslint'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: 'module',
// 'tsconfigRootDir' and 'project' are needed for proper type checking support
// needed for 'plugin:@typescript-eslint/recommended-requiring-type-checking'
// NOTE: these configs double the time for linting the project
tsconfigRootDir: __dirname,
project: ['./tsconfig.json']
},
plugins: ['jest', '@typescript-eslint', 'functional'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: ['src/setupTests.ts', '**/*.test.tsx'] }
],
'@typescript-eslint/explicit-function-return-type': [
'error',
{ allowExpressions: true, allowTypedFunctionExpressions: true }
],
'@typescript-eslint/member-ordering': 'error',
'functional/immutable-data': 'error',
'functional/no-let': 'error',
'functional/prefer-type-literal': 'error'
},
overrides: [
{
files: ['react-app-env.d.ts'],
rules: {
'spaced-comment': 'off'
}
},
{
files: ['serviceWorker.ts'],
rules: {
'no-console': 'off',
'no-param-reassign': 'off',
'functional/immutable-data': 'off'
}
}
]
};