-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
72 lines (67 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
module.exports = {
env: {
browser: true,
es6: true,
'jest/globals': true,
},
extends: [
// 'airbnb',
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/react',
'prettier/@typescript-eslint',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
process: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'prettier', '@typescript-eslint', 'react-hooks', 'jest'],
rules: {
'no-inner-declarations': 0,
'react/display-name': 0,
'react/no-children-prop': 0,
'@typescript-eslint/no-namespace': 'off', // Namespaces are used to group features without the need for a class or module
'@typescript-eslint/explicit-function-return-type': 0, // Allow return type inference
'@typescript-eslint/prefer-interface': 0, // Experiment with removing this sometime
'react/prop-types': 0, // Prop Types don't add a lot when using TypeScript
'@typescript-eslint/no-non-null-assertion': 0, // Use this a lot where compiler doesn't pick up that an object will not be null
'@typescript-eslint/camelcase': 0, // Remove this if ever fully decoupled from fuse. Leaving in for compatibility for now
'@typescript-eslint/no-explicit-any': 0, // One day remove this. Using during transition from JS
'@typescript-eslint/ban-ts-ignore': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
// note you must disable the base rule as it can report incorrect errors
// Leaving unused vars has proven a useful Dev tool for indicating future Dev opportunities. Leaving as warning for now
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-empty-interface': 0, // Sometimes empty interfaces are useful as flags, or placeholders for future DEV
// Jest rules
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
settings: {
react: {
version: 'detect',
},
},
};