-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
50 lines (50 loc) · 1.44 KB
/
.eslintrc.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
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.dev.json"],
sourceType: "module",
},
plugins: ["@typescript-eslint", "import"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript",
"prettier",
],
rules: {
// Allow inference in function return type.
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// I like non-null assertions.
"@typescript-eslint/no-non-null-assertion": "off",
// Disallow default exports; only allow named exports.
"import/no-default-export": "error",
// Impose alphabetically ordered imports.
"import/order": "error",
// Allow implicit string casts in template literals.
"@typescript-eslint/restrict-template-expressions": "off",
// Allow ts-ignore with justification.
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
},
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
// Allow unused parameter names that start with _,
// like TypeScript does.
argsIgnorePattern: "^_",
},
],
},
};