@kazupon/eslint-config 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/config.d.cts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/configs/comments.d.cts +2 -2
- package/dist/configs/comments.d.ts +2 -2
- package/dist/configs/javascript.d.cts +2 -2
- package/dist/configs/javascript.d.ts +2 -2
- package/dist/configs/jsdoc.d.cts +2 -2
- package/dist/configs/jsdoc.d.ts +2 -2
- package/dist/configs/jsonc.d.cts +2 -2
- package/dist/configs/jsonc.d.ts +2 -2
- package/dist/configs/prettier.d.cts +2 -2
- package/dist/configs/prettier.d.ts +2 -2
- package/dist/configs/promise.d.cts +2 -2
- package/dist/configs/promise.d.ts +2 -2
- package/dist/configs/regexp.d.cts +2 -2
- package/dist/configs/regexp.d.ts +2 -2
- package/dist/configs/toml.d.cts +2 -2
- package/dist/configs/toml.d.ts +2 -2
- package/dist/configs/typescript.d.cts +1 -1
- package/dist/configs/typescript.d.ts +1 -1
- package/dist/configs/unicorn.d.cts +2 -2
- package/dist/configs/unicorn.d.ts +2 -2
- package/dist/configs/vue.d.cts +2 -2
- package/dist/configs/vue.d.ts +2 -2
- package/dist/configs/yml.d.cts +2 -2
- package/dist/configs/yml.d.ts +2 -2
- package/dist/index.cjs +190 -119
- package/dist/index.js +104 -101
- package/dist/types/gens/javascript.d.cts +5 -9
- package/dist/types/gens/javascript.d.ts +5 -9
- package/dist/types/gens/promise.d.cts +10 -4
- package/dist/types/gens/promise.d.ts +10 -4
- package/dist/types/gens/typescript.d.cts +62 -737
- package/dist/types/gens/typescript.d.ts +62 -737
- package/dist/types/overrides.d.cts +2 -2
- package/dist/types/overrides.d.ts +2 -2
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ function defineConfig(...configs) {
|
|
|
11
11
|
//#region src/utils.ts
|
|
12
12
|
async function interopDefault(mod) {
|
|
13
13
|
const resolved = await mod;
|
|
14
|
-
return
|
|
14
|
+
return resolved.default || resolved;
|
|
15
15
|
}
|
|
16
16
|
async function loadPlugin(name) {
|
|
17
17
|
const mod = await import(name).catch((error) => {
|
|
@@ -25,31 +25,31 @@ async function loadPlugin(name) {
|
|
|
25
25
|
//#region src/configs/javascript.ts
|
|
26
26
|
async function javascript(options = {}) {
|
|
27
27
|
const { rules: overrideRules = {} } = options;
|
|
28
|
-
const js = await loadPlugin(
|
|
28
|
+
const js = await loadPlugin("@eslint/js");
|
|
29
29
|
return [{
|
|
30
|
-
name:
|
|
31
|
-
...
|
|
30
|
+
name: "eslint/defaults/rules",
|
|
31
|
+
...js.configs.recommended
|
|
32
32
|
}, {
|
|
33
|
-
name:
|
|
33
|
+
name: "@kazupon/javascript/@eslint/js",
|
|
34
34
|
languageOptions: {
|
|
35
35
|
ecmaVersion: 2022,
|
|
36
36
|
globals: {
|
|
37
37
|
...globals.browser,
|
|
38
38
|
...globals.node,
|
|
39
39
|
...globals.es2022,
|
|
40
|
-
document:
|
|
41
|
-
navigator:
|
|
42
|
-
window:
|
|
40
|
+
document: "readonly",
|
|
41
|
+
navigator: "readonly",
|
|
42
|
+
window: "readonly"
|
|
43
43
|
},
|
|
44
44
|
parserOptions: {
|
|
45
|
-
ecmaFeatures: {jsx: true},
|
|
45
|
+
ecmaFeatures: { jsx: true },
|
|
46
46
|
ecmaVersion: 2022,
|
|
47
|
-
sourceType:
|
|
47
|
+
sourceType: "module"
|
|
48
48
|
},
|
|
49
|
-
sourceType:
|
|
49
|
+
sourceType: "module"
|
|
50
50
|
},
|
|
51
|
-
linterOptions: {reportUnusedDisableDirectives: true},
|
|
52
|
-
rules: {...overrideRules}
|
|
51
|
+
linterOptions: { reportUnusedDisableDirectives: true },
|
|
52
|
+
rules: { ...overrideRules }
|
|
53
53
|
}];
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,58 +57,58 @@ async function javascript(options = {}) {
|
|
|
57
57
|
//#region src/configs/comments.ts
|
|
58
58
|
async function comments(options = {}) {
|
|
59
59
|
const { rules: overrideRules = {} } = options;
|
|
60
|
-
const comments$1 = await loadPlugin(
|
|
60
|
+
const comments$1 = await loadPlugin("@eslint-community/eslint-plugin-eslint-comments");
|
|
61
61
|
return [{
|
|
62
|
-
name:
|
|
63
|
-
plugins: {
|
|
64
|
-
rules: {...
|
|
62
|
+
name: "@eslint-community/eslint-comments/recommended",
|
|
63
|
+
plugins: { "@eslint-community/eslint-comments": comments$1 },
|
|
64
|
+
rules: { ...comments$1.configs.recommended.rules }
|
|
65
65
|
}, {
|
|
66
|
-
name:
|
|
67
|
-
rules: {...overrideRules}
|
|
66
|
+
name: "@kazupon/eslint-comments",
|
|
67
|
+
rules: { ...overrideRules }
|
|
68
68
|
}];
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/globs.ts
|
|
73
|
-
const GLOB_JS =
|
|
74
|
-
const GLOB_JSX =
|
|
75
|
-
const GLOB_TS =
|
|
76
|
-
const GLOB_TSX =
|
|
77
|
-
const GLOB_JSON =
|
|
78
|
-
const GLOB_JSON5 =
|
|
79
|
-
const GLOB_JSONC =
|
|
80
|
-
const GLOB_YAML =
|
|
81
|
-
const GLOB_TOML =
|
|
82
|
-
const GLOB_VUE =
|
|
73
|
+
const GLOB_JS = "**/*.?([cm])js";
|
|
74
|
+
const GLOB_JSX = "**/*.?([cm])jsx";
|
|
75
|
+
const GLOB_TS = "**/*.?([cm])ts";
|
|
76
|
+
const GLOB_TSX = "**/*.?([cm])tsx";
|
|
77
|
+
const GLOB_JSON = "**/*.json";
|
|
78
|
+
const GLOB_JSON5 = "**/*.json5";
|
|
79
|
+
const GLOB_JSONC = "**/*.jsonc";
|
|
80
|
+
const GLOB_YAML = "**/*.y?(a)ml";
|
|
81
|
+
const GLOB_TOML = "**/*.toml";
|
|
82
|
+
const GLOB_VUE = "**/*.vue";
|
|
83
83
|
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/configs/typescript.ts
|
|
86
86
|
async function typescript(options = {}) {
|
|
87
|
-
const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = {project: true} } = options;
|
|
88
|
-
const ts = await loadPlugin(
|
|
87
|
+
const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = { project: true } } = options;
|
|
88
|
+
const ts = await loadPlugin("typescript-eslint");
|
|
89
89
|
const files = options.files ?? [GLOB_TS, GLOB_TSX, ...extraFileExtensions.map((ext) => `**/*${ext}`)];
|
|
90
|
-
return [...
|
|
90
|
+
return [...ts.configs.recommendedTypeChecked, {
|
|
91
91
|
files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML, GLOB_TOML],
|
|
92
|
-
...
|
|
92
|
+
...ts.configs.disableTypeChecked
|
|
93
93
|
}, {
|
|
94
|
-
name:
|
|
94
|
+
name: "@kazupon/typescipt/typescript-eslint",
|
|
95
95
|
files,
|
|
96
96
|
languageOptions: {
|
|
97
97
|
parser: ts.parser,
|
|
98
98
|
parserOptions: {
|
|
99
99
|
extraFileExtensions: extraFileExtensions.map((ext) => `${ext}`),
|
|
100
|
-
sourceType:
|
|
100
|
+
sourceType: "module",
|
|
101
101
|
...parserOptions
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
rules: {
|
|
105
|
-
|
|
106
|
-
args:
|
|
107
|
-
argsIgnorePattern:
|
|
108
|
-
caughtErrors:
|
|
109
|
-
caughtErrorsIgnorePattern:
|
|
110
|
-
destructuredArrayIgnorePattern:
|
|
111
|
-
varsIgnorePattern:
|
|
105
|
+
"@typescript-eslint/no-unused-vars": ["error", {
|
|
106
|
+
args: "all",
|
|
107
|
+
argsIgnorePattern: "^_",
|
|
108
|
+
caughtErrors: "all",
|
|
109
|
+
caughtErrorsIgnorePattern: "^_",
|
|
110
|
+
destructuredArrayIgnorePattern: "^_",
|
|
111
|
+
varsIgnorePattern: "^_",
|
|
112
112
|
ignoreRestSiblings: true
|
|
113
113
|
}],
|
|
114
114
|
...overrideRules
|
|
@@ -120,12 +120,12 @@ async function typescript(options = {}) {
|
|
|
120
120
|
//#region src/configs/jsdoc.ts
|
|
121
121
|
async function jsdoc(options = {}) {
|
|
122
122
|
const { rules: overrideRules = {}, typescript: typescript$1, error = false } = options;
|
|
123
|
-
const jsdoc$1 = await loadPlugin(
|
|
123
|
+
const jsdoc$1 = await loadPlugin("eslint-plugin-jsdoc");
|
|
124
124
|
function resolvePreset() {
|
|
125
|
-
let preset =
|
|
126
|
-
if (typescript$1 ===
|
|
125
|
+
let preset = "recommended";
|
|
126
|
+
if (typescript$1 === "syntax") {
|
|
127
127
|
preset = `${preset}-typescript`;
|
|
128
|
-
} else if (typescript$1 ===
|
|
128
|
+
} else if (typescript$1 === "flavor") {
|
|
129
129
|
preset = `${preset}-typescript-flavor`;
|
|
130
130
|
}
|
|
131
131
|
if (error) {
|
|
@@ -134,8 +134,8 @@ async function jsdoc(options = {}) {
|
|
|
134
134
|
return preset;
|
|
135
135
|
}
|
|
136
136
|
return [jsdoc$1.configs[`flat/${resolvePreset()}`], {
|
|
137
|
-
name:
|
|
138
|
-
rules: {...overrideRules}
|
|
137
|
+
name: "@kazupon/jsdoc",
|
|
138
|
+
rules: { ...overrideRules }
|
|
139
139
|
}];
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -143,13 +143,13 @@ async function jsdoc(options = {}) {
|
|
|
143
143
|
//#region src/configs/promise.ts
|
|
144
144
|
async function promise(options = {}) {
|
|
145
145
|
const { rules: overrideRules = {} } = options;
|
|
146
|
-
const promise$1 = await loadPlugin(
|
|
146
|
+
const promise$1 = await loadPlugin("eslint-plugin-promise");
|
|
147
147
|
return [{
|
|
148
|
-
name:
|
|
149
|
-
...
|
|
148
|
+
name: "promise/flat/recommended",
|
|
149
|
+
...promise$1.configs["flat/recommended"]
|
|
150
150
|
}, {
|
|
151
|
-
name:
|
|
152
|
-
rules: {...overrideRules}
|
|
151
|
+
name: "@kazupon/promise",
|
|
152
|
+
rules: { ...overrideRules }
|
|
153
153
|
}];
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -157,13 +157,13 @@ async function promise(options = {}) {
|
|
|
157
157
|
//#region src/configs/regexp.ts
|
|
158
158
|
async function regexp(options = {}) {
|
|
159
159
|
const { rules: overrideRules = {} } = options;
|
|
160
|
-
const regexp$1 = await loadPlugin(
|
|
160
|
+
const regexp$1 = await loadPlugin("eslint-plugin-regexp");
|
|
161
161
|
return [{
|
|
162
|
-
name:
|
|
163
|
-
...
|
|
162
|
+
name: "regexp/flat/recommended",
|
|
163
|
+
...regexp$1.configs["flat/recommended"]
|
|
164
164
|
}, {
|
|
165
|
-
name:
|
|
166
|
-
rules: {...overrideRules}
|
|
165
|
+
name: "@kazupon/eslint-regexp",
|
|
166
|
+
rules: { ...overrideRules }
|
|
167
167
|
}];
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -171,18 +171,18 @@ async function regexp(options = {}) {
|
|
|
171
171
|
//#region src/configs/toml.ts
|
|
172
172
|
async function toml(options = {}) {
|
|
173
173
|
const { rules: overrideRules = {} } = options;
|
|
174
|
-
const toml$1 = await loadPlugin(
|
|
174
|
+
const toml$1 = await loadPlugin("eslint-plugin-toml");
|
|
175
175
|
const configs = [];
|
|
176
|
-
configs.push(...toml$1.configs[
|
|
176
|
+
configs.push(...toml$1.configs["flat/standard"].map((config, index) => {
|
|
177
177
|
return config.name ? config : {
|
|
178
178
|
name: `toml/flat/standard/${index}`,
|
|
179
179
|
...config
|
|
180
180
|
};
|
|
181
181
|
}));
|
|
182
182
|
const overriddenConfig = {
|
|
183
|
-
name:
|
|
183
|
+
name: "@kazupon/toml",
|
|
184
184
|
files: [GLOB_TOML],
|
|
185
|
-
rules: {...overrideRules}
|
|
185
|
+
rules: { ...overrideRules }
|
|
186
186
|
};
|
|
187
187
|
configs.push(overriddenConfig);
|
|
188
188
|
return configs;
|
|
@@ -192,10 +192,10 @@ async function toml(options = {}) {
|
|
|
192
192
|
//#region src/configs/unicorn.ts
|
|
193
193
|
async function unicorn(options = {}) {
|
|
194
194
|
const { rules: overrideRules = {} } = options;
|
|
195
|
-
const unicorn$1 = await loadPlugin(
|
|
196
|
-
return [unicorn$1.configs[
|
|
197
|
-
name:
|
|
198
|
-
rules: {...overrideRules}
|
|
195
|
+
const unicorn$1 = await loadPlugin("eslint-plugin-unicorn");
|
|
196
|
+
return [unicorn$1.configs["flat/recommended"], {
|
|
197
|
+
name: "@kazupon/unicorn",
|
|
198
|
+
rules: { ...overrideRules }
|
|
199
199
|
}];
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -203,10 +203,10 @@ async function unicorn(options = {}) {
|
|
|
203
203
|
//#region src/configs/prettier.ts
|
|
204
204
|
async function prettier(options = {}) {
|
|
205
205
|
const { rules: overrideRules = {} } = options;
|
|
206
|
-
const prettier$1 = await loadPlugin(
|
|
206
|
+
const prettier$1 = await loadPlugin("eslint-config-prettier");
|
|
207
207
|
return [prettier$1, {
|
|
208
|
-
name:
|
|
209
|
-
rules: {...overrideRules}
|
|
208
|
+
name: "@kazupon/prettier",
|
|
209
|
+
rules: { ...overrideRules }
|
|
210
210
|
}];
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -214,9 +214,9 @@ async function prettier(options = {}) {
|
|
|
214
214
|
//#region src/configs/jsonc.ts
|
|
215
215
|
async function jsonc(options = {}) {
|
|
216
216
|
const { rules: overrideRules = {} } = options;
|
|
217
|
-
const kinds = [options.json ?
|
|
217
|
+
const kinds = [options.json ? "json" : "", options.jsonc ? "jsonc" : "", options.json5 ? "json5" : ""];
|
|
218
218
|
const usePrettier = !!options.prettier;
|
|
219
|
-
const jsonc$1 = await loadPlugin(
|
|
219
|
+
const jsonc$1 = await loadPlugin("eslint-plugin-jsonc");
|
|
220
220
|
const configs = [];
|
|
221
221
|
for (const kind of kinds) {
|
|
222
222
|
if (kind) {
|
|
@@ -229,7 +229,7 @@ async function jsonc(options = {}) {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
if (usePrettier) {
|
|
232
|
-
configs.push(...jsonc$1.configs[
|
|
232
|
+
configs.push(...jsonc$1.configs["flat/prettier"].map((config, index) => {
|
|
233
233
|
return config.name ? config : {
|
|
234
234
|
name: `jsonc/flat/prettier/${index}`,
|
|
235
235
|
...config
|
|
@@ -237,31 +237,34 @@ async function jsonc(options = {}) {
|
|
|
237
237
|
}));
|
|
238
238
|
}
|
|
239
239
|
const overriddenConfig = {
|
|
240
|
-
name:
|
|
240
|
+
name: "@kazupon/jsonc",
|
|
241
241
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
242
|
-
rules: {...overrideRules}
|
|
242
|
+
rules: { ...overrideRules }
|
|
243
243
|
};
|
|
244
244
|
configs.push(...jsoncSort(), overriddenConfig);
|
|
245
245
|
return configs;
|
|
246
246
|
}
|
|
247
247
|
function jsoncSort() {
|
|
248
248
|
return [{
|
|
249
|
-
name:
|
|
250
|
-
files: [
|
|
249
|
+
name: "@kazupon/jsonc/sort/package.json",
|
|
250
|
+
files: ["**/package.json"],
|
|
251
251
|
rules: {
|
|
252
|
-
|
|
253
|
-
order: {type:
|
|
254
|
-
pathPattern:
|
|
252
|
+
"jsonc/sort-array-values": ["error", {
|
|
253
|
+
order: { type: "asc" },
|
|
254
|
+
pathPattern: "^files$"
|
|
255
255
|
}],
|
|
256
|
-
|
|
257
|
-
order: [
|
|
258
|
-
pathPattern:
|
|
256
|
+
"jsonc/sort-keys": ["error", {
|
|
257
|
+
order: ["name", "description", "private", "version", "author", "contributors", "license", "funding", "bugs", "repository", "keywords", "homepage", "publishConfig", "packageManager", "engines", "os", "cpu", "type", "sideEffects", "bin", "files", "main", "module", "browser", "unpkg", "jsdelivr", "directories", "exports", "types", "typesVersions", "scripts", "dependencies", "peerDependencies", "peerDependenciesMeta", "optionalDependencies", "devDependencies", "pnpm", "overrides", "resolutions", "workspaces", "prettier", "buildOptions", "lint-staged"],
|
|
258
|
+
pathPattern: "^$"
|
|
259
259
|
}, {
|
|
260
|
-
order: {type:
|
|
261
|
-
pathPattern:
|
|
260
|
+
order: { type: "asc" },
|
|
261
|
+
pathPattern: "^scripts$"
|
|
262
262
|
}, {
|
|
263
|
-
order: {type:
|
|
264
|
-
pathPattern:
|
|
263
|
+
order: { type: "asc" },
|
|
264
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
265
|
+
}, {
|
|
266
|
+
order: { type: "asc" },
|
|
267
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
265
268
|
}]
|
|
266
269
|
}
|
|
267
270
|
}];
|
|
@@ -272,16 +275,16 @@ function jsoncSort() {
|
|
|
272
275
|
async function yml(options = {}) {
|
|
273
276
|
const { rules: overrideRules = {} } = options;
|
|
274
277
|
const usePrettier = !!options.prettier;
|
|
275
|
-
const yml$1 = await loadPlugin(
|
|
278
|
+
const yml$1 = await loadPlugin("eslint-plugin-yml");
|
|
276
279
|
const configs = [];
|
|
277
|
-
configs.push(...yml$1.configs[
|
|
280
|
+
configs.push(...yml$1.configs["flat/standard"].map((config, index) => {
|
|
278
281
|
return config.name ? config : {
|
|
279
282
|
name: `yml/flat/standard/${index}`,
|
|
280
283
|
...config
|
|
281
284
|
};
|
|
282
285
|
}));
|
|
283
286
|
if (usePrettier) {
|
|
284
|
-
configs.push(...yml$1.configs[
|
|
287
|
+
configs.push(...yml$1.configs["flat/prettier"].map((config, index) => {
|
|
285
288
|
return config.name ? config : {
|
|
286
289
|
name: `yml/flat/prettier/${index}`,
|
|
287
290
|
...config
|
|
@@ -289,9 +292,9 @@ async function yml(options = {}) {
|
|
|
289
292
|
}));
|
|
290
293
|
}
|
|
291
294
|
const overriddenConfig = {
|
|
292
|
-
name:
|
|
295
|
+
name: "@kazupon/yml",
|
|
293
296
|
files: [GLOB_YAML],
|
|
294
|
-
rules: {...overrideRules}
|
|
297
|
+
rules: { ...overrideRules }
|
|
295
298
|
};
|
|
296
299
|
configs.push(overriddenConfig);
|
|
297
300
|
return configs;
|
|
@@ -301,32 +304,32 @@ const yaml = yml;
|
|
|
301
304
|
//#endregion
|
|
302
305
|
//#region src/configs/vue.ts
|
|
303
306
|
async function vue(options = {}) {
|
|
304
|
-
const { rules: overrideRules = {}, parserOptions = {project: true} } = options;
|
|
307
|
+
const { rules: overrideRules = {}, parserOptions = { project: true } } = options;
|
|
305
308
|
const useTypeScript = !!options.typescript;
|
|
306
|
-
const vue$1 = await loadPlugin(
|
|
307
|
-
const vueParser = vue$1.configs[
|
|
309
|
+
const vue$1 = await loadPlugin("eslint-plugin-vue");
|
|
310
|
+
const vueParser = vue$1.configs["flat/base"][1]["languageOptions"]["parser"];
|
|
308
311
|
async function getTypeScriptParser() {
|
|
309
|
-
const ts = await loadPlugin(
|
|
312
|
+
const ts = await loadPlugin("typescript-eslint");
|
|
310
313
|
return ts.parser;
|
|
311
314
|
}
|
|
312
315
|
const customConfig = {
|
|
313
|
-
name:
|
|
316
|
+
name: "@kazupon/vue",
|
|
314
317
|
files: [GLOB_VUE],
|
|
315
|
-
rules: {...overrideRules}
|
|
318
|
+
rules: { ...overrideRules }
|
|
316
319
|
};
|
|
317
320
|
if (useTypeScript) {
|
|
318
321
|
customConfig.languageOptions = {
|
|
319
322
|
parser: vueParser,
|
|
320
323
|
parserOptions: {
|
|
321
|
-
sourceType:
|
|
324
|
+
sourceType: "module",
|
|
322
325
|
parser: await getTypeScriptParser(),
|
|
323
|
-
ecmaFeatures: {jsx: true},
|
|
324
|
-
extraFileExtensions: [
|
|
326
|
+
ecmaFeatures: { jsx: true },
|
|
327
|
+
extraFileExtensions: [".vue"],
|
|
325
328
|
...parserOptions
|
|
326
329
|
}
|
|
327
330
|
};
|
|
328
331
|
}
|
|
329
|
-
return [...
|
|
332
|
+
return [...vue$1.configs["flat/recommended"], customConfig];
|
|
330
333
|
}
|
|
331
334
|
|
|
332
335
|
//#endregion
|
|
@@ -2674,15 +2674,11 @@ type NoRestrictedImports = ((string | {
|
|
|
2674
2674
|
importNames?: string[];
|
|
2675
2675
|
allowImportNames?: string[];
|
|
2676
2676
|
})[];
|
|
2677
|
-
patterns?: (string[] | {
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
allowImportNamePattern?: string;
|
|
2683
|
-
message?: string;
|
|
2684
|
-
caseSensitive?: boolean;
|
|
2685
|
-
}[]);
|
|
2677
|
+
patterns?: (string[] | ({
|
|
2678
|
+
[k: string]: unknown | undefined;
|
|
2679
|
+
} | {
|
|
2680
|
+
[k: string]: unknown | undefined;
|
|
2681
|
+
})[]);
|
|
2686
2682
|
}
|
|
2687
2683
|
]);
|
|
2688
2684
|
type NoRestrictedModules = ((string | {
|
|
@@ -2674,15 +2674,11 @@ type NoRestrictedImports = ((string | {
|
|
|
2674
2674
|
importNames?: string[];
|
|
2675
2675
|
allowImportNames?: string[];
|
|
2676
2676
|
})[];
|
|
2677
|
-
patterns?: (string[] | {
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
allowImportNamePattern?: string;
|
|
2683
|
-
message?: string;
|
|
2684
|
-
caseSensitive?: boolean;
|
|
2685
|
-
}[]);
|
|
2677
|
+
patterns?: (string[] | ({
|
|
2678
|
+
[k: string]: unknown | undefined;
|
|
2679
|
+
} | {
|
|
2680
|
+
[k: string]: unknown | undefined;
|
|
2681
|
+
})[]);
|
|
2686
2682
|
}
|
|
2687
2683
|
]);
|
|
2688
2684
|
type NoRestrictedModules = ((string | {
|
|
@@ -6,7 +6,7 @@ export interface PromiseRules {
|
|
|
6
6
|
*/
|
|
7
7
|
'promise/always-return'?: Linter.RuleEntry<PromiseAlwaysReturn>;
|
|
8
8
|
/**
|
|
9
|
-
* Disallow creating `new` promises outside of utility libs (use [
|
|
9
|
+
* Disallow creating `new` promises outside of utility libs (use [util.promisify][] instead).
|
|
10
10
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/avoid-new.md
|
|
11
11
|
*/
|
|
12
12
|
'promise/avoid-new'?: Linter.RuleEntry<[]>;
|
|
@@ -16,7 +16,7 @@ export interface PromiseRules {
|
|
|
16
16
|
*/
|
|
17
17
|
'promise/catch-or-return'?: Linter.RuleEntry<PromiseCatchOrReturn>;
|
|
18
18
|
/**
|
|
19
|
-
* Disallow calling `cb()` inside of a `then()` (use [
|
|
19
|
+
* Disallow calling `cb()` inside of a `then()` (use [util.callbackify][] instead).
|
|
20
20
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/no-callback-in-promise.md
|
|
21
21
|
*/
|
|
22
22
|
'promise/no-callback-in-promise'?: Linter.RuleEntry<PromiseNoCallbackInPromise>;
|
|
@@ -61,7 +61,7 @@ export interface PromiseRules {
|
|
|
61
61
|
*/
|
|
62
62
|
'promise/param-names'?: Linter.RuleEntry<PromiseParamNames>;
|
|
63
63
|
/**
|
|
64
|
-
* Prefer async
|
|
64
|
+
* Prefer `async`/`await` to the callback pattern.
|
|
65
65
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/prefer-await-to-callbacks.md
|
|
66
66
|
*/
|
|
67
67
|
'promise/prefer-await-to-callbacks'?: Linter.RuleEntry<[]>;
|
|
@@ -69,7 +69,7 @@ export interface PromiseRules {
|
|
|
69
69
|
* Prefer `await` to `then()`/`catch()`/`finally()` for reading Promise values.
|
|
70
70
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/prefer-await-to-then.md
|
|
71
71
|
*/
|
|
72
|
-
'promise/prefer-await-to-then'?: Linter.RuleEntry<
|
|
72
|
+
'promise/prefer-await-to-then'?: Linter.RuleEntry<PromisePreferAwaitToThen>;
|
|
73
73
|
/**
|
|
74
74
|
* Enforces the proper number of arguments are passed to Promise functions.
|
|
75
75
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/valid-params.md
|
|
@@ -104,4 +104,10 @@ type PromiseParamNames = [] | [
|
|
|
104
104
|
rejectPattern?: string;
|
|
105
105
|
}
|
|
106
106
|
];
|
|
107
|
+
type PromisePreferAwaitToThen = [] | [
|
|
108
|
+
{
|
|
109
|
+
strict?: boolean;
|
|
110
|
+
[k: string]: unknown | undefined;
|
|
111
|
+
}
|
|
112
|
+
];
|
|
107
113
|
export {};
|
|
@@ -6,7 +6,7 @@ export interface PromiseRules {
|
|
|
6
6
|
*/
|
|
7
7
|
'promise/always-return'?: Linter.RuleEntry<PromiseAlwaysReturn>;
|
|
8
8
|
/**
|
|
9
|
-
* Disallow creating `new` promises outside of utility libs (use [
|
|
9
|
+
* Disallow creating `new` promises outside of utility libs (use [util.promisify][] instead).
|
|
10
10
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/avoid-new.md
|
|
11
11
|
*/
|
|
12
12
|
'promise/avoid-new'?: Linter.RuleEntry<[]>;
|
|
@@ -16,7 +16,7 @@ export interface PromiseRules {
|
|
|
16
16
|
*/
|
|
17
17
|
'promise/catch-or-return'?: Linter.RuleEntry<PromiseCatchOrReturn>;
|
|
18
18
|
/**
|
|
19
|
-
* Disallow calling `cb()` inside of a `then()` (use [
|
|
19
|
+
* Disallow calling `cb()` inside of a `then()` (use [util.callbackify][] instead).
|
|
20
20
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/no-callback-in-promise.md
|
|
21
21
|
*/
|
|
22
22
|
'promise/no-callback-in-promise'?: Linter.RuleEntry<PromiseNoCallbackInPromise>;
|
|
@@ -61,7 +61,7 @@ export interface PromiseRules {
|
|
|
61
61
|
*/
|
|
62
62
|
'promise/param-names'?: Linter.RuleEntry<PromiseParamNames>;
|
|
63
63
|
/**
|
|
64
|
-
* Prefer async
|
|
64
|
+
* Prefer `async`/`await` to the callback pattern.
|
|
65
65
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/prefer-await-to-callbacks.md
|
|
66
66
|
*/
|
|
67
67
|
'promise/prefer-await-to-callbacks'?: Linter.RuleEntry<[]>;
|
|
@@ -69,7 +69,7 @@ export interface PromiseRules {
|
|
|
69
69
|
* Prefer `await` to `then()`/`catch()`/`finally()` for reading Promise values.
|
|
70
70
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/prefer-await-to-then.md
|
|
71
71
|
*/
|
|
72
|
-
'promise/prefer-await-to-then'?: Linter.RuleEntry<
|
|
72
|
+
'promise/prefer-await-to-then'?: Linter.RuleEntry<PromisePreferAwaitToThen>;
|
|
73
73
|
/**
|
|
74
74
|
* Enforces the proper number of arguments are passed to Promise functions.
|
|
75
75
|
* @see https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/valid-params.md
|
|
@@ -104,4 +104,10 @@ type PromiseParamNames = [] | [
|
|
|
104
104
|
rejectPattern?: string;
|
|
105
105
|
}
|
|
106
106
|
];
|
|
107
|
+
type PromisePreferAwaitToThen = [] | [
|
|
108
|
+
{
|
|
109
|
+
strict?: boolean;
|
|
110
|
+
[k: string]: unknown | undefined;
|
|
111
|
+
}
|
|
112
|
+
];
|
|
107
113
|
export {};
|