This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc-ts.js
56 lines (55 loc) · 1.68 KB
/
.eslintrc-ts.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
// Copyright (c) 2022-2024 Developer Innovations, LLC
module.exports = {
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
parserOptions: {
// Find the tsconfig.json nearest each source file.
project: true,
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/no-unused-expressions": ["error"],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-use-before-define": ["error", { functions: false }],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
allowString: false,
allowNumber: false,
allowNullableObject: false,
},
],
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
},
overrides: [
{
files: ["**/*.js", "**/*.cjs", "**/*.mjs"],
rules: {
// JS files don't have explicit types, and this lint rule fails even if they have doc
// comment type annotations.
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// Allow require() in JS files (most of which are CommonJS, not ESM).
"@typescript-eslint/no-var-requires": "off",
},
},
],
settings: {
"import/resolver": {
typescript: true,
},
},
};