forked from Balmy-protocol/dca-fe
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
66 lines (66 loc) · 2.18 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
module.exports = {
plugins: ['@typescript-eslint', 'eslint-comments', 'promise', 'formatjs', 'jest'],
ignorePatterns: ['jest.config.ts', '.eslintrc.js'],
extends: [
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:eslint-comments/recommended',
'plugin:promise/recommended',
'prettier',
'plugin:jest/recommended',
],
env: {
node: true,
browser: true,
jest: true,
},
parserOptions: {
project: './tsconfig.json',
},
rules: {
'react/jsx-props-no-spreading': 'off',
'react/destructuring-assignment': ['error'],
// No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
'react/jsx-filename-extension': ['error'],
// Use function hoisting to improve code readability
'no-use-before-define': ['error'],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': ['error'],
'react/no-array-index-key': 'off',
'import/prefer-default-export': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: true, variables: true, typedefs: true },
],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'formatjs/no-offset': 'error',
'react/require-default-props': 'off',
// doesnt make sense to keep this active while we have ts
'react/prop-types': 'off',
'class-methods-use-this': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'eslint-comments/no-unlimited-disable': 'off',
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['state'] }],
},
overrides: [
{
files: ['*.js'],
rules: {
// Allow `require()`
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.spec.ts'],
plugins: ['jest'],
rules: {
// you should turn the original rule off *only* for test files
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
},
],
};