generated from JoshuaKGoldberg/create-typescript-app
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
80 lines (78 loc) · 1.94 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
es2022: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:regexp/recommended",
"prettier",
],
overrides: [
{
extends: ["plugin:markdown/recommended"],
files: ["**/*.{md}"],
processor: "markdown/markdown",
},
{
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:typescript-sort-keys/recommended",
"plugin:@typescript-eslint/strict",
],
files: ["**/*.{ts,tsx}"],
parserOptions: {
project: "./tsconfig.eslint.json",
},
rules: {
// These off-by-default rules work well for this repo and we like them on.
"deprecation/deprecation": "error",
},
},
{
files: ["*.json", "*.jsonc"],
excludedFiles: ["package.json"],
parser: "jsonc-eslint-parser",
rules: {
"jsonc/sort-keys": "error",
},
extends: ["plugin:jsonc/recommended-with-json"],
},
{
files: "**/*.test.ts",
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
},
},
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"deprecation",
"import",
"no-only-tests",
"regexp",
"simple-import-sort",
"typescript-sort-keys",
"vitest",
],
root: true,
rules: {
// These off-by-default rules work well for this repo and we like them on.
"import/extensions": ["error", "ignorePackages"],
"no-only-tests/no-only-tests": "error",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
// These on-by-default rules don't work well for this repo and we like them off.
"no-inner-declarations": "off",
// Stylistic concerns that don't interfere with Prettier
"padding-line-between-statements": "off",
"@typescript-eslint/padding-line-between-statements": [
"error",
{ blankLine: "always", next: "*", prev: "block-like" },
],
},
};