-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc
58 lines (58 loc) · 2.55 KB
/
.eslintrc
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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.json"]
},
"plugins": [
// This enables using new lint rules powered by the TypeScript compiler API.
// https://github.com/typescript-eslint/typescript-eslint
"@typescript-eslint",
// This makes it so the IDE reports lint rejections as warnings only. This is
// better than errors because most lint rejections are not runtime errors. This
// allows IDE errors to be exclusive for e.g. static type errors which often are
// reflective of real runtime errors.
// https://github.com/bfanger/eslint-plugin-only-warn
"only-warn",
// This enables the use of a lint rule to reject function declarations. This is
// preferable as a way to encourage higher order function usage. For example it is not
// possible to wrap a function declaration with Open Telemetry instrumentation but it is
// possible to wrap an arrow function since its an expression.
// https://github.com/TristonJ/eslint-plugin-prefer-arrow
"prefer-arrow",
// This enables the use of a lint rule to reject use of @deprecated functions.
// https://github.com/gund/eslint-plugin-deprecation
"deprecation",
// https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
"tsdoc"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"overrides": [],
"rules": {
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-imports": "warn",
// Enforce backticks
// Note you must disable the base rule as it can report incorrect errors.
"quotes": "off",
"@typescript-eslint/quotes": ["warn", "backtick"],
"tsdoc/syntax": "warn",
"deprecation/deprecation": "warn",
"prefer-arrow/prefer-arrow-functions": "warn",
// TypeScript makes these safe & effective
"no-case-declarations": "off",
// Same approach used by TypeScript noUnusedLocals
"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
// Needed when working with .mts/.cts where a lone e.g. <T> is not allowed
"@typescript-eslint/no-unnecessary-type-constraint": "off",
// Useful for organizing Types
"@typescript-eslint/no-namespace": "off"
}
}