-
Notifications
You must be signed in to change notification settings - Fork 47
/
.eslintrc.yml
138 lines (131 loc) · 3.36 KB
/
.eslintrc.yml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2020
sourceType: module
ecmaFeatures:
jsx: true
impliedStrict: true
project: ./tsconfig-eslint.json
plugins:
- react
- '@typescript-eslint/eslint-plugin'
- react-hooks
- jest
- import
env:
browser: true
node: true
shared-node-browser: true
es6: true
jest: true
globals:
__DEV__: readonly
extends:
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- plugin:import/errors
- plugin:import/typescript
- prettier
settings:
react:
version: detect
import/resolver:
typescript:
alwaysTryTypes: true
alias:
- ['@wings-software', '@harness']
rules:
# custom rules
no-document-body-snapshot: 2
aliased-module-imports: 2
strings-restrict-modules: 2
duplicate-data-tooltip-id: 'warn'
jest-no-mock:
- 2
- module:
react-router-dom: 'react-router-dom should not be mocked. Wrap the component inside TestWrapper instead'
# built-in
no-console: 2
semi: 0
no-await-in-loop: 2
no-shadow: 0
# react hooks
react-hooks/rules-of-hooks: 2
react-hooks/exhaustive-deps: 1
# react
react/prop-types: 0
react/display-name: 1
#typescript
'@typescript-eslint/no-use-before-define': 0
'@typescript-eslint/explicit-function-return-type':
- 1
- allowExpressions: true
no-unused-vars: 0
'@typescript-eslint/no-unused-vars':
- 2
- vars: all
args: after-used
ignoreRestSiblings: true
argsIgnorePattern: ^_
'@typescript-eslint/member-delimiter-style': 0
'@typescript-eslint/no-shadow': 2
'@typescript-eslint/no-extra-semi': 0
'@typescript-eslint/no-duplicate-imports': 2
#import
import/order:
- error
- groups:
- builtin
- external
- internal
- - parent
- sibling
pathGroups:
- pattern: '*.scss'
group: index
position: after
patternOptions:
matchBase: true
import/no-useless-path-segments: 2
no-restricted-imports:
- error
- patterns:
- lodash.*
paths:
- lodash
- name: yaml
importNames:
- stringify
message: 'Please use yamlStringify from @common/utils/YamlHelperMethods instead of this'
- name: react-router
message: 'import from "react-router-dom" instead'
no-restricted-syntax:
- error
- selector: "CallExpression[callee.name='useContext'][arguments.0.name='PipelineContext']"
message: 'Please use usePipelineContext instead'
- selector: "CallExpression[callee.object.name='React'][callee.property.name='useContext'][arguments.0.name='PipelineContext']"
message: 'Please use usePipelineContext instead'
overrides:
- files:
- '**/*.test.ts'
- '**/*.test.tsx'
rules:
'@typescript-eslint/no-magic-numbers': 0
'@typescript-eslint/no-non-null-assertion': 0
'@typescript-eslint/no-non-null-asserted-optional-chain': 0
'@typescript-eslint/no-explicit-any': 0
no-await-in-loop: 0
jest/consistent-test-it:
- 2
- fn: test
withinDescribe: test
jest/expect-expect: 2
jest/no-disabled-tests: 2
jest/no-commented-out-tests: 2
- files:
- services.tsx
rules:
'@typescript-eslint/explicit-function-return-type': 0
'@typescript-eslint/no-explicit-any': 0