-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.yaml
114 lines (106 loc) · 3.1 KB
/
.eslintrc.yaml
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
root: true
env:
node: true
plugins:
- prefer-arrow-functions
- simple-import-sort
extends:
# Order matters
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:import/recommended
- plugin:node/recommended
- plugin:playwright/recommended
- prettier
parserOptions:
ecmaVersion: latest
sourceType: module
project: tsconfig.json
ignorePatterns:
[webpack/**, jest.config.js, jest_setup.ts, playwright.config.ts]
rules:
# Turn off base eslint rules in lieu of @typescript-eslint rules
no-return-await: off
no-shadow: off
no-unused-expressions: off
no-unused-vars: off
no-use-before-define: off
no-useless-constructor: off
"react/jsx-pascal-case": error
"@typescript-eslint/lines-between-class-members":
[error, always, { exceptAfterSingleLine: true }]
"@typescript-eslint/naming-convention":
- error
- selector: typeLike
format: [PascalCase]
- selector: function
format: [camelCase]
- selector: variable
modifiers: [global, const]
# The plugin can't differentiate between:
# - values, which should be UPPER_CASE
# - arrow functions, which should be camelCase
# - react components, which should be PascalCase
format: [UPPER_CASE, camelCase, PascalCase]
"@typescript-eslint/no-shadow": error
"@typescript-eslint/no-unused-expressions": [error]
"@typescript-eslint/no-unused-vars":
[error, { argsIgnorePattern: ^_, varsIgnorePattern: ^_ }]
"@typescript-eslint/no-use-before-define": [error]
"@typescript-eslint/no-useless-constructor": [error]
"@typescript-eslint/no-explicit-any": off
class-methods-use-this: off
curly: error
func-names: [error, as-needed]
func-style: [error, expression, { "allowArrowFunctions": true }]
import/extensions:
- error
- ignorePackages
- js: never
ts: never
tsx: never
jsx: never
import/no-extraneous-dependencies:
- error
- devDependencies: ["**/*.test.ts", "**/__tests__/**"]
import/no-unresolved: off
import/prefer-default-export: off
lines-between-class-members: off
max-len:
- error
- code: 120
comments: 130
tabWidth: 2
ignoreComments: false
ignoreTrailingComments: false
ignoreUrls: true
ignoreStrings: true
ignoreTemplateLiterals: true
ignoreRegExpLiterals: true
no-continue: off
no-param-reassign: [error, { props: false }]
no-restricted-syntax: off
node/no-extraneous-import: [error]
node/no-unpublished-import: off
node/no-missing-import: off
node/no-unsupported-features/es-syntax:
[error, { ignores: [modules, dynamicImport] }]
prefer-arrow-functions/prefer-arrow-functions:
- error # only allow arrow functions
- returnStyle: implicit # required to be set for autofixes
simple-import-sort/exports: error
simple-import-sort/imports: error
settings:
import/resolver:
typescript:
alwaysTryTypes: true
overrides:
- files: ["**/*test.ts"]
env:
jest: true
plugins:
- jest
extends:
- plugin:jest/recommended