@jsse/eslint-config 0.3.7 → 0.4.1
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/CHANGELOG.md +16 -0
- package/dist/cli.js +3 -3
- package/dist/esm/config-fns.d.ts +114 -34
- package/dist/esm/config-fns.js +117 -35
- package/dist/esm/configs/{comments.d.ts → de-morgan.d.ts} +1 -1
- package/dist/esm/configs/de-morgan.js +9 -0
- package/dist/esm/configs/eslint-comments.d.ts +2 -0
- package/dist/esm/configs/{comments.js → eslint-comments.js} +1 -1
- package/dist/esm/configs/gql.d.ts +2 -2
- package/dist/esm/configs/markdown.js +1 -1
- package/dist/esm/configs/pnpm.d.ts +2 -0
- package/dist/esm/configs/pnpm.js +34 -0
- package/dist/esm/configs/prettier.d.ts +2 -2
- package/dist/esm/configs/react.d.ts +3 -3
- package/dist/esm/configs/stylistic.js +1 -1
- package/dist/esm/configs/tailwind.d.ts +1 -2
- package/dist/esm/configs/tailwind.js +81 -48
- package/dist/esm/configs/ts/parser.d.ts +2 -2
- package/dist/esm/configs/ts/parser.js +7 -5
- package/dist/esm/configs/ts/typescript-rules.d.ts +9 -4
- package/dist/esm/configs/ts/typescript-rules.js +26 -62
- package/dist/esm/configs/ts/typescript.js +56 -43
- package/dist/esm/define-config.d.ts +3 -3
- package/dist/esm/define-config.js +47 -28
- package/dist/esm/fixable.d.ts +2 -1
- package/dist/esm/fixable.js +3 -395
- package/dist/esm/generated/fixable-rules-map.d.ts +2 -0
- package/dist/esm/generated/fixable-rules-map.js +443 -0
- package/dist/esm/generated/version.d.ts +1 -1
- package/dist/esm/generated/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/lager.d.ts +1 -1
- package/dist/esm/lager.js +1 -1
- package/dist/esm/plugins-all.d.ts +11 -8
- package/dist/esm/plugins-all.js +103 -10
- package/dist/esm/plugins.d.ts +2 -6
- package/dist/esm/plugins.js +2 -16
- package/dist/esm/presets.d.ts +16 -0
- package/dist/esm/presets.js +65 -2
- package/dist/esm/types.d.ts +47 -22
- package/dist/esm/utils.d.ts +5 -5
- package/dist/esm/utils.js +1 -1
- package/dist/index.d.ts +3907 -2560
- package/dist/index.js +275 -751
- package/package.json +29 -37
- package/dist/esm/plugindex.d.ts +0 -7
- package/dist/esm/plugindex.js +0 -60
package/dist/index.js
CHANGED
|
@@ -28,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// node_modules/.pnpm/globals@16.
|
|
31
|
+
// node_modules/.pnpm/globals@16.2.0/node_modules/globals/globals.json
|
|
32
32
|
var require_globals = __commonJS({
|
|
33
|
-
"node_modules/.pnpm/globals@16.
|
|
33
|
+
"node_modules/.pnpm/globals@16.2.0/node_modules/globals/globals.json"(exports, module) {
|
|
34
34
|
module.exports = {
|
|
35
35
|
amd: {
|
|
36
36
|
define: false,
|
|
@@ -2060,12 +2060,14 @@ var require_globals = __commonJS({
|
|
|
2060
2060
|
GM_addStyle: false,
|
|
2061
2061
|
GM_addValueChangeListener: false,
|
|
2062
2062
|
GM_deleteValue: false,
|
|
2063
|
+
GM_deleteValues: false,
|
|
2063
2064
|
GM_download: false,
|
|
2064
2065
|
GM_getResourceText: false,
|
|
2065
2066
|
GM_getResourceURL: false,
|
|
2066
2067
|
GM_getTab: false,
|
|
2067
2068
|
GM_getTabs: false,
|
|
2068
2069
|
GM_getValue: false,
|
|
2070
|
+
GM_getValues: false,
|
|
2069
2071
|
GM_info: false,
|
|
2070
2072
|
GM_listValues: false,
|
|
2071
2073
|
GM_log: false,
|
|
@@ -2076,6 +2078,7 @@ var require_globals = __commonJS({
|
|
|
2076
2078
|
GM_saveTab: false,
|
|
2077
2079
|
GM_setClipboard: false,
|
|
2078
2080
|
GM_setValue: false,
|
|
2081
|
+
GM_setValues: false,
|
|
2079
2082
|
GM_unregisterMenuCommand: false,
|
|
2080
2083
|
GM_xmlhttpRequest: false,
|
|
2081
2084
|
unsafeWindow: false
|
|
@@ -3248,9 +3251,9 @@ var require_globals = __commonJS({
|
|
|
3248
3251
|
}
|
|
3249
3252
|
});
|
|
3250
3253
|
|
|
3251
|
-
// node_modules/.pnpm/globals@16.
|
|
3254
|
+
// node_modules/.pnpm/globals@16.2.0/node_modules/globals/index.js
|
|
3252
3255
|
var require_globals2 = __commonJS({
|
|
3253
|
-
"node_modules/.pnpm/globals@16.
|
|
3256
|
+
"node_modules/.pnpm/globals@16.2.0/node_modules/globals/index.js"(exports, module) {
|
|
3254
3257
|
"use strict";
|
|
3255
3258
|
module.exports = require_globals();
|
|
3256
3259
|
}
|
|
@@ -3281,16 +3284,16 @@ var SLOW_RULES = [
|
|
|
3281
3284
|
];
|
|
3282
3285
|
|
|
3283
3286
|
// src/define-config.ts
|
|
3284
|
-
import fs3 from "
|
|
3285
|
-
import process6 from "
|
|
3287
|
+
import fs3 from "fs";
|
|
3288
|
+
import process6 from "process";
|
|
3286
3289
|
|
|
3287
3290
|
// node_modules/.pnpm/local-pkg@1.1.1/node_modules/local-pkg/dist/index.mjs
|
|
3288
|
-
import fs2 from "
|
|
3289
|
-
import { createRequire as createRequire2 } from "
|
|
3290
|
-
import path2, { dirname as dirname3, join as join2, win32 } from "
|
|
3291
|
-
import process2 from "
|
|
3292
|
-
import fsPromises from "
|
|
3293
|
-
import { fileURLToPath as fileURLToPath2 } from "
|
|
3291
|
+
import fs2 from "fs";
|
|
3292
|
+
import { createRequire as createRequire2 } from "module";
|
|
3293
|
+
import path2, { dirname as dirname3, join as join2, win32 } from "path";
|
|
3294
|
+
import process2 from "process";
|
|
3295
|
+
import fsPromises from "fs/promises";
|
|
3296
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3294
3297
|
|
|
3295
3298
|
// node_modules/.pnpm/acorn@8.14.1/node_modules/acorn/dist/acorn.mjs
|
|
3296
3299
|
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
@@ -6473,11 +6476,11 @@ pp$4.raise = function(pos, message) {
|
|
|
6473
6476
|
if (this.sourceFile) {
|
|
6474
6477
|
message += " in " + this.sourceFile;
|
|
6475
6478
|
}
|
|
6476
|
-
var
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
throw
|
|
6479
|
+
var err = new SyntaxError(message);
|
|
6480
|
+
err.pos = pos;
|
|
6481
|
+
err.loc = loc;
|
|
6482
|
+
err.raisedAt = this.pos;
|
|
6483
|
+
throw err;
|
|
6481
6484
|
};
|
|
6482
6485
|
pp$4.raiseRecoverable = pp$4.raise;
|
|
6483
6486
|
pp$4.curPosition = function() {
|
|
@@ -8588,11 +8591,11 @@ pp.tryReadTemplateToken = function() {
|
|
|
8588
8591
|
this.inTemplateElement = true;
|
|
8589
8592
|
try {
|
|
8590
8593
|
this.readTmplToken();
|
|
8591
|
-
} catch (
|
|
8592
|
-
if (
|
|
8594
|
+
} catch (err) {
|
|
8595
|
+
if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
|
|
8593
8596
|
this.readInvalidTemplateToken();
|
|
8594
8597
|
} else {
|
|
8595
|
-
throw
|
|
8598
|
+
throw err;
|
|
8596
8599
|
}
|
|
8597
8600
|
}
|
|
8598
8601
|
this.inTemplateElement = false;
|
|
@@ -8832,10 +8835,10 @@ Parser.acorn = {
|
|
|
8832
8835
|
};
|
|
8833
8836
|
|
|
8834
8837
|
// node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
8835
|
-
import { builtinModules, createRequire } from "
|
|
8836
|
-
import fs, { realpathSync, statSync, promises } from "
|
|
8838
|
+
import { builtinModules, createRequire } from "module";
|
|
8839
|
+
import fs, { realpathSync, statSync, promises } from "fs";
|
|
8837
8840
|
|
|
8838
|
-
// node_modules/.pnpm/ufo@1.
|
|
8841
|
+
// node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs
|
|
8839
8842
|
var r = String.fromCharCode;
|
|
8840
8843
|
var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
|
|
8841
8844
|
var JOIN_LEADING_SLASH_RE = /^\.?\//;
|
|
@@ -8855,7 +8858,7 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
8855
8858
|
let path3 = input;
|
|
8856
8859
|
let fragment = "";
|
|
8857
8860
|
const fragmentIndex = input.indexOf("#");
|
|
8858
|
-
if (fragmentIndex
|
|
8861
|
+
if (fragmentIndex !== -1) {
|
|
8859
8862
|
path3 = input.slice(0, fragmentIndex);
|
|
8860
8863
|
fragment = input.slice(fragmentIndex);
|
|
8861
8864
|
if (!path3) {
|
|
@@ -8889,12 +8892,12 @@ var isAbsolute = function(p) {
|
|
|
8889
8892
|
};
|
|
8890
8893
|
|
|
8891
8894
|
// node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
8892
|
-
import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "
|
|
8893
|
-
import assert from "
|
|
8894
|
-
import process$1 from "
|
|
8895
|
-
import path, { dirname as dirname2 } from "
|
|
8896
|
-
import v8 from "
|
|
8897
|
-
import { format as format2, inspect } from "
|
|
8895
|
+
import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "url";
|
|
8896
|
+
import assert from "assert";
|
|
8897
|
+
import process$1 from "process";
|
|
8898
|
+
import path, { dirname as dirname2 } from "path";
|
|
8899
|
+
import v8 from "v8";
|
|
8900
|
+
import { format as format2, inspect } from "util";
|
|
8898
8901
|
var BUILTIN_MODULES = new Set(builtinModules);
|
|
8899
8902
|
function normalizeSlash(path3) {
|
|
8900
8903
|
return path3.replace(/\\/g, "/");
|
|
@@ -10235,7 +10238,7 @@ function resolvePathSync(id, options) {
|
|
|
10235
10238
|
return fileURLToPath(resolveSync(id, options));
|
|
10236
10239
|
}
|
|
10237
10240
|
|
|
10238
|
-
// node_modules/.pnpm/quansync@0.2.
|
|
10241
|
+
// node_modules/.pnpm/quansync@0.2.10/node_modules/quansync/dist/index.mjs
|
|
10239
10242
|
var GET_IS_ASYNC = Symbol.for("quansync.getIsAsync");
|
|
10240
10243
|
var QuansyncError = class extends Error {
|
|
10241
10244
|
constructor(message = "Unexpected promise in sync context") {
|
|
@@ -10285,49 +10288,54 @@ function unwrapYield(value, isAsync) {
|
|
|
10285
10288
|
throw new QuansyncError();
|
|
10286
10289
|
return value;
|
|
10287
10290
|
}
|
|
10288
|
-
|
|
10291
|
+
var DEFAULT_ON_YIELD = (value) => value;
|
|
10292
|
+
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
10289
10293
|
let current2 = generator.next();
|
|
10290
10294
|
while (!current2.done) {
|
|
10291
10295
|
try {
|
|
10292
|
-
current2 = generator.next(unwrapYield(current2.value));
|
|
10293
|
-
} catch (
|
|
10294
|
-
current2 = generator.throw(
|
|
10296
|
+
current2 = generator.next(unwrapYield(onYield(current2.value, false)));
|
|
10297
|
+
} catch (err) {
|
|
10298
|
+
current2 = generator.throw(err);
|
|
10295
10299
|
}
|
|
10296
10300
|
}
|
|
10297
10301
|
return unwrapYield(current2.value);
|
|
10298
10302
|
}
|
|
10299
|
-
async function iterateAsync(generator) {
|
|
10303
|
+
async function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
10300
10304
|
let current2 = generator.next();
|
|
10301
10305
|
while (!current2.done) {
|
|
10302
10306
|
try {
|
|
10303
|
-
current2 = generator.next(await unwrapYield(current2.value, true));
|
|
10304
|
-
} catch (
|
|
10305
|
-
current2 = generator.throw(
|
|
10307
|
+
current2 = generator.next(await unwrapYield(onYield(current2.value, true), true));
|
|
10308
|
+
} catch (err) {
|
|
10309
|
+
current2 = generator.throw(err);
|
|
10306
10310
|
}
|
|
10307
10311
|
}
|
|
10308
10312
|
return current2.value;
|
|
10309
10313
|
}
|
|
10310
|
-
function fromGeneratorFn(generatorFn) {
|
|
10314
|
+
function fromGeneratorFn(generatorFn, options) {
|
|
10311
10315
|
return fromObject({
|
|
10312
10316
|
name: generatorFn.name,
|
|
10313
10317
|
async(...args) {
|
|
10314
|
-
return iterateAsync(generatorFn.apply(this, args));
|
|
10318
|
+
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
|
10315
10319
|
},
|
|
10316
10320
|
sync(...args) {
|
|
10317
|
-
return iterateSync(generatorFn.apply(this, args));
|
|
10321
|
+
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
|
10318
10322
|
}
|
|
10319
10323
|
});
|
|
10320
10324
|
}
|
|
10321
|
-
function quansync(options) {
|
|
10322
|
-
if (isThenable(
|
|
10323
|
-
return fromPromise(
|
|
10324
|
-
if (typeof
|
|
10325
|
-
return fromGeneratorFn(options);
|
|
10325
|
+
function quansync(input, options) {
|
|
10326
|
+
if (isThenable(input))
|
|
10327
|
+
return fromPromise(input);
|
|
10328
|
+
if (typeof input === "function")
|
|
10329
|
+
return fromGeneratorFn(input, options);
|
|
10326
10330
|
else
|
|
10327
|
-
return fromObject(
|
|
10331
|
+
return fromObject(input);
|
|
10328
10332
|
}
|
|
10333
|
+
var getIsAsync = quansync({
|
|
10334
|
+
async: () => Promise.resolve(true),
|
|
10335
|
+
sync: () => false
|
|
10336
|
+
});
|
|
10329
10337
|
|
|
10330
|
-
// node_modules/.pnpm/quansync@0.2.
|
|
10338
|
+
// node_modules/.pnpm/quansync@0.2.10/node_modules/quansync/dist/macro.mjs
|
|
10331
10339
|
var quansync2 = quansync;
|
|
10332
10340
|
|
|
10333
10341
|
// node_modules/.pnpm/local-pkg@1.1.1/node_modules/local-pkg/dist/index.mjs
|
|
@@ -10472,488 +10480,12 @@ var isPackageListed = quansync2(function* (name, cwd) {
|
|
|
10472
10480
|
});
|
|
10473
10481
|
var isPackageListedSync = isPackageListed.sync;
|
|
10474
10482
|
|
|
10475
|
-
// node_modules/.pnpm/neverthrow@8.2.0/node_modules/neverthrow/dist/index.es.js
|
|
10476
|
-
var defaultErrorConfig = {
|
|
10477
|
-
withStackTrace: false
|
|
10478
|
-
};
|
|
10479
|
-
var createNeverThrowError = (message, result, config = defaultErrorConfig) => {
|
|
10480
|
-
const data2 = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
|
|
10481
|
-
const maybeStack = config.withStackTrace ? new Error().stack : void 0;
|
|
10482
|
-
return {
|
|
10483
|
-
data: data2,
|
|
10484
|
-
message,
|
|
10485
|
-
stack: maybeStack
|
|
10486
|
-
};
|
|
10487
|
-
};
|
|
10488
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
10489
|
-
function adopt(value) {
|
|
10490
|
-
return value instanceof P ? value : new P(function(resolve2) {
|
|
10491
|
-
resolve2(value);
|
|
10492
|
-
});
|
|
10493
|
-
}
|
|
10494
|
-
return new (P || (P = Promise))(function(resolve2, reject) {
|
|
10495
|
-
function fulfilled(value) {
|
|
10496
|
-
try {
|
|
10497
|
-
step(generator.next(value));
|
|
10498
|
-
} catch (e) {
|
|
10499
|
-
reject(e);
|
|
10500
|
-
}
|
|
10501
|
-
}
|
|
10502
|
-
function rejected(value) {
|
|
10503
|
-
try {
|
|
10504
|
-
step(generator["throw"](value));
|
|
10505
|
-
} catch (e) {
|
|
10506
|
-
reject(e);
|
|
10507
|
-
}
|
|
10508
|
-
}
|
|
10509
|
-
function step(result) {
|
|
10510
|
-
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
10511
|
-
}
|
|
10512
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10513
|
-
});
|
|
10514
|
-
}
|
|
10515
|
-
function __values(o) {
|
|
10516
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
10517
|
-
if (m) return m.call(o);
|
|
10518
|
-
if (o && typeof o.length === "number") return {
|
|
10519
|
-
next: function() {
|
|
10520
|
-
if (o && i >= o.length) o = void 0;
|
|
10521
|
-
return { value: o && o[i++], done: !o };
|
|
10522
|
-
}
|
|
10523
|
-
};
|
|
10524
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
10525
|
-
}
|
|
10526
|
-
function __await(v) {
|
|
10527
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
10528
|
-
}
|
|
10529
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
10530
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
10531
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
10532
|
-
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
10533
|
-
return this;
|
|
10534
|
-
}, i;
|
|
10535
|
-
function awaitReturn(f) {
|
|
10536
|
-
return function(v) {
|
|
10537
|
-
return Promise.resolve(v).then(f, reject);
|
|
10538
|
-
};
|
|
10539
|
-
}
|
|
10540
|
-
function verb(n2, f) {
|
|
10541
|
-
if (g[n2]) {
|
|
10542
|
-
i[n2] = function(v) {
|
|
10543
|
-
return new Promise(function(a, b) {
|
|
10544
|
-
q.push([n2, v, a, b]) > 1 || resume(n2, v);
|
|
10545
|
-
});
|
|
10546
|
-
};
|
|
10547
|
-
if (f) i[n2] = f(i[n2]);
|
|
10548
|
-
}
|
|
10549
|
-
}
|
|
10550
|
-
function resume(n2, v) {
|
|
10551
|
-
try {
|
|
10552
|
-
step(g[n2](v));
|
|
10553
|
-
} catch (e) {
|
|
10554
|
-
settle(q[0][3], e);
|
|
10555
|
-
}
|
|
10556
|
-
}
|
|
10557
|
-
function step(r2) {
|
|
10558
|
-
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
|
|
10559
|
-
}
|
|
10560
|
-
function fulfill(value) {
|
|
10561
|
-
resume("next", value);
|
|
10562
|
-
}
|
|
10563
|
-
function reject(value) {
|
|
10564
|
-
resume("throw", value);
|
|
10565
|
-
}
|
|
10566
|
-
function settle(f, v) {
|
|
10567
|
-
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
|
10568
|
-
}
|
|
10569
|
-
}
|
|
10570
|
-
function __asyncDelegator(o) {
|
|
10571
|
-
var i, p;
|
|
10572
|
-
return i = {}, verb("next"), verb("throw", function(e) {
|
|
10573
|
-
throw e;
|
|
10574
|
-
}), verb("return"), i[Symbol.iterator] = function() {
|
|
10575
|
-
return this;
|
|
10576
|
-
}, i;
|
|
10577
|
-
function verb(n2, f) {
|
|
10578
|
-
i[n2] = o[n2] ? function(v) {
|
|
10579
|
-
return (p = !p) ? { value: __await(o[n2](v)), done: false } : f ? f(v) : v;
|
|
10580
|
-
} : f;
|
|
10581
|
-
}
|
|
10582
|
-
}
|
|
10583
|
-
function __asyncValues(o) {
|
|
10584
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
10585
|
-
var m = o[Symbol.asyncIterator], i;
|
|
10586
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
10587
|
-
return this;
|
|
10588
|
-
}, i);
|
|
10589
|
-
function verb(n2) {
|
|
10590
|
-
i[n2] = o[n2] && function(v) {
|
|
10591
|
-
return new Promise(function(resolve2, reject) {
|
|
10592
|
-
v = o[n2](v), settle(resolve2, reject, v.done, v.value);
|
|
10593
|
-
});
|
|
10594
|
-
};
|
|
10595
|
-
}
|
|
10596
|
-
function settle(resolve2, reject, d, v) {
|
|
10597
|
-
Promise.resolve(v).then(function(v2) {
|
|
10598
|
-
resolve2({ value: v2, done: d });
|
|
10599
|
-
}, reject);
|
|
10600
|
-
}
|
|
10601
|
-
}
|
|
10602
|
-
var ResultAsync = class _ResultAsync {
|
|
10603
|
-
constructor(res) {
|
|
10604
|
-
this._promise = res;
|
|
10605
|
-
}
|
|
10606
|
-
static fromSafePromise(promise) {
|
|
10607
|
-
const newPromise = promise.then((value) => new Ok(value));
|
|
10608
|
-
return new _ResultAsync(newPromise);
|
|
10609
|
-
}
|
|
10610
|
-
static fromPromise(promise, errorFn) {
|
|
10611
|
-
const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
|
|
10612
|
-
return new _ResultAsync(newPromise);
|
|
10613
|
-
}
|
|
10614
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10615
|
-
static fromThrowable(fn, errorFn) {
|
|
10616
|
-
return (...args) => {
|
|
10617
|
-
return new _ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
|
|
10618
|
-
try {
|
|
10619
|
-
return new Ok(yield fn(...args));
|
|
10620
|
-
} catch (error) {
|
|
10621
|
-
return new Err(errorFn ? errorFn(error) : error);
|
|
10622
|
-
}
|
|
10623
|
-
}))());
|
|
10624
|
-
};
|
|
10625
|
-
}
|
|
10626
|
-
static combine(asyncResultList) {
|
|
10627
|
-
return combineResultAsyncList(asyncResultList);
|
|
10628
|
-
}
|
|
10629
|
-
static combineWithAllErrors(asyncResultList) {
|
|
10630
|
-
return combineResultAsyncListWithAllErrors(asyncResultList);
|
|
10631
|
-
}
|
|
10632
|
-
map(f) {
|
|
10633
|
-
return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
10634
|
-
if (res.isErr()) {
|
|
10635
|
-
return new Err(res.error);
|
|
10636
|
-
}
|
|
10637
|
-
return new Ok(yield f(res.value));
|
|
10638
|
-
})));
|
|
10639
|
-
}
|
|
10640
|
-
andThrough(f) {
|
|
10641
|
-
return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
10642
|
-
if (res.isErr()) {
|
|
10643
|
-
return new Err(res.error);
|
|
10644
|
-
}
|
|
10645
|
-
const newRes = yield f(res.value);
|
|
10646
|
-
if (newRes.isErr()) {
|
|
10647
|
-
return new Err(newRes.error);
|
|
10648
|
-
}
|
|
10649
|
-
return new Ok(res.value);
|
|
10650
|
-
})));
|
|
10651
|
-
}
|
|
10652
|
-
andTee(f) {
|
|
10653
|
-
return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
10654
|
-
if (res.isErr()) {
|
|
10655
|
-
return new Err(res.error);
|
|
10656
|
-
}
|
|
10657
|
-
try {
|
|
10658
|
-
yield f(res.value);
|
|
10659
|
-
} catch (e) {
|
|
10660
|
-
}
|
|
10661
|
-
return new Ok(res.value);
|
|
10662
|
-
})));
|
|
10663
|
-
}
|
|
10664
|
-
orTee(f) {
|
|
10665
|
-
return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
10666
|
-
if (res.isOk()) {
|
|
10667
|
-
return new Ok(res.value);
|
|
10668
|
-
}
|
|
10669
|
-
try {
|
|
10670
|
-
yield f(res.error);
|
|
10671
|
-
} catch (e) {
|
|
10672
|
-
}
|
|
10673
|
-
return new Err(res.error);
|
|
10674
|
-
})));
|
|
10675
|
-
}
|
|
10676
|
-
mapErr(f) {
|
|
10677
|
-
return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
10678
|
-
if (res.isOk()) {
|
|
10679
|
-
return new Ok(res.value);
|
|
10680
|
-
}
|
|
10681
|
-
return new Err(yield f(res.error));
|
|
10682
|
-
})));
|
|
10683
|
-
}
|
|
10684
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10685
|
-
andThen(f) {
|
|
10686
|
-
return new _ResultAsync(this._promise.then((res) => {
|
|
10687
|
-
if (res.isErr()) {
|
|
10688
|
-
return new Err(res.error);
|
|
10689
|
-
}
|
|
10690
|
-
const newValue = f(res.value);
|
|
10691
|
-
return newValue instanceof _ResultAsync ? newValue._promise : newValue;
|
|
10692
|
-
}));
|
|
10693
|
-
}
|
|
10694
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10695
|
-
orElse(f) {
|
|
10696
|
-
return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
10697
|
-
if (res.isErr()) {
|
|
10698
|
-
return f(res.error);
|
|
10699
|
-
}
|
|
10700
|
-
return new Ok(res.value);
|
|
10701
|
-
})));
|
|
10702
|
-
}
|
|
10703
|
-
match(ok2, _err) {
|
|
10704
|
-
return this._promise.then((res) => res.match(ok2, _err));
|
|
10705
|
-
}
|
|
10706
|
-
unwrapOr(t) {
|
|
10707
|
-
return this._promise.then((res) => res.unwrapOr(t));
|
|
10708
|
-
}
|
|
10709
|
-
/**
|
|
10710
|
-
* @deprecated will be removed in 9.0.0.
|
|
10711
|
-
*
|
|
10712
|
-
* You can use `safeTry` without this method.
|
|
10713
|
-
* @example
|
|
10714
|
-
* ```typescript
|
|
10715
|
-
* safeTry(async function* () {
|
|
10716
|
-
* const okValue = yield* yourResult
|
|
10717
|
-
* })
|
|
10718
|
-
* ```
|
|
10719
|
-
* Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
|
|
10720
|
-
*/
|
|
10721
|
-
safeUnwrap() {
|
|
10722
|
-
return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
|
|
10723
|
-
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
|
|
10724
|
-
});
|
|
10725
|
-
}
|
|
10726
|
-
// Makes ResultAsync implement PromiseLike<Result>
|
|
10727
|
-
then(successCallback, failureCallback) {
|
|
10728
|
-
return this._promise.then(successCallback, failureCallback);
|
|
10729
|
-
}
|
|
10730
|
-
[Symbol.asyncIterator]() {
|
|
10731
|
-
return __asyncGenerator(this, arguments, function* _a() {
|
|
10732
|
-
const result = yield __await(this._promise);
|
|
10733
|
-
if (result.isErr()) {
|
|
10734
|
-
yield yield __await(errAsync(result.error));
|
|
10735
|
-
}
|
|
10736
|
-
return yield __await(result.value);
|
|
10737
|
-
});
|
|
10738
|
-
}
|
|
10739
|
-
};
|
|
10740
|
-
function errAsync(err2) {
|
|
10741
|
-
return new ResultAsync(Promise.resolve(new Err(err2)));
|
|
10742
|
-
}
|
|
10743
|
-
var fromPromise2 = ResultAsync.fromPromise;
|
|
10744
|
-
var fromSafePromise = ResultAsync.fromSafePromise;
|
|
10745
|
-
var fromAsyncThrowable = ResultAsync.fromThrowable;
|
|
10746
|
-
var combineResultList = (resultList) => {
|
|
10747
|
-
let acc = ok([]);
|
|
10748
|
-
for (const result of resultList) {
|
|
10749
|
-
if (result.isErr()) {
|
|
10750
|
-
acc = err(result.error);
|
|
10751
|
-
break;
|
|
10752
|
-
} else {
|
|
10753
|
-
acc.map((list) => list.push(result.value));
|
|
10754
|
-
}
|
|
10755
|
-
}
|
|
10756
|
-
return acc;
|
|
10757
|
-
};
|
|
10758
|
-
var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
10759
|
-
var combineResultListWithAllErrors = (resultList) => {
|
|
10760
|
-
let acc = ok([]);
|
|
10761
|
-
for (const result of resultList) {
|
|
10762
|
-
if (result.isErr() && acc.isErr()) {
|
|
10763
|
-
acc.error.push(result.error);
|
|
10764
|
-
} else if (result.isErr() && acc.isOk()) {
|
|
10765
|
-
acc = err([result.error]);
|
|
10766
|
-
} else if (result.isOk() && acc.isOk()) {
|
|
10767
|
-
acc.value.push(result.value);
|
|
10768
|
-
}
|
|
10769
|
-
}
|
|
10770
|
-
return acc;
|
|
10771
|
-
};
|
|
10772
|
-
var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
|
|
10773
|
-
var Result;
|
|
10774
|
-
(function(Result2) {
|
|
10775
|
-
function fromThrowable2(fn, errorFn) {
|
|
10776
|
-
return (...args) => {
|
|
10777
|
-
try {
|
|
10778
|
-
const result = fn(...args);
|
|
10779
|
-
return ok(result);
|
|
10780
|
-
} catch (e) {
|
|
10781
|
-
return err(errorFn ? errorFn(e) : e);
|
|
10782
|
-
}
|
|
10783
|
-
};
|
|
10784
|
-
}
|
|
10785
|
-
Result2.fromThrowable = fromThrowable2;
|
|
10786
|
-
function combine2(resultList) {
|
|
10787
|
-
return combineResultList(resultList);
|
|
10788
|
-
}
|
|
10789
|
-
Result2.combine = combine2;
|
|
10790
|
-
function combineWithAllErrors(resultList) {
|
|
10791
|
-
return combineResultListWithAllErrors(resultList);
|
|
10792
|
-
}
|
|
10793
|
-
Result2.combineWithAllErrors = combineWithAllErrors;
|
|
10794
|
-
})(Result || (Result = {}));
|
|
10795
|
-
function ok(value) {
|
|
10796
|
-
return new Ok(value);
|
|
10797
|
-
}
|
|
10798
|
-
function err(err2) {
|
|
10799
|
-
return new Err(err2);
|
|
10800
|
-
}
|
|
10801
|
-
var Ok = class {
|
|
10802
|
-
constructor(value) {
|
|
10803
|
-
this.value = value;
|
|
10804
|
-
}
|
|
10805
|
-
isOk() {
|
|
10806
|
-
return true;
|
|
10807
|
-
}
|
|
10808
|
-
isErr() {
|
|
10809
|
-
return !this.isOk();
|
|
10810
|
-
}
|
|
10811
|
-
map(f) {
|
|
10812
|
-
return ok(f(this.value));
|
|
10813
|
-
}
|
|
10814
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10815
|
-
mapErr(_f) {
|
|
10816
|
-
return ok(this.value);
|
|
10817
|
-
}
|
|
10818
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10819
|
-
andThen(f) {
|
|
10820
|
-
return f(this.value);
|
|
10821
|
-
}
|
|
10822
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10823
|
-
andThrough(f) {
|
|
10824
|
-
return f(this.value).map((_value) => this.value);
|
|
10825
|
-
}
|
|
10826
|
-
andTee(f) {
|
|
10827
|
-
try {
|
|
10828
|
-
f(this.value);
|
|
10829
|
-
} catch (e) {
|
|
10830
|
-
}
|
|
10831
|
-
return ok(this.value);
|
|
10832
|
-
}
|
|
10833
|
-
orTee(_f) {
|
|
10834
|
-
return ok(this.value);
|
|
10835
|
-
}
|
|
10836
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10837
|
-
orElse(_f) {
|
|
10838
|
-
return ok(this.value);
|
|
10839
|
-
}
|
|
10840
|
-
asyncAndThen(f) {
|
|
10841
|
-
return f(this.value);
|
|
10842
|
-
}
|
|
10843
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10844
|
-
asyncAndThrough(f) {
|
|
10845
|
-
return f(this.value).map(() => this.value);
|
|
10846
|
-
}
|
|
10847
|
-
asyncMap(f) {
|
|
10848
|
-
return ResultAsync.fromSafePromise(f(this.value));
|
|
10849
|
-
}
|
|
10850
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10851
|
-
unwrapOr(_v) {
|
|
10852
|
-
return this.value;
|
|
10853
|
-
}
|
|
10854
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10855
|
-
match(ok2, _err) {
|
|
10856
|
-
return ok2(this.value);
|
|
10857
|
-
}
|
|
10858
|
-
safeUnwrap() {
|
|
10859
|
-
const value = this.value;
|
|
10860
|
-
return function* () {
|
|
10861
|
-
return value;
|
|
10862
|
-
}();
|
|
10863
|
-
}
|
|
10864
|
-
_unsafeUnwrap(_) {
|
|
10865
|
-
return this.value;
|
|
10866
|
-
}
|
|
10867
|
-
_unsafeUnwrapErr(config) {
|
|
10868
|
-
throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
|
|
10869
|
-
}
|
|
10870
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias, require-yield
|
|
10871
|
-
*[Symbol.iterator]() {
|
|
10872
|
-
return this.value;
|
|
10873
|
-
}
|
|
10874
|
-
};
|
|
10875
|
-
var Err = class {
|
|
10876
|
-
constructor(error) {
|
|
10877
|
-
this.error = error;
|
|
10878
|
-
}
|
|
10879
|
-
isOk() {
|
|
10880
|
-
return false;
|
|
10881
|
-
}
|
|
10882
|
-
isErr() {
|
|
10883
|
-
return !this.isOk();
|
|
10884
|
-
}
|
|
10885
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10886
|
-
map(_f) {
|
|
10887
|
-
return err(this.error);
|
|
10888
|
-
}
|
|
10889
|
-
mapErr(f) {
|
|
10890
|
-
return err(f(this.error));
|
|
10891
|
-
}
|
|
10892
|
-
andThrough(_f) {
|
|
10893
|
-
return err(this.error);
|
|
10894
|
-
}
|
|
10895
|
-
andTee(_f) {
|
|
10896
|
-
return err(this.error);
|
|
10897
|
-
}
|
|
10898
|
-
orTee(f) {
|
|
10899
|
-
try {
|
|
10900
|
-
f(this.error);
|
|
10901
|
-
} catch (e) {
|
|
10902
|
-
}
|
|
10903
|
-
return err(this.error);
|
|
10904
|
-
}
|
|
10905
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10906
|
-
andThen(_f) {
|
|
10907
|
-
return err(this.error);
|
|
10908
|
-
}
|
|
10909
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
10910
|
-
orElse(f) {
|
|
10911
|
-
return f(this.error);
|
|
10912
|
-
}
|
|
10913
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10914
|
-
asyncAndThen(_f) {
|
|
10915
|
-
return errAsync(this.error);
|
|
10916
|
-
}
|
|
10917
|
-
asyncAndThrough(_f) {
|
|
10918
|
-
return errAsync(this.error);
|
|
10919
|
-
}
|
|
10920
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10921
|
-
asyncMap(_f) {
|
|
10922
|
-
return errAsync(this.error);
|
|
10923
|
-
}
|
|
10924
|
-
unwrapOr(v) {
|
|
10925
|
-
return v;
|
|
10926
|
-
}
|
|
10927
|
-
match(_ok, err2) {
|
|
10928
|
-
return err2(this.error);
|
|
10929
|
-
}
|
|
10930
|
-
safeUnwrap() {
|
|
10931
|
-
const error = this.error;
|
|
10932
|
-
return function* () {
|
|
10933
|
-
yield err(error);
|
|
10934
|
-
throw new Error("Do not use this generator out of `safeTry`");
|
|
10935
|
-
}();
|
|
10936
|
-
}
|
|
10937
|
-
_unsafeUnwrap(config) {
|
|
10938
|
-
throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
|
|
10939
|
-
}
|
|
10940
|
-
_unsafeUnwrapErr(_) {
|
|
10941
|
-
return this.error;
|
|
10942
|
-
}
|
|
10943
|
-
*[Symbol.iterator]() {
|
|
10944
|
-
const self = this;
|
|
10945
|
-
yield self;
|
|
10946
|
-
return self;
|
|
10947
|
-
}
|
|
10948
|
-
};
|
|
10949
|
-
var fromThrowable = Result.fromThrowable;
|
|
10950
|
-
|
|
10951
10483
|
// src/utils.ts
|
|
10952
|
-
import process3 from "
|
|
10484
|
+
import process3 from "process";
|
|
10953
10485
|
|
|
10954
10486
|
// src/lager.ts
|
|
10955
10487
|
import Debug from "debug";
|
|
10956
|
-
var
|
|
10488
|
+
var dbg = Debug("jsse:eslint-config");
|
|
10957
10489
|
var LAGER_LEVELS = {
|
|
10958
10490
|
trace: 10,
|
|
10959
10491
|
debug: 20,
|
|
@@ -11098,7 +10630,7 @@ var parserPlain = {
|
|
|
11098
10630
|
})
|
|
11099
10631
|
};
|
|
11100
10632
|
function turnOffRules(configs, off) {
|
|
11101
|
-
if (off
|
|
10633
|
+
if (off.length > 0) {
|
|
11102
10634
|
for (const rule of off) {
|
|
11103
10635
|
log.debug(`turning-off: ${rule}`);
|
|
11104
10636
|
}
|
|
@@ -11178,11 +10710,13 @@ import { default as default2 } from "@eslint-community/eslint-plugin-eslint-comm
|
|
|
11178
10710
|
import { default as default3 } from "@typescript-eslint/eslint-plugin";
|
|
11179
10711
|
import * as parserTs from "@typescript-eslint/parser";
|
|
11180
10712
|
import { default as default4 } from "eslint-plugin-antfu";
|
|
10713
|
+
import { default as default5 } from "eslint-plugin-de-morgan";
|
|
11181
10714
|
import * as pluginImport from "eslint-plugin-import-x";
|
|
11182
|
-
import { default as
|
|
11183
|
-
import { default as
|
|
11184
|
-
import { default as
|
|
11185
|
-
import { default as
|
|
10715
|
+
import { default as default6 } from "eslint-plugin-n";
|
|
10716
|
+
import { default as default7 } from "eslint-plugin-perfectionist";
|
|
10717
|
+
import { default as default8 } from "eslint-plugin-pnpm";
|
|
10718
|
+
import { default as default9 } from "eslint-plugin-unicorn";
|
|
10719
|
+
import { default as default10 } from "eslint-plugin-unused-imports";
|
|
11186
10720
|
async function importPluginUnicorn() {
|
|
11187
10721
|
const pluginUnicorn = await interopDefault2(import("eslint-plugin-unicorn"));
|
|
11188
10722
|
return {
|
|
@@ -11271,25 +10805,6 @@ async function importPluginStylistic() {
|
|
|
11271
10805
|
);
|
|
11272
10806
|
return { pluginStylistic };
|
|
11273
10807
|
}
|
|
11274
|
-
async function importPluginTailwind() {
|
|
11275
|
-
const pluginTailwind = await interopDefault2(
|
|
11276
|
-
// @ts-expect-error - bad types
|
|
11277
|
-
import("eslint-plugin-tailwindcss")
|
|
11278
|
-
);
|
|
11279
|
-
return { pluginTailwind };
|
|
11280
|
-
}
|
|
11281
|
-
async function safeImportPluginTailwind() {
|
|
11282
|
-
try {
|
|
11283
|
-
const plugin = await importPluginTailwind();
|
|
11284
|
-
return ok(plugin);
|
|
11285
|
-
} catch (e) {
|
|
11286
|
-
return err(
|
|
11287
|
-
new Error(
|
|
11288
|
-
`Failed to import \`eslint-plugin-tailwindcss\`. You might need to install it. ${e}`
|
|
11289
|
-
)
|
|
11290
|
-
);
|
|
11291
|
-
}
|
|
11292
|
-
}
|
|
11293
10808
|
|
|
11294
10809
|
// src/configs/antfu.ts
|
|
11295
10810
|
var antfu = async (options) => {
|
|
@@ -11333,8 +10848,18 @@ var command = async () => {
|
|
|
11333
10848
|
];
|
|
11334
10849
|
};
|
|
11335
10850
|
|
|
11336
|
-
// src/configs/
|
|
11337
|
-
var
|
|
10851
|
+
// src/configs/de-morgan.ts
|
|
10852
|
+
var deMorgan = async () => {
|
|
10853
|
+
return [
|
|
10854
|
+
{
|
|
10855
|
+
...default5.configs.recommended,
|
|
10856
|
+
name: "jsse/de-morgan"
|
|
10857
|
+
}
|
|
10858
|
+
];
|
|
10859
|
+
};
|
|
10860
|
+
|
|
10861
|
+
// src/configs/eslint-comments.ts
|
|
10862
|
+
var eslintComments = async () => [
|
|
11338
10863
|
{
|
|
11339
10864
|
name: "jsse/eslint-comments",
|
|
11340
10865
|
plugins: {
|
|
@@ -11527,7 +11052,7 @@ var javascript = async (options) => {
|
|
|
11527
11052
|
name: "jsse/javascript",
|
|
11528
11053
|
plugins: {
|
|
11529
11054
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11530
|
-
"unused-imports":
|
|
11055
|
+
"unused-imports": default10
|
|
11531
11056
|
},
|
|
11532
11057
|
rules: {
|
|
11533
11058
|
...eslintjs.configs.recommended.rules,
|
|
@@ -11868,8 +11393,15 @@ var jsonc = async (options) => {
|
|
|
11868
11393
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
11869
11394
|
|
|
11870
11395
|
// src/configs/ts/typescript-rules.ts
|
|
11871
|
-
|
|
11396
|
+
import tseslint from "typescript-eslint";
|
|
11397
|
+
var extractRules = (configs) => {
|
|
11398
|
+
const rules = configs.filter((config) => config.rules !== void 0).map((config) => config.rules ?? {});
|
|
11399
|
+
return Object.assign({}, ...rules);
|
|
11400
|
+
};
|
|
11401
|
+
function typescriptRulesTypeAware(props) {
|
|
11402
|
+
const tsRecomendedRulesTypeChecked = props?.strict ? extractRules(tseslint.configs.strictTypeChecked) : extractRules(tseslint.configs.recommendedTypeChecked);
|
|
11872
11403
|
return {
|
|
11404
|
+
...tsRecomendedRulesTypeChecked,
|
|
11873
11405
|
"@typescript-eslint/await-thenable": "error",
|
|
11874
11406
|
"@typescript-eslint/no-for-in-array": "error",
|
|
11875
11407
|
"no-implied-eval": "off",
|
|
@@ -11986,8 +11518,10 @@ function typescriptRulesTypeAware() {
|
|
|
11986
11518
|
]
|
|
11987
11519
|
};
|
|
11988
11520
|
}
|
|
11989
|
-
function typescriptRulesTypeOblivious() {
|
|
11521
|
+
function typescriptRulesTypeOblivious(props) {
|
|
11522
|
+
const tseslintBaseRules = props?.strict ? extractRules(tseslint.configs.strict) : extractRules(tseslint.configs.recommended);
|
|
11990
11523
|
return {
|
|
11524
|
+
...tseslintBaseRules,
|
|
11991
11525
|
eqeqeq: "error",
|
|
11992
11526
|
camelcase: "off",
|
|
11993
11527
|
yoda: "error",
|
|
@@ -12010,61 +11544,6 @@ function typescriptRulesTypeOblivious() {
|
|
|
12010
11544
|
}
|
|
12011
11545
|
],
|
|
12012
11546
|
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
12013
|
-
// "@typescript-eslint/ban-types": [
|
|
12014
|
-
// "warn",
|
|
12015
|
-
// {
|
|
12016
|
-
// extendDefaults: false,
|
|
12017
|
-
// types: {
|
|
12018
|
-
// String: {
|
|
12019
|
-
// message: 'Use "string" instead',
|
|
12020
|
-
// fixWith: "string",
|
|
12021
|
-
// },
|
|
12022
|
-
// Boolean: {
|
|
12023
|
-
// message: 'Use "boolean" instead',
|
|
12024
|
-
// fixWith: "boolean",
|
|
12025
|
-
// },
|
|
12026
|
-
// Number: {
|
|
12027
|
-
// message: 'Use "number" instead',
|
|
12028
|
-
// fixWith: "number",
|
|
12029
|
-
// },
|
|
12030
|
-
// BigInt: {
|
|
12031
|
-
// message: "Use `bigint` instead.",
|
|
12032
|
-
// fixWith: "bigint",
|
|
12033
|
-
// },
|
|
12034
|
-
// Object: {
|
|
12035
|
-
// message:
|
|
12036
|
-
// "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
12037
|
-
// fixWith: "Record<string, unknown>",
|
|
12038
|
-
// },
|
|
12039
|
-
// object: {
|
|
12040
|
-
// message:
|
|
12041
|
-
// "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
12042
|
-
// fixWith: "Record<string, unknown>",
|
|
12043
|
-
// },
|
|
12044
|
-
// Symbol: {
|
|
12045
|
-
// message: 'Use "symbol" instead',
|
|
12046
|
-
// fixWith: "symbol",
|
|
12047
|
-
// },
|
|
12048
|
-
// Function: {
|
|
12049
|
-
// message:
|
|
12050
|
-
// 'The "Function" type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with "new".\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.',
|
|
12051
|
-
// },
|
|
12052
|
-
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12053
|
-
// "{}": {
|
|
12054
|
-
// message:
|
|
12055
|
-
// "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
|
|
12056
|
-
// fixWith: "Record<string, unknown>",
|
|
12057
|
-
// },
|
|
12058
|
-
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12059
|
-
// "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
|
|
12060
|
-
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12061
|
-
// "[[]]":
|
|
12062
|
-
// "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
|
|
12063
|
-
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12064
|
-
// "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
|
|
12065
|
-
// },
|
|
12066
|
-
// },
|
|
12067
|
-
// ],
|
|
12068
11547
|
"@typescript-eslint/consistent-type-assertions": "error",
|
|
12069
11548
|
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
12070
11549
|
"@typescript-eslint/member-ordering": [
|
|
@@ -12275,14 +11754,15 @@ function typescriptRulesTypeOblivious() {
|
|
|
12275
11754
|
};
|
|
12276
11755
|
}
|
|
12277
11756
|
function typescriptRules(props) {
|
|
12278
|
-
const { typeAware
|
|
12279
|
-
|
|
11757
|
+
const normalized = { typeAware: false, strict: false, ...props };
|
|
11758
|
+
dbg("building typescript rules: %O", normalized);
|
|
11759
|
+
if (normalized.typeAware) {
|
|
12280
11760
|
return {
|
|
12281
|
-
...typescriptRulesTypeOblivious(),
|
|
12282
|
-
...typescriptRulesTypeAware()
|
|
11761
|
+
...typescriptRulesTypeOblivious({ strict: normalized.strict }),
|
|
11762
|
+
...typescriptRulesTypeAware({ strict: normalized.strict })
|
|
12283
11763
|
};
|
|
12284
11764
|
}
|
|
12285
|
-
return typescriptRulesTypeOblivious();
|
|
11765
|
+
return typescriptRulesTypeOblivious({ strict: normalized.strict });
|
|
12286
11766
|
}
|
|
12287
11767
|
|
|
12288
11768
|
// src/configs/markdown.ts
|
|
@@ -12297,13 +11777,11 @@ var markdown = async (options) => {
|
|
|
12297
11777
|
"off"
|
|
12298
11778
|
])
|
|
12299
11779
|
);
|
|
12300
|
-
const processor = mergeProcessors(
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
].filter((processor2) => processor2 !== void 0)
|
|
12306
|
-
);
|
|
11780
|
+
const processor = mergeProcessors([
|
|
11781
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11782
|
+
pluginMarkdown.processors.markdown,
|
|
11783
|
+
processorPassThrough
|
|
11784
|
+
]);
|
|
12307
11785
|
return [
|
|
12308
11786
|
{
|
|
12309
11787
|
name: "jsse/markdown/setup",
|
|
@@ -12412,7 +11890,7 @@ var n = async () => {
|
|
|
12412
11890
|
{
|
|
12413
11891
|
name: "jsse/n",
|
|
12414
11892
|
plugins: {
|
|
12415
|
-
n:
|
|
11893
|
+
n: default6
|
|
12416
11894
|
},
|
|
12417
11895
|
rules: {
|
|
12418
11896
|
"n/handle-callback-err": ["error", "^(err|error)$"],
|
|
@@ -12462,7 +11940,7 @@ var perfectionist = async () => {
|
|
|
12462
11940
|
name: "jsse/perfectionist",
|
|
12463
11941
|
plugins: {
|
|
12464
11942
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
12465
|
-
perfectionist:
|
|
11943
|
+
perfectionist: default7
|
|
12466
11944
|
},
|
|
12467
11945
|
rules: {
|
|
12468
11946
|
"perfectionist/sort-exports": [
|
|
@@ -12512,6 +11990,41 @@ var perfectionist = async () => {
|
|
|
12512
11990
|
];
|
|
12513
11991
|
};
|
|
12514
11992
|
|
|
11993
|
+
// src/configs/pnpm.ts
|
|
11994
|
+
var pnpm = async () => {
|
|
11995
|
+
return [
|
|
11996
|
+
{
|
|
11997
|
+
files: ["package.json", "**/package.json"],
|
|
11998
|
+
languageOptions: {
|
|
11999
|
+
parser: await import("jsonc-eslint-parser")
|
|
12000
|
+
},
|
|
12001
|
+
name: "jsse/pnpm/package-json",
|
|
12002
|
+
plugins: {
|
|
12003
|
+
pnpm: default8
|
|
12004
|
+
},
|
|
12005
|
+
rules: {
|
|
12006
|
+
"pnpm/json-enforce-catalog": "error",
|
|
12007
|
+
"pnpm/json-prefer-workspace-settings": "error",
|
|
12008
|
+
"pnpm/json-valid-catalog": "error"
|
|
12009
|
+
}
|
|
12010
|
+
},
|
|
12011
|
+
{
|
|
12012
|
+
files: ["pnpm-workspace.yaml"],
|
|
12013
|
+
languageOptions: {
|
|
12014
|
+
parser: await import("yaml-eslint-parser")
|
|
12015
|
+
},
|
|
12016
|
+
name: "jsse/pnpm/pnpm-workspace-yaml",
|
|
12017
|
+
plugins: {
|
|
12018
|
+
pnpm: default8
|
|
12019
|
+
},
|
|
12020
|
+
rules: {
|
|
12021
|
+
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
12022
|
+
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
12023
|
+
}
|
|
12024
|
+
}
|
|
12025
|
+
];
|
|
12026
|
+
};
|
|
12027
|
+
|
|
12515
12028
|
// src/configs/prettier.ts
|
|
12516
12029
|
function eslintConfigPrettierRules() {
|
|
12517
12030
|
return {
|
|
@@ -12640,7 +12153,7 @@ var prettier = async () => {
|
|
|
12640
12153
|
import { fixupPluginRules } from "@eslint/compat";
|
|
12641
12154
|
|
|
12642
12155
|
// src/configs/ts/typescript-language-options.ts
|
|
12643
|
-
import process4 from "
|
|
12156
|
+
import process4 from "process";
|
|
12644
12157
|
function typescriptLanguageOptions(options) {
|
|
12645
12158
|
const { componentExts = [], react: react2, tsconfig } = options || {};
|
|
12646
12159
|
const tsOptions = tsconfig ? {
|
|
@@ -13183,9 +12696,7 @@ var sortTsconfig = async (options) => {
|
|
|
13183
12696
|
};
|
|
13184
12697
|
|
|
13185
12698
|
// src/configs/stylistic.ts
|
|
13186
|
-
function jsxStylistic({
|
|
13187
|
-
indent
|
|
13188
|
-
}) {
|
|
12699
|
+
function jsxStylistic({ indent }) {
|
|
13189
12700
|
return {
|
|
13190
12701
|
"@stylistic/jsx-curly-brace-presence": [
|
|
13191
12702
|
"error",
|
|
@@ -13222,60 +12733,8 @@ var stylistic = async (options) => {
|
|
|
13222
12733
|
];
|
|
13223
12734
|
};
|
|
13224
12735
|
|
|
13225
|
-
// src/configs/tailwind.ts
|
|
13226
|
-
var TAILWIND_ESLINT_SETTINGS_DEFAULT = {
|
|
13227
|
-
// These are the default values but feel free to customize
|
|
13228
|
-
callees: ["classnames", "clsx", "ctl", "cn", "cx", "twMerge", "twJoin"],
|
|
13229
|
-
classRegex: "^class(Name)?$",
|
|
13230
|
-
// can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
|
|
13231
|
-
config: "tailwind.config.js",
|
|
13232
|
-
// returned from `loadConfig()` utility if not provided
|
|
13233
|
-
cssFiles: ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build"],
|
|
13234
|
-
cssFilesRefreshRate: 5e3,
|
|
13235
|
-
removeDuplicates: true,
|
|
13236
|
-
skipClassAttribute: false,
|
|
13237
|
-
tags: [],
|
|
13238
|
-
// can be set to e.g. ['tw'] for use in tw`bg-blue`
|
|
13239
|
-
whitelist: []
|
|
13240
|
-
};
|
|
13241
|
-
function tailwindSettings(options) {
|
|
13242
|
-
if (typeof options === "boolean") {
|
|
13243
|
-
return TAILWIND_ESLINT_SETTINGS_DEFAULT;
|
|
13244
|
-
}
|
|
13245
|
-
return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
|
|
13246
|
-
}
|
|
13247
|
-
var tailwind = async (options) => {
|
|
13248
|
-
const importResult = await safeImportPluginTailwind();
|
|
13249
|
-
return importResult.match(
|
|
13250
|
-
({ pluginTailwind }) => {
|
|
13251
|
-
return [
|
|
13252
|
-
{
|
|
13253
|
-
files: [GLOB_SRC],
|
|
13254
|
-
name: "jsse/tailwind/rules",
|
|
13255
|
-
plugins: {
|
|
13256
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13257
|
-
tailwindcss: pluginTailwind
|
|
13258
|
-
},
|
|
13259
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13260
|
-
rules: {
|
|
13261
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
13262
|
-
...pluginTailwind.configs.recommended.rules
|
|
13263
|
-
},
|
|
13264
|
-
settings: {
|
|
13265
|
-
tailwindcss: tailwindSettings(options)
|
|
13266
|
-
}
|
|
13267
|
-
}
|
|
13268
|
-
];
|
|
13269
|
-
},
|
|
13270
|
-
(error) => {
|
|
13271
|
-
log.error(error.message);
|
|
13272
|
-
return [];
|
|
13273
|
-
}
|
|
13274
|
-
);
|
|
13275
|
-
};
|
|
13276
|
-
|
|
13277
12736
|
// src/configs/ts/parser.ts
|
|
13278
|
-
import process5 from "
|
|
12737
|
+
import process5 from "process";
|
|
13279
12738
|
function autoUseParserService(options) {
|
|
13280
12739
|
if (options.useProjectService !== void 0) {
|
|
13281
12740
|
return options.useProjectService;
|
|
@@ -13295,12 +12754,13 @@ function typescriptParser(options) {
|
|
|
13295
12754
|
} = options;
|
|
13296
12755
|
const typeAware = !!tsconfig;
|
|
13297
12756
|
if (useProjectService) {
|
|
13298
|
-
|
|
12757
|
+
dbg("ts parser-options using `projectService`project service");
|
|
13299
12758
|
return {
|
|
13300
12759
|
files,
|
|
13301
|
-
...ignores2 ? { ignores: ignores2 } : {},
|
|
12760
|
+
...ignores2.length > 0 ? { ignores: ignores2 } : {},
|
|
13302
12761
|
languageOptions: {
|
|
13303
12762
|
parser: parserTs,
|
|
12763
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13304
12764
|
parserOptions: {
|
|
13305
12765
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
13306
12766
|
jsxPragma: react2 ? "React" : void 0,
|
|
@@ -13319,14 +12779,15 @@ function typescriptParser(options) {
|
|
|
13319
12779
|
name: name ?? `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
13320
12780
|
};
|
|
13321
12781
|
}
|
|
13322
|
-
|
|
12782
|
+
dbg(
|
|
13323
12783
|
"ts parser-options NOT using `projectService`project service - using `project`"
|
|
13324
12784
|
);
|
|
13325
12785
|
return {
|
|
13326
12786
|
files,
|
|
13327
|
-
...ignores2 ? { ignores: ignores2 } : {},
|
|
12787
|
+
...ignores2.length > 0 ? { ignores: ignores2 } : {},
|
|
13328
12788
|
languageOptions: {
|
|
13329
12789
|
parser: parserTs,
|
|
12790
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13330
12791
|
parserOptions: {
|
|
13331
12792
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
13332
12793
|
jsxPragma: react2 ? "React" : void 0,
|
|
@@ -13345,6 +12806,7 @@ function typescriptParser(options) {
|
|
|
13345
12806
|
|
|
13346
12807
|
// src/configs/ts/typescript.ts
|
|
13347
12808
|
var typescript = async (options) => {
|
|
12809
|
+
dbg("typescript-options: %O", options);
|
|
13348
12810
|
const {
|
|
13349
12811
|
componentExts = [],
|
|
13350
12812
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
@@ -13353,8 +12815,9 @@ var typescript = async (options) => {
|
|
|
13353
12815
|
parserOptions = {},
|
|
13354
12816
|
prefix,
|
|
13355
12817
|
react: react2 = false,
|
|
12818
|
+
strict = false,
|
|
13356
12819
|
tsconfig: tsconfigPath,
|
|
13357
|
-
typeAware
|
|
12820
|
+
typeAware = true
|
|
13358
12821
|
} = options ?? {};
|
|
13359
12822
|
const parserConfigs = typeAware ? [
|
|
13360
12823
|
typescriptParser({
|
|
@@ -13392,11 +12855,12 @@ var typescript = async (options) => {
|
|
|
13392
12855
|
...default3.configs.strict?.rules,
|
|
13393
12856
|
"no-invalid-this": "off",
|
|
13394
12857
|
...typescriptRules({
|
|
13395
|
-
|
|
12858
|
+
strict,
|
|
12859
|
+
typeAware
|
|
13396
12860
|
}),
|
|
13397
12861
|
...overrides
|
|
13398
12862
|
};
|
|
13399
|
-
|
|
12863
|
+
const tsEslintConfigs = [
|
|
13400
12864
|
{
|
|
13401
12865
|
// Install the plugins without globs, so they can be configured separately.
|
|
13402
12866
|
name: "jsse/typescript/setup",
|
|
@@ -13406,30 +12870,36 @@ var typescript = async (options) => {
|
|
|
13406
12870
|
}
|
|
13407
12871
|
},
|
|
13408
12872
|
...parserConfigs,
|
|
12873
|
+
// ========================================================================
|
|
12874
|
+
// RULES - NOT TYPE AWARE
|
|
12875
|
+
// ========================================================================
|
|
13409
12876
|
{
|
|
13410
12877
|
// only apply ts rules to ts files!
|
|
13411
12878
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
13412
12879
|
name: "jsse/typescript/rules",
|
|
13413
12880
|
// may not need to rename all rules here........
|
|
13414
|
-
rules: renameRules(tsRules
|
|
13415
|
-
}
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
},
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
12881
|
+
rules: renameRules(tsRules, tsPrefix, tsPrefixTo)
|
|
12882
|
+
}
|
|
12883
|
+
];
|
|
12884
|
+
if (typeAware) {
|
|
12885
|
+
tsEslintConfigs.push({
|
|
12886
|
+
files: filesTypeAware,
|
|
12887
|
+
ignores: ignoresTypeAware,
|
|
12888
|
+
name: "jsse/typescript/rules-type-aware",
|
|
12889
|
+
rules: renameRules(
|
|
12890
|
+
{
|
|
12891
|
+
...typescriptRules({
|
|
12892
|
+
strict,
|
|
12893
|
+
typeAware: true
|
|
12894
|
+
}),
|
|
12895
|
+
...overrides
|
|
12896
|
+
},
|
|
12897
|
+
tsPrefix,
|
|
12898
|
+
tsPrefixTo
|
|
12899
|
+
)
|
|
12900
|
+
});
|
|
12901
|
+
}
|
|
12902
|
+
tsEslintConfigs.push(
|
|
13433
12903
|
{
|
|
13434
12904
|
files: ["**/*.d.ts"],
|
|
13435
12905
|
name: "jsse/typescript:disables/dts",
|
|
@@ -13456,7 +12926,8 @@ var typescript = async (options) => {
|
|
|
13456
12926
|
"@typescript-eslint/no-var-requires": "off"
|
|
13457
12927
|
}
|
|
13458
12928
|
}
|
|
13459
|
-
|
|
12929
|
+
);
|
|
12930
|
+
return tsEslintConfigs;
|
|
13460
12931
|
};
|
|
13461
12932
|
|
|
13462
12933
|
// src/configs/tsdoc.ts
|
|
@@ -13505,10 +12976,10 @@ var unicorn = async () => {
|
|
|
13505
12976
|
name: "jsse/unicorn",
|
|
13506
12977
|
plugins: {
|
|
13507
12978
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13508
|
-
unicorn:
|
|
12979
|
+
unicorn: default9
|
|
13509
12980
|
},
|
|
13510
12981
|
rules: {
|
|
13511
|
-
...unicornRecommended(
|
|
12982
|
+
...unicornRecommended(default9),
|
|
13512
12983
|
...unicornOff(),
|
|
13513
12984
|
"unicorn/better-regex": "error",
|
|
13514
12985
|
"unicorn/consistent-empty-array-spread": "error",
|
|
@@ -13688,6 +13159,7 @@ var DEBUG = ["1", "true", "t", "on", "yes", "y"].includes(
|
|
|
13688
13159
|
process6.env.DEBUG ?? ""
|
|
13689
13160
|
);
|
|
13690
13161
|
function defaultOptions2() {
|
|
13162
|
+
const typescriptExists = isPackageExists("typescript");
|
|
13691
13163
|
return {
|
|
13692
13164
|
command: true,
|
|
13693
13165
|
componentExts: [],
|
|
@@ -13699,6 +13171,7 @@ function defaultOptions2() {
|
|
|
13699
13171
|
markdown: false,
|
|
13700
13172
|
off: [],
|
|
13701
13173
|
overrides: {},
|
|
13174
|
+
pnpm: false,
|
|
13702
13175
|
prettier: true,
|
|
13703
13176
|
react: false,
|
|
13704
13177
|
reportUnusedDisableDirectives: true,
|
|
@@ -13706,7 +13179,8 @@ function defaultOptions2() {
|
|
|
13706
13179
|
stylistic: true,
|
|
13707
13180
|
test: true,
|
|
13708
13181
|
tsPrefix: "@typescript-eslint",
|
|
13709
|
-
|
|
13182
|
+
typeAware: false,
|
|
13183
|
+
typescript: typescriptExists
|
|
13710
13184
|
};
|
|
13711
13185
|
}
|
|
13712
13186
|
function normalizeOptions(options = {}) {
|
|
@@ -13716,14 +13190,19 @@ function normalizeOptions(options = {}) {
|
|
|
13716
13190
|
...options.fast ? [...SLOW_RULES] : []
|
|
13717
13191
|
])
|
|
13718
13192
|
].sort(
|
|
13719
|
-
(a, b) =>
|
|
13193
|
+
(a, b) => (
|
|
13194
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
13195
|
+
a.localeCompare(b, void 0, { numeric: true, sensitivity: "base" })
|
|
13196
|
+
)
|
|
13720
13197
|
);
|
|
13721
13198
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
13722
13199
|
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
13723
13200
|
stylisticOptions.jsx = options.jsx ?? true;
|
|
13724
13201
|
}
|
|
13202
|
+
const defaults = defaultOptions2();
|
|
13725
13203
|
return {
|
|
13726
|
-
...
|
|
13204
|
+
...defaults,
|
|
13205
|
+
typeAware: options.typeAware ?? defaults.typeAware,
|
|
13727
13206
|
...options,
|
|
13728
13207
|
off,
|
|
13729
13208
|
reportUnusedDisableDirectives: options.reportUnusedDisableDirectives ?? !options.fast,
|
|
@@ -13733,26 +13212,35 @@ function normalizeOptions(options = {}) {
|
|
|
13733
13212
|
async function jsse(options = {}, ...userConfigs) {
|
|
13734
13213
|
const normalizedOptions = normalizeOptions(options);
|
|
13735
13214
|
const {
|
|
13215
|
+
command: enableCommand,
|
|
13736
13216
|
componentExts,
|
|
13737
|
-
debug
|
|
13217
|
+
debug,
|
|
13738
13218
|
gitignore: enableGitignore,
|
|
13739
13219
|
isInEditor: isInEditor2,
|
|
13220
|
+
jsonc: enableJsonc,
|
|
13221
|
+
markdown: enableMarkdown,
|
|
13740
13222
|
off,
|
|
13741
13223
|
overrides = {},
|
|
13224
|
+
pnpm: enablePnpm,
|
|
13742
13225
|
prettier: enablePrettier,
|
|
13743
13226
|
react: enableReact,
|
|
13744
13227
|
reportUnusedDisableDirectives,
|
|
13228
|
+
rootId,
|
|
13229
|
+
// default to "jsse"
|
|
13745
13230
|
stylistic: stylisticOptions,
|
|
13231
|
+
tailwind: tailwindOptions,
|
|
13232
|
+
test: enableTest,
|
|
13746
13233
|
tsPrefix,
|
|
13747
13234
|
typeAware,
|
|
13748
|
-
typescript:
|
|
13235
|
+
typescript: typescriptOptions,
|
|
13236
|
+
yaml: enableYaml
|
|
13749
13237
|
} = normalizedOptions;
|
|
13750
|
-
if (
|
|
13238
|
+
if (debug || process6.argv.includes("--debug")) {
|
|
13751
13239
|
log.level = "debug";
|
|
13752
13240
|
}
|
|
13753
13241
|
log.debug("@jsse/eslint-config debug=true");
|
|
13754
13242
|
log.debug("@jsse/eslint-config isInEditor", isInEditor2);
|
|
13755
|
-
log.debug("@jsse/eslint-config enableTypeScript",
|
|
13243
|
+
log.debug("@jsse/eslint-config enableTypeScript", typescriptOptions);
|
|
13756
13244
|
log.debug("@jsse/eslint-config normalizedOptions", normalizedOptions);
|
|
13757
13245
|
const configs = [];
|
|
13758
13246
|
if (enableGitignore) {
|
|
@@ -13784,7 +13272,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13784
13272
|
overrides: overrides.javascript,
|
|
13785
13273
|
reportUnusedDisableDirectives
|
|
13786
13274
|
}),
|
|
13787
|
-
|
|
13275
|
+
eslintComments(),
|
|
13788
13276
|
n(),
|
|
13789
13277
|
jsdoc(),
|
|
13790
13278
|
imports({
|
|
@@ -13792,14 +13280,18 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13792
13280
|
}),
|
|
13793
13281
|
unicorn(),
|
|
13794
13282
|
antfu(),
|
|
13795
|
-
perfectionist()
|
|
13283
|
+
perfectionist(),
|
|
13284
|
+
deMorgan()
|
|
13796
13285
|
);
|
|
13797
|
-
if (
|
|
13286
|
+
if (enableCommand) {
|
|
13798
13287
|
configs.push(command());
|
|
13799
13288
|
}
|
|
13800
|
-
if (
|
|
13289
|
+
if (enablePnpm) {
|
|
13290
|
+
configs.push(pnpm());
|
|
13291
|
+
}
|
|
13292
|
+
if (typescriptOptions) {
|
|
13801
13293
|
const tscfg = typescript({
|
|
13802
|
-
...typeof
|
|
13294
|
+
...typeof typescriptOptions === "boolean" ? {} : typescriptOptions,
|
|
13803
13295
|
componentExts,
|
|
13804
13296
|
overrides: overrides.typescript,
|
|
13805
13297
|
prefix: {
|
|
@@ -13811,14 +13303,14 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13811
13303
|
});
|
|
13812
13304
|
configs.push(tscfg, tsdoc());
|
|
13813
13305
|
}
|
|
13814
|
-
if (
|
|
13306
|
+
if (enableMarkdown) {
|
|
13815
13307
|
configs.push(markdown());
|
|
13816
13308
|
}
|
|
13817
|
-
if (
|
|
13309
|
+
if (enableYaml) {
|
|
13818
13310
|
const ymlConfig = yml();
|
|
13819
13311
|
configs.push(ymlConfig);
|
|
13820
13312
|
}
|
|
13821
|
-
if (
|
|
13313
|
+
if (enableReact) {
|
|
13822
13314
|
configs.push(
|
|
13823
13315
|
react({
|
|
13824
13316
|
// use react refresh if not explicitly disabled w/ 'false'
|
|
@@ -13832,7 +13324,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13832
13324
|
if (stylisticOptions) {
|
|
13833
13325
|
configs.push(stylistic(stylisticOptions === true ? {} : stylisticOptions));
|
|
13834
13326
|
}
|
|
13835
|
-
if (
|
|
13327
|
+
if (enableTest) {
|
|
13836
13328
|
configs.push(
|
|
13837
13329
|
vitest({
|
|
13838
13330
|
isInEditor: isInEditor2,
|
|
@@ -13844,7 +13336,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13844
13336
|
})
|
|
13845
13337
|
);
|
|
13846
13338
|
}
|
|
13847
|
-
if (
|
|
13339
|
+
if (enableJsonc ?? true) {
|
|
13848
13340
|
configs.push(
|
|
13849
13341
|
jsonc({
|
|
13850
13342
|
overrides: overrides.jsonc,
|
|
@@ -13856,16 +13348,8 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13856
13348
|
})
|
|
13857
13349
|
);
|
|
13858
13350
|
}
|
|
13859
|
-
if (
|
|
13860
|
-
|
|
13861
|
-
configs.push(
|
|
13862
|
-
tailwind(
|
|
13863
|
-
normalizedOptions.tailwind === true ? {} : normalizedOptions.tailwind
|
|
13864
|
-
)
|
|
13865
|
-
);
|
|
13866
|
-
} catch (e) {
|
|
13867
|
-
log.error("Tailwind config failed", e);
|
|
13868
|
-
}
|
|
13351
|
+
if (tailwindOptions) {
|
|
13352
|
+
console.error("Tailwind configuration is deprecate4d...");
|
|
13869
13353
|
}
|
|
13870
13354
|
if (normalizedOptions.prettier) {
|
|
13871
13355
|
configs.push(prettier());
|
|
@@ -13883,13 +13367,10 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
13883
13367
|
if (off && off.length > 0) {
|
|
13884
13368
|
turnOffRules(combinedConfigs, off);
|
|
13885
13369
|
}
|
|
13886
|
-
if (
|
|
13370
|
+
if (rootId !== "jsse") {
|
|
13887
13371
|
for (const config of combinedConfigs) {
|
|
13888
13372
|
if (config.name && config.name.startsWith("jsse/")) {
|
|
13889
|
-
config.name = config.name.replace(
|
|
13890
|
-
"jsse/",
|
|
13891
|
-
`${normalizedOptions.rootId}/`
|
|
13892
|
-
);
|
|
13373
|
+
config.name = config.name.replace("jsse/", `${rootId}/`);
|
|
13893
13374
|
}
|
|
13894
13375
|
}
|
|
13895
13376
|
}
|
|
@@ -13933,15 +13414,35 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
13933
13414
|
}
|
|
13934
13415
|
|
|
13935
13416
|
// src/generated/version.ts
|
|
13936
|
-
var VERSION = "0.
|
|
13417
|
+
var VERSION = "0.4.1";
|
|
13937
13418
|
|
|
13938
13419
|
// src/presets.ts
|
|
13420
|
+
var makePresetFn = (cfgFunctions) => {
|
|
13421
|
+
return async () => {
|
|
13422
|
+
const results = await Promise.allSettled(cfgFunctions.map((fn) => fn()));
|
|
13423
|
+
const ok = [];
|
|
13424
|
+
const err = [];
|
|
13425
|
+
for (const result of results) {
|
|
13426
|
+
if (result.status === "fulfilled") {
|
|
13427
|
+
ok.push(...result.value);
|
|
13428
|
+
} else {
|
|
13429
|
+
err.push(result.reason);
|
|
13430
|
+
}
|
|
13431
|
+
}
|
|
13432
|
+
if (err.length > 0) {
|
|
13433
|
+
const errorMessage = `Some preset functions failed: ${err.map((e) => {
|
|
13434
|
+
return e instanceof Error ? e.message : JSON.stringify(e);
|
|
13435
|
+
}).join(", ")}`;
|
|
13436
|
+
throw new Error(errorMessage);
|
|
13437
|
+
}
|
|
13438
|
+
return ok;
|
|
13439
|
+
};
|
|
13440
|
+
};
|
|
13939
13441
|
var jsseReact = (options, ...configs) => {
|
|
13940
13442
|
return jsse(
|
|
13941
13443
|
{
|
|
13942
13444
|
react: true,
|
|
13943
13445
|
reactRefresh: true,
|
|
13944
|
-
tailwind: true,
|
|
13945
13446
|
typescript: {
|
|
13946
13447
|
tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"]
|
|
13947
13448
|
},
|
|
@@ -13950,6 +13451,29 @@ var jsseReact = (options, ...configs) => {
|
|
|
13950
13451
|
...configs
|
|
13951
13452
|
);
|
|
13952
13453
|
};
|
|
13454
|
+
var presetJavascript = makePresetFn([
|
|
13455
|
+
ignores,
|
|
13456
|
+
javascript,
|
|
13457
|
+
eslintComments,
|
|
13458
|
+
imports,
|
|
13459
|
+
unicorn,
|
|
13460
|
+
n,
|
|
13461
|
+
jsdoc,
|
|
13462
|
+
deMorgan
|
|
13463
|
+
]);
|
|
13464
|
+
var presetJsonc = makePresetFn([
|
|
13465
|
+
jsonc,
|
|
13466
|
+
sortPackageJson,
|
|
13467
|
+
sortTsconfig
|
|
13468
|
+
// ...sortPnpmWorkspace(),
|
|
13469
|
+
]);
|
|
13470
|
+
var presetLangsExtensions = makePresetFn([markdown, yml, presetJsonc]);
|
|
13471
|
+
var presetBasic = makePresetFn([presetJavascript, typescript]);
|
|
13472
|
+
var presetAll = makePresetFn([
|
|
13473
|
+
presetBasic,
|
|
13474
|
+
presetLangsExtensions,
|
|
13475
|
+
command
|
|
13476
|
+
]);
|
|
13953
13477
|
export {
|
|
13954
13478
|
SLOW_RULES,
|
|
13955
13479
|
VERSION,
|
|
@@ -13969,7 +13493,6 @@ export {
|
|
|
13969
13493
|
importPluginReactHooks,
|
|
13970
13494
|
importPluginReactRefresh,
|
|
13971
13495
|
importPluginStylistic,
|
|
13972
|
-
importPluginTailwind,
|
|
13973
13496
|
importPluginTsdoc,
|
|
13974
13497
|
importPluginUnicorn,
|
|
13975
13498
|
importReactPlugins,
|
|
@@ -13982,15 +13505,16 @@ export {
|
|
|
13982
13505
|
parserPlain,
|
|
13983
13506
|
parserTs,
|
|
13984
13507
|
default4 as pluginAntfu,
|
|
13508
|
+
default5 as pluginDeMorgan,
|
|
13985
13509
|
default2 as pluginEslintComments,
|
|
13986
13510
|
pluginImport,
|
|
13987
|
-
|
|
13988
|
-
|
|
13511
|
+
default6 as pluginN,
|
|
13512
|
+
default7 as pluginPerfectionist,
|
|
13513
|
+
default8 as pluginPnpm,
|
|
13989
13514
|
default3 as pluginTs,
|
|
13990
|
-
|
|
13991
|
-
|
|
13515
|
+
default9 as pluginUnicorn,
|
|
13516
|
+
default10 as pluginUnusedImports,
|
|
13992
13517
|
renameRules,
|
|
13993
|
-
safeImportPluginTailwind,
|
|
13994
13518
|
turnOffRules,
|
|
13995
13519
|
uniqueStrings,
|
|
13996
13520
|
warn2error
|