-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
53 lines (52 loc) · 1.44 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
/** @type {import("@types/eslint").Linter.Config} */
module.exports = {
env: {
es2022: true,
node: true,
},
extends: ["eslint:recommended", "plugin:n/recommended"],
overrides: [
{
extends: ["plugin:@typescript-eslint/recommended"],
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
rules: {
// These off-by-default rules work well for this repo and we like them on.
"logical-assignment-operators": [
"error",
"always",
{ enforceForIfStatements: true },
],
"operator-assignment": "error",
"@typescript-eslint/consistent-type-imports": "error",
},
},
{
files: "**/*.md/*.ts",
rules: {
"n/no-missing-import": ["error", { allowModules: ["schemar"] }],
},
},
{
extends: ["plugin:@typescript-eslint/recommended-type-checked"],
files: ["**/*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.eslint.json",
},
},
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
reportUnusedDisableDirectives: true,
root: true,
rules: {
// These off/less-strict-by-default rules work well for this repo and we like them on.
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
// These on-by-default rules don't work well for this repo and we like them off.
"no-case-declarations": "off",
"no-constant-condition": "off",
"no-inner-declarations": "off",
"no-mixed-spaces-and-tabs": "off",
},
};