-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
115 lines (112 loc) · 2.7 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const commonIgnoredRules = {
"no-console": ["error", { allow: ["warn", "error"] }],
"no-param-reassign": "off",
"arrow-body-style": ["error", "as-needed"],
"import/no-named-as-default": "off",
"import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
"import/no-extraneous-dependencies": "off",
"node/callback-return": "off",
"func-style": "off",
"simple-import-sort/imports": "off",
"unicorn/no-array-reduce": "off",
"canonical/sort-keys": "off",
"canonical/import-specifier-newline": "off",
"canonical/destructuring-property-newline": "off",
"canonical/filename-match-exported": "off",
"canonical/filename-match-regex": "off",
"canonical/id-match": "off",
"canonical/export-specifier-newline": "off",
"zod/require-strict": "off",
};
const commonTypescriptIgnoredRules = {
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/naming-convention": ["off"],
};
const commonNodeIgnoredRules = {
...commonIgnoredRules,
"import/no-useless-path-segments": "off",
};
/**
* @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config}
*/
module.exports = {
ignorePatterns: ["!**/.*"],
overrides: [
{
files: ["*.js", "*.cjs"],
extends: [
"canonical",
"canonical/node",
"canonical/regexp",
"canonical/jsdoc",
"canonical/zod",
"prettier",
],
settings: {
jsdoc: {
mode: "typescript",
},
},
rules: {
...commonNodeIgnoredRules,
},
overrides: [
{
files: ["*.js"],
extends: ["canonical/module"],
},
],
},
{
files: ["./*.ts", "scripts/**/*.ts", "src/**/*.ts"],
extends: [
"canonical",
"canonical/node",
"canonical/module",
"canonical/typescript",
"canonical/typescript-type-checking",
"canonical/jsdoc",
"canonical/regexp",
"canonical/zod",
"prettier",
],
parserOptions: {
project: "./tsconfig.json",
},
settings: {
jsdoc: {
mode: "typescript",
},
},
rules: {
...commonNodeIgnoredRules,
...commonTypescriptIgnoredRules,
},
},
{
files: ["*.json", ".all-contributorsrc"],
excludedFiles: [".vscode/**/*.json"],
parser: "jsonc-eslint-parser",
extends: ["plugin:jsonc/recommended-with-json", "plugin:jsonc/prettier"],
},
{
files: [".vscode/**"],
parser: "jsonc-eslint-parser",
extends: ["plugin:jsonc/recommended-with-jsonc", "plugin:jsonc/prettier"],
},
{
files: ["*.yaml", "*.yml"],
parser: "yaml-eslint-parser",
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
},
{
files: ["*.toml"],
parser: "toml-eslint-parser",
extends: ["plugin:toml/standard"],
},
],
};