-
Notifications
You must be signed in to change notification settings - Fork 46
/
.eslintrc.yaml
127 lines (115 loc) · 3.99 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
115
116
117
118
119
120
121
122
123
124
125
126
127
---
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: 2018
warnOnUnsupportedTypeScriptVersion: false
# To silence VS Code ESLint error of "cannot find 'tsconfig.json'", add entries like this
# to your "Preferences: Open User Settings (JSON)"
# "eslint.workingDirectories": [
# {"directory": "./packages/azure-openapi-validator/autorest", "changeProcessCWD": true}
# ],
# This solution is based on:
# https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-521142325
#
# For local development, you can also temporarily replace this:
#
# project: "./tsconfig.json"
#
# with this:
#
# project: "./tsconfig-base.json"
#
# This will break 'rush lint', though, for reasons listed above.
project: "./tsconfig.json"
sourceType: "module"
plugins:
- "@typescript-eslint"
- prettier
- unicorn
- node
- jest
- import
env:
es6: true
node: true
root: true
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
- plugin:node/recommended
- plugin:jest/recommended
- plugin:import/recommended
- plugin:import/typescript
globals:
Atomics: readonly
SharedArrayBuffer: readonly
rules:
"@typescript-eslint/no-this-alias": off
"@typescript-eslint/interface-name-prefix": off
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/no-explicit-any": off
"@typescript-eslint/no-empty-interface": off
"@typescript-eslint/no-namespace": off
"@typescript-eslint/explicit-member-accessibility": off
"@typescript-eslint/no-unused-vars": off
"@typescript-eslint/no-parameter-properties": off
"@typescript-eslint/no-angle-bracket-type-assertion": off
"@typescript-eslint/no-use-before-define": off
"@typescript-eslint/no-var-requires": off
"@typescript-eslint/no-empty-function": off
"@typescript-eslint/explicit-module-boundary-types": off
"@typescript-eslint/ban-types": off
"@typescript-eslint/consistent-type-assertions": off
"@typescript-eslint/no-non-null-assertion": off
"@typescript-eslint/no-non-null-asserted-optional-chain": off
"@typescript-eslint/no-floating-promises": warn
"require-atomic-updates": off
# Prettier config https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
prettier/prettier: off # Don't run prettier in eslint we have rush check-format for that.
arrow-body-style: off
prefer-arrow-callback: off
# Unicorn plugin config
unicorn/filename-case: warn
# =================================================
# Node plugin
# =================================================
# Prevent from using method that are not yet availalbe in the supported version of node.(see engines field of package.json)
node/no-unsupported-features/node-builtins: error
node/no-unsupported-features/es-builtins: error
node/no-unsupported-features/es-syntax: off # Disabling this one otherwise it will complain about typescript imports which get transpiled.
node/no-missing-import: off
node/no-missing-require: off
node/shebang: off
node/no-unpublished-import: off
# =================================================
# Jest plugin
# =================================================
jest/no-deprecated-functions: off
jest/expect-expect: off
jest/no-standalone-expect: off
jest/no-disabled-tests: off
jest/no-focused-tests: warn
jest/no-identical-title: warn
# =================================================
# Import plugin
# =================================================
import/no-default-export: off
import/no-self-import: warn # This cause many circular dependency issues with index files.
import/no-internal-modules: off
import/no-named-as-default: off
import/no-unresolved: off
import/order:
- warn
- groups: ["builtin", "external", "parent", "sibling", "index"]
alphabetize:
order: "asc"
caseInsensitive: true
# Basic config
no-console: warn
no-undef: off
no-unused-vars: off
no-multiple-empty-lines:
- warn
- max: 2
maxBOF: 0
maxEOF: 1