-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
74 lines (74 loc) · 2.06 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',
extends: 'airbnb-typescript-prettier',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.d.ts', '**/*.config.js', '**/*.js'],
env: {
jest: true,
},
rules: {
'react/jsx-props-no-spreading': ['off'],
'class-methods-use-this': 'off',
'react/prop-types': 'off',
'import/no-extraneous-dependencies': ['off'],
'import/no-named-as-default': ['off'],
'@typescript-eslint/no-unused-vars': ['off'],
'@typescript-eslint/no-unused-vars-experimental': ['off'],
'no-useless-constructor': ['off'],
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'jsx-a11y/anchor-is-valid': ['off'],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
// This rule doesn't work with TS
'react/static-property-placement': ['off'],
'no-restricted-imports': [
'error',
{
paths: [
'@trunkrs/shipping-portal-data',
'@trunkrs/shipping-portal-business',
'@trunkrs/shipping-portal-shared',
{
name: '@trunkrs/shipping-portal-v2-data',
message: 'Imports from this path are restricted.',
},
{
name: '@material-ui/core',
message:
"Please use specific imports instead. Example: '@material-ui/core/Button'.",
},
{
name: 'lodash',
message: "Please use specific imports like 'lodash/get' instead.",
},
],
patterns: [
'@trunkrs/shipping-portal-data/private/**/*',
'@trunkrs/shipping-portal-business/private/**/*',
'@trunkrs/shipping-portal-shared/private/**/*',
]
},
],
},
overrides: [
{
files: ['*.tsx'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': ['off'],
},
},
],
settings: {
react: {
version: 'detect',
},
},
}