@jsse/eslint-config 0.4.9 → 0.4.11
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 +12 -0
- package/README.md +1 -1
- package/dist/cli.js +9 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +29 -123
- package/dist/version-Cmu7XVG1.js +39 -0
- package/package.json +12 -9
- package/dist/esm/cli.d.ts +0 -1
- package/dist/esm/cli.js +0 -121
- package/dist/esm/config-fns.d.ts +0 -138
- package/dist/esm/config-fns.js +0 -161
- package/dist/esm/configs/antfu.d.ts +0 -4
- package/dist/esm/configs/antfu.js +0 -30
- package/dist/esm/configs/command.d.ts +0 -10
- package/dist/esm/configs/command.js +0 -17
- package/dist/esm/configs/de-morgan.d.ts +0 -2
- package/dist/esm/configs/de-morgan.js +0 -9
- package/dist/esm/configs/eslint-comments.d.ts +0 -2
- package/dist/esm/configs/eslint-comments.js +0 -16
- package/dist/esm/configs/gql.d.ts +0 -2
- package/dist/esm/configs/gql.js +0 -4
- package/dist/esm/configs/ignores.d.ts +0 -2
- package/dist/esm/configs/ignores.js +0 -9
- package/dist/esm/configs/imports.d.ts +0 -2
- package/dist/esm/configs/imports.js +0 -28
- package/dist/esm/configs/javascript.d.ts +0 -6
- package/dist/esm/configs/javascript.js +0 -262
- package/dist/esm/configs/jsdoc.d.ts +0 -2
- package/dist/esm/configs/jsdoc.js +0 -31
- package/dist/esm/configs/jsonc.d.ts +0 -4
- package/dist/esm/configs/jsonc.js +0 -76
- package/dist/esm/configs/markdown.d.ts +0 -4
- package/dist/esm/configs/markdown.js +0 -122
- package/dist/esm/configs/n.d.ts +0 -2
- package/dist/esm/configs/n.js +0 -21
- package/dist/esm/configs/no-only-tests.d.ts +0 -4
- package/dist/esm/configs/no-only-tests.js +0 -31
- package/dist/esm/configs/perfectionist.d.ts +0 -7
- package/dist/esm/configs/perfectionist.js +0 -60
- package/dist/esm/configs/pnpm.d.ts +0 -2
- package/dist/esm/configs/pnpm.js +0 -34
- package/dist/esm/configs/prettier.d.ts +0 -7
- package/dist/esm/configs/prettier.js +0 -126
- package/dist/esm/configs/react.d.ts +0 -6
- package/dist/esm/configs/react.js +0 -300
- package/dist/esm/configs/sort-package-json.d.ts +0 -7
- package/dist/esm/configs/sort-package-json.js +0 -102
- package/dist/esm/configs/sort-tsconfig.d.ts +0 -14
- package/dist/esm/configs/sort-tsconfig.js +0 -135
- package/dist/esm/configs/stylistic.d.ts +0 -2
- package/dist/esm/configs/stylistic.js +0 -39
- package/dist/esm/configs/tailwind.d.ts +0 -1
- package/dist/esm/configs/tailwind.js +0 -81
- package/dist/esm/configs/toml.d.ts +0 -2
- package/dist/esm/configs/toml.js +0 -50
- package/dist/esm/configs/ts/parser.d.ts +0 -7
- package/dist/esm/configs/ts/parser.js +0 -71
- package/dist/esm/configs/ts/requires-type-checking.d.ts +0 -1
- package/dist/esm/configs/ts/requires-type-checking.js +0 -61
- package/dist/esm/configs/ts/typescript-language-options.d.ts +0 -2
- package/dist/esm/configs/ts/typescript-language-options.js +0 -22
- package/dist/esm/configs/ts/typescript-rules.d.ts +0 -11
- package/dist/esm/configs/ts/typescript-rules.js +0 -379
- package/dist/esm/configs/ts/typescript.d.ts +0 -4
- package/dist/esm/configs/ts/typescript.js +0 -123
- package/dist/esm/configs/tsdoc.d.ts +0 -2
- package/dist/esm/configs/tsdoc.js +0 -16
- package/dist/esm/configs/unicorn.d.ts +0 -2
- package/dist/esm/configs/unicorn.js +0 -114
- package/dist/esm/configs/vitest.d.ts +0 -4
- package/dist/esm/configs/vitest.js +0 -29
- package/dist/esm/configs/yml.d.ts +0 -4
- package/dist/esm/configs/yml.js +0 -51
- package/dist/esm/const.d.ts +0 -5
- package/dist/esm/const.js +0 -25
- package/dist/esm/define-config.d.ts +0 -7
- package/dist/esm/define-config.js +0 -256
- package/dist/esm/dev.d.ts +0 -4
- package/dist/esm/dev.js +0 -25
- package/dist/esm/fixable.d.ts +0 -2
- package/dist/esm/fixable.js +0 -4
- package/dist/esm/generated/fixable-rules-map.d.ts +0 -2
- package/dist/esm/generated/fixable-rules-map.js +0 -443
- package/dist/esm/generated/version.d.ts +0 -1
- package/dist/esm/generated/version.js +0 -1
- package/dist/esm/globs.d.ts +0 -25
- package/dist/esm/globs.js +0 -73
- package/dist/esm/index.d.ts +0 -9
- package/dist/esm/index.js +0 -8
- package/dist/esm/lager.d.ts +0 -32
- package/dist/esm/lager.js +0 -87
- package/dist/esm/log.d.ts +0 -2
- package/dist/esm/log.js +0 -2
- package/dist/esm/plugins-all.d.ts +0 -26
- package/dist/esm/plugins-all.js +0 -120
- package/dist/esm/plugins.d.ts +0 -1570
- package/dist/esm/plugins.js +0 -97
- package/dist/esm/presets.d.ts +0 -18
- package/dist/esm/presets.js +0 -75
- package/dist/esm/types.d.ts +0 -287
- package/dist/esm/types.js +0 -1
- package/dist/esm/utils.d.ts +0 -51
- package/dist/esm/utils.js +0 -156
- package/dist/version-DNhPWuQE.js +0 -5
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VERSION } from "./version-
|
|
1
|
+
import { DEBUG, VERSION } from "./version-Cmu7XVG1.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import process$1 from "node:process";
|
|
4
4
|
import { EventEmitter } from "events";
|
|
@@ -576,6 +576,7 @@ const cac = (name = "") => new CAC(name);
|
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/cli.ts
|
|
578
578
|
const cli = cac("jsselint");
|
|
579
|
+
const DEBUG$1 = DEBUG || process$1.argv.includes("-debug");
|
|
579
580
|
const CONFIG_OPTIONS_STRING = `
|
|
580
581
|
{
|
|
581
582
|
/**
|
|
@@ -626,7 +627,7 @@ export default jsse(
|
|
|
626
627
|
${CONFIG_OPTIONS_STRING}
|
|
627
628
|
);
|
|
628
629
|
`;
|
|
629
|
-
cli.command("", "default command").action(() => {
|
|
630
|
+
cli.command("", "default command ~ show help").action(() => {
|
|
630
631
|
cli.outputHelp();
|
|
631
632
|
process$1.exit(1);
|
|
632
633
|
});
|
|
@@ -661,12 +662,14 @@ cli.command("version", "echo version").action(() => {
|
|
|
661
662
|
cli.version(typeof VERSION === "string" ? VERSION : "unknown");
|
|
662
663
|
cli.help();
|
|
663
664
|
async function main(args) {
|
|
664
|
-
const argv = args ?? process$1.argv
|
|
665
|
+
const argv = args ?? process$1.argv;
|
|
665
666
|
try {
|
|
666
667
|
const parsed = cli.parse(argv, { run: false });
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
if (DEBUG$1) {
|
|
669
|
+
console.log("=====");
|
|
670
|
+
console.log(parsed);
|
|
671
|
+
console.log("=====");
|
|
672
|
+
}
|
|
670
673
|
await cli.runMatchedCommand();
|
|
671
674
|
} catch (error) {
|
|
672
675
|
if (error instanceof Error) {
|
package/dist/index.d.ts
CHANGED
|
@@ -13738,6 +13738,7 @@ type OptionsConfig = {
|
|
|
13738
13738
|
type RenamePefix<T extends Record<string, unknown>, FromPref extends string, ToPref extends string> = { [K in keyof T as K extends `${FromPref}${infer Rest}` ? `${ToPref}${Rest}` : K]: T[K] };
|
|
13739
13739
|
//#endregion
|
|
13740
13740
|
//#region src/const.d.ts
|
|
13741
|
+
declare const DEBUG: boolean;
|
|
13741
13742
|
declare const SLOW_RULES: RuleName[];
|
|
13742
13743
|
//#endregion
|
|
13743
13744
|
//#region src/define-config.d.ts
|
|
@@ -13749,7 +13750,7 @@ declare function defineConfig(options?: OptionsConfig & Config, ...userConfigs:
|
|
|
13749
13750
|
type DefineConfig = typeof defineConfig;
|
|
13750
13751
|
//#endregion
|
|
13751
13752
|
//#region src/generated/version.d.ts
|
|
13752
|
-
declare const VERSION = "0.4.
|
|
13753
|
+
declare const VERSION = "0.4.11";
|
|
13753
13754
|
declare namespace globs_d_exports {
|
|
13754
13755
|
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_YAML };
|
|
13755
13756
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __commonJS, __export, __toESM } from "./chunk-CkHaCily.js";
|
|
2
|
-
import { VERSION } from "./version-
|
|
2
|
+
import { DEBUG, SLOW_RULES, VERSION } from "./version-Cmu7XVG1.js";
|
|
3
3
|
import { builtinModules, createRequire } from "node:module";
|
|
4
4
|
import fs, { promises, realpathSync, statSync } from "node:fs";
|
|
5
5
|
import process$1 from "node:process";
|
|
@@ -27,30 +27,6 @@ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
|
27
27
|
import tseslint from "typescript-eslint";
|
|
28
28
|
import { fixupPluginRules } from "@eslint/compat";
|
|
29
29
|
|
|
30
|
-
//#region src/const.ts
|
|
31
|
-
const SLOW_RULES = [
|
|
32
|
-
"@typescript-eslint/no-misused-promises",
|
|
33
|
-
"@typescript-eslint/no-redeclare",
|
|
34
|
-
"@typescript-eslint/no-unsafe-assignment",
|
|
35
|
-
"@typescript-eslint/no-unsafe-call",
|
|
36
|
-
"@typescript-eslint/no-unsafe-member-access",
|
|
37
|
-
"@typescript-eslint/no-unsafe-return",
|
|
38
|
-
"import/no-duplicates",
|
|
39
|
-
"jsdoc/check-access",
|
|
40
|
-
"jsdoc/check-alignment",
|
|
41
|
-
"jsdoc/check-property-names",
|
|
42
|
-
"jsdoc/check-types",
|
|
43
|
-
"jsdoc/empty-tags",
|
|
44
|
-
"jsdoc/multiline-blocks",
|
|
45
|
-
"jsdoc/no-multi-asterisks",
|
|
46
|
-
"jsdoc/require-property-description",
|
|
47
|
-
"jsdoc/require-property-name",
|
|
48
|
-
"jsdoc/require-property",
|
|
49
|
-
"unicorn/expiring-todo-comments",
|
|
50
|
-
"unicorn/no-unnecessary-polyfills"
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
30
|
//#region node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs
|
|
55
31
|
var astralIdentifierCodes = [
|
|
56
32
|
509,
|
|
@@ -12478,7 +12454,7 @@ async function isValidNodeImport(id, _options = {}) {
|
|
|
12478
12454
|
}
|
|
12479
12455
|
|
|
12480
12456
|
//#endregion
|
|
12481
|
-
//#region node_modules/.pnpm/quansync@0.2.
|
|
12457
|
+
//#region node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/index.mjs
|
|
12482
12458
|
const GET_IS_ASYNC = Symbol.for("quansync.getIsAsync");
|
|
12483
12459
|
var QuansyncError = class extends Error {
|
|
12484
12460
|
constructor(message = "Unexpected promise in sync context") {
|
|
@@ -12572,11 +12548,11 @@ const getIsAsync = quansync$1({
|
|
|
12572
12548
|
});
|
|
12573
12549
|
|
|
12574
12550
|
//#endregion
|
|
12575
|
-
//#region node_modules/.pnpm/quansync@0.2.
|
|
12551
|
+
//#region node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/macro.mjs
|
|
12576
12552
|
const quansync = quansync$1;
|
|
12577
12553
|
|
|
12578
12554
|
//#endregion
|
|
12579
|
-
//#region node_modules/.pnpm/local-pkg@1.1.
|
|
12555
|
+
//#region node_modules/.pnpm/local-pkg@1.1.2/node_modules/local-pkg/dist/index.mjs
|
|
12580
12556
|
const toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
12581
12557
|
async function findUp$1(name, { cwd: cwd$1 = process$1.cwd(), type = "file", stopAt } = {}) {
|
|
12582
12558
|
let directory = path.resolve(toPath(cwd$1) ?? "");
|
|
@@ -12709,76 +12685,12 @@ const isPackageListedSync = isPackageListed.sync;
|
|
|
12709
12685
|
//#endregion
|
|
12710
12686
|
//#region src/lager.ts
|
|
12711
12687
|
const dbg = Debug("jsse:eslint-config");
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
fatal: 60
|
|
12719
|
-
};
|
|
12720
|
-
function isLagerLevel(level) {
|
|
12721
|
-
return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
|
|
12722
|
-
}
|
|
12723
|
-
var Lager = class {
|
|
12724
|
-
_level = "info";
|
|
12725
|
-
id = "lager";
|
|
12726
|
-
levelNo = LAGER_LEVELS[this._level];
|
|
12727
|
-
prefix = "";
|
|
12728
|
-
constructor(options) {
|
|
12729
|
-
const { level, id, prefix } = {
|
|
12730
|
-
level: "info",
|
|
12731
|
-
id: "lager",
|
|
12732
|
-
prefix: "@jsse/eslint-config",
|
|
12733
|
-
...options
|
|
12734
|
-
};
|
|
12735
|
-
this.id = id;
|
|
12736
|
-
this._level = isLagerLevel(level) ? level : "info";
|
|
12737
|
-
this.levelNo = LAGER_LEVELS[this._level];
|
|
12738
|
-
this.prefix = prefix;
|
|
12739
|
-
this.log = this.log.bind(this);
|
|
12740
|
-
this.debug = this.debug.bind(this);
|
|
12741
|
-
}
|
|
12742
|
-
get level() {
|
|
12743
|
-
return this._level;
|
|
12744
|
-
}
|
|
12745
|
-
set level(level) {
|
|
12746
|
-
this._level = level;
|
|
12747
|
-
this.levelNo = LAGER_LEVELS[level];
|
|
12748
|
-
}
|
|
12749
|
-
log(...args) {
|
|
12750
|
-
console.log(this.prefix, ...args);
|
|
12751
|
-
}
|
|
12752
|
-
trace(...args) {
|
|
12753
|
-
if (this.levelNo <= LAGER_LEVELS.trace) {
|
|
12754
|
-
console.trace(this.prefix, ...args);
|
|
12755
|
-
}
|
|
12756
|
-
}
|
|
12757
|
-
debug(...args) {
|
|
12758
|
-
if (this.levelNo <= LAGER_LEVELS.debug) {
|
|
12759
|
-
console.debug(this.prefix, ...args);
|
|
12760
|
-
}
|
|
12761
|
-
}
|
|
12762
|
-
info(...args) {
|
|
12763
|
-
if (this.levelNo <= LAGER_LEVELS.info) {
|
|
12764
|
-
console.info(this.prefix, ...args);
|
|
12765
|
-
}
|
|
12766
|
-
}
|
|
12767
|
-
warn(...args) {
|
|
12768
|
-
if (this.levelNo <= LAGER_LEVELS.warn) {
|
|
12769
|
-
console.warn(this.prefix, ...args);
|
|
12770
|
-
}
|
|
12771
|
-
}
|
|
12772
|
-
error(...args) {
|
|
12773
|
-
if (this.levelNo <= LAGER_LEVELS.error) {
|
|
12774
|
-
console.error(this.prefix, ...args);
|
|
12775
|
-
}
|
|
12776
|
-
}
|
|
12777
|
-
};
|
|
12778
|
-
|
|
12779
|
-
//#endregion
|
|
12780
|
-
//#region src/log.ts
|
|
12781
|
-
const log = new Lager();
|
|
12688
|
+
function enableDbg() {
|
|
12689
|
+
const currentNamespaces = Debug.namespaces;
|
|
12690
|
+
const current = typeof currentNamespaces === "string" ? currentNamespaces : undefined;
|
|
12691
|
+
Debug.enable([current, "jsse:eslint-config"].filter((ns) => ns !== undefined).join(","));
|
|
12692
|
+
dbg("Debugging enabled for @jsse/eslint-config");
|
|
12693
|
+
}
|
|
12782
12694
|
|
|
12783
12695
|
//#endregion
|
|
12784
12696
|
//#region src/utils.ts
|
|
@@ -12857,15 +12769,17 @@ const parserPlain = {
|
|
|
12857
12769
|
function turnOffRules(configs, off) {
|
|
12858
12770
|
if (off.length > 0) {
|
|
12859
12771
|
for (const rule of off) {
|
|
12860
|
-
|
|
12772
|
+
dbg(`turning-off: ${rule}`);
|
|
12861
12773
|
}
|
|
12862
12774
|
const currentlyActiveRules = new Set();
|
|
12863
12775
|
for (const config of configs) {
|
|
12864
|
-
for (const rule of Object.keys(config.rules ?? {}))
|
|
12776
|
+
for (const rule of Object.keys(config.rules ?? {})) {
|
|
12777
|
+
currentlyActiveRules.add(rule);
|
|
12778
|
+
}
|
|
12865
12779
|
}
|
|
12866
12780
|
for (const rule of off) {
|
|
12867
12781
|
if (!currentlyActiveRules.has(rule)) {
|
|
12868
|
-
|
|
12782
|
+
dbg(`Rule \`${rule}\` is not active in the current config, you can remove it from the off list`);
|
|
12869
12783
|
}
|
|
12870
12784
|
}
|
|
12871
12785
|
for (const config of configs) {
|
|
@@ -18440,14 +18354,6 @@ const flatConfigProps = [
|
|
|
18440
18354
|
"rules",
|
|
18441
18355
|
"settings"
|
|
18442
18356
|
];
|
|
18443
|
-
const DEBUG = [
|
|
18444
|
-
"1",
|
|
18445
|
-
"true",
|
|
18446
|
-
"t",
|
|
18447
|
-
"on",
|
|
18448
|
-
"yes",
|
|
18449
|
-
"y"
|
|
18450
|
-
].includes(process$1.env.DEBUG ?? "");
|
|
18451
18357
|
function defaultOptions() {
|
|
18452
18358
|
const typescriptExists = isPackageExists("typescript");
|
|
18453
18359
|
return {
|
|
@@ -18499,27 +18405,27 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
18499
18405
|
const normalizedOptions = normalizeOptions(options);
|
|
18500
18406
|
const { command: enableCommand, componentExts, debug, gitignore: enableGitignore, isInEditor: isInEditor$1, jsonc: enableJsonc, markdown: enableMarkdown, off, overrides = {}, pnpm: enablePnpm, prettier: enablePrettier, react: enableReact, reportUnusedDisableDirectives, rootId, stylistic: stylisticOptions, tailwind: tailwindOptions, test: enableTest, tsPrefix, typeAware, typescript: typescriptOptions, yaml: enableYaml } = normalizedOptions;
|
|
18501
18407
|
if (debug || process$1.argv.includes("--debug")) {
|
|
18502
|
-
|
|
18408
|
+
enableDbg();
|
|
18503
18409
|
}
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18410
|
+
dbg("@jsse/eslint-config debug=true");
|
|
18411
|
+
dbg("@jsse/eslint-config isInEditor: %O", isInEditor$1);
|
|
18412
|
+
dbg("@jsse/eslint-config enableTypeScript: %O", typescriptOptions);
|
|
18413
|
+
dbg("@jsse/eslint-config normalizedOptions: %O", normalizedOptions);
|
|
18508
18414
|
const configs = [];
|
|
18509
18415
|
if (enableGitignore) {
|
|
18510
18416
|
if (typeof enableGitignore === "boolean") {
|
|
18511
18417
|
if (fs.existsSync(".gitignore")) {
|
|
18512
18418
|
configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r$3) => {
|
|
18513
18419
|
const res = r$3();
|
|
18514
|
-
|
|
18420
|
+
dbg("Using eslint-config-flat-gitignore res: %O", res);
|
|
18515
18421
|
return [res];
|
|
18516
18422
|
}));
|
|
18517
18423
|
}
|
|
18518
18424
|
} else {
|
|
18519
18425
|
configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r$3) => {
|
|
18520
|
-
|
|
18426
|
+
dbg("Using eslint-config-flat-gitignore: %O", r$3);
|
|
18521
18427
|
const res = r$3(enableGitignore);
|
|
18522
|
-
|
|
18428
|
+
dbg("Using eslint-config-flat-gitignore: %O", res);
|
|
18523
18429
|
return [res];
|
|
18524
18430
|
}));
|
|
18525
18431
|
}
|
|
@@ -18596,7 +18502,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
18596
18502
|
}), sortPackageJson(), sortTsconfig({ extendTsconfigGlobs: normalizedOptions.extendTsconfigLintGlobs }));
|
|
18597
18503
|
}
|
|
18598
18504
|
if (tailwindOptions) {
|
|
18599
|
-
console.error("Tailwind configuration is
|
|
18505
|
+
console.error("Tailwind configuration is deprecated...");
|
|
18600
18506
|
}
|
|
18601
18507
|
if (normalizedOptions.prettier) {
|
|
18602
18508
|
configs.push(prettier());
|
|
@@ -18640,17 +18546,17 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
18640
18546
|
}
|
|
18641
18547
|
}
|
|
18642
18548
|
if (normalizedOptions.preReturn) {
|
|
18643
|
-
|
|
18549
|
+
dbg("Running preReturn");
|
|
18644
18550
|
const preReturned = normalizedOptions.preReturn(combinedConfigs);
|
|
18645
18551
|
if (preReturned instanceof Promise) {
|
|
18646
18552
|
const res = await preReturned;
|
|
18647
|
-
|
|
18648
|
-
|
|
18553
|
+
dbg("preReturn finished");
|
|
18554
|
+
dbg("final config", res);
|
|
18649
18555
|
return res;
|
|
18650
18556
|
} else {
|
|
18651
18557
|
const res = preReturned;
|
|
18652
|
-
|
|
18653
|
-
|
|
18558
|
+
dbg("preReturn finished");
|
|
18559
|
+
dbg("final config", res);
|
|
18654
18560
|
return res;
|
|
18655
18561
|
}
|
|
18656
18562
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
|
|
3
|
+
//#region src/const.ts
|
|
4
|
+
const DEBUG = [
|
|
5
|
+
"1",
|
|
6
|
+
"true",
|
|
7
|
+
"t",
|
|
8
|
+
"on",
|
|
9
|
+
"yes",
|
|
10
|
+
"y"
|
|
11
|
+
].includes(process.env.DEBUG ?? "");
|
|
12
|
+
const SLOW_RULES = [
|
|
13
|
+
"@typescript-eslint/no-misused-promises",
|
|
14
|
+
"@typescript-eslint/no-redeclare",
|
|
15
|
+
"@typescript-eslint/no-unsafe-assignment",
|
|
16
|
+
"@typescript-eslint/no-unsafe-call",
|
|
17
|
+
"@typescript-eslint/no-unsafe-member-access",
|
|
18
|
+
"@typescript-eslint/no-unsafe-return",
|
|
19
|
+
"import/no-duplicates",
|
|
20
|
+
"jsdoc/check-access",
|
|
21
|
+
"jsdoc/check-alignment",
|
|
22
|
+
"jsdoc/check-property-names",
|
|
23
|
+
"jsdoc/check-types",
|
|
24
|
+
"jsdoc/empty-tags",
|
|
25
|
+
"jsdoc/multiline-blocks",
|
|
26
|
+
"jsdoc/no-multi-asterisks",
|
|
27
|
+
"jsdoc/require-property-description",
|
|
28
|
+
"jsdoc/require-property-name",
|
|
29
|
+
"jsdoc/require-property",
|
|
30
|
+
"unicorn/expiring-todo-comments",
|
|
31
|
+
"unicorn/no-unnecessary-polyfills"
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/generated/version.ts
|
|
36
|
+
const VERSION = "0.4.11";
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DEBUG, SLOW_RULES, VERSION };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsse/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.11",
|
|
5
5
|
"description": "@jsse/eslint-config ~ WYSIWYG",
|
|
6
6
|
"author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
"@eslint/js": "~9.33.0",
|
|
66
66
|
"@eslint/markdown": "^7.1.0",
|
|
67
67
|
"@stylistic/eslint-plugin": "5.2.3",
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
69
|
-
"@typescript-eslint/parser": "^8.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
|
69
|
+
"@typescript-eslint/parser": "^8.40.0",
|
|
70
70
|
"@vitest/eslint-plugin": "^1.3.4",
|
|
71
71
|
"debug": "^4.4.1",
|
|
72
72
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
73
73
|
"eslint-merge-processors": "^2.0.0",
|
|
74
74
|
"eslint-plugin-antfu": "^3.1.1",
|
|
75
75
|
"eslint-plugin-command": "^3.3.1",
|
|
76
|
-
"eslint-plugin-de-morgan": "^1.3.
|
|
76
|
+
"eslint-plugin-de-morgan": "^1.3.1",
|
|
77
77
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
78
|
-
"eslint-plugin-jsdoc": "^54.1.
|
|
78
|
+
"eslint-plugin-jsdoc": "^54.1.1",
|
|
79
79
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
80
80
|
"eslint-plugin-n": "^17.21.3",
|
|
81
81
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"eslint-plugin-yml": "^1.18.0",
|
|
92
92
|
"jsonc-eslint-parser": "^2.4.0",
|
|
93
93
|
"toml-eslint-parser": "^0.10.0",
|
|
94
|
-
"typescript-eslint": "^8.
|
|
94
|
+
"typescript-eslint": "^8.40.0",
|
|
95
95
|
"yaml-eslint-parser": "^1.3.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
@@ -108,16 +108,17 @@
|
|
|
108
108
|
"eslint-typegen": "^2.3.0",
|
|
109
109
|
"execa": "~9.6.0",
|
|
110
110
|
"fast-glob": "^3.3.3",
|
|
111
|
-
"fs-extra": "^11.3.
|
|
111
|
+
"fs-extra": "^11.3.1",
|
|
112
112
|
"globals": "^16.3.0",
|
|
113
|
-
"local-pkg": "^1.1.
|
|
113
|
+
"local-pkg": "^1.1.2",
|
|
114
|
+
"oxlint": "^1.12.0",
|
|
114
115
|
"picocolors": "^1.1.1",
|
|
115
116
|
"prettier": "^3.6.2",
|
|
116
117
|
"react": "~19.1.1",
|
|
117
118
|
"rimraf": "^6.0.1",
|
|
118
119
|
"tsdown": "^0.14.1",
|
|
119
120
|
"tsx": "^4.20.4",
|
|
120
|
-
"typescript": "5.8.3",
|
|
121
|
+
"typescript": "~5.8.3",
|
|
121
122
|
"vitest": "^3.2.4"
|
|
122
123
|
},
|
|
123
124
|
"prettier": "@jsse/prettier-config",
|
|
@@ -130,6 +131,8 @@
|
|
|
130
131
|
"fmt": "prettier -w .",
|
|
131
132
|
"fmtc": "prettier --check .",
|
|
132
133
|
"lint": "pnpm run build-fast && eslint .",
|
|
134
|
+
"lint:self": "pnpm run build-fast && eslint --report-unused-disable-directives .",
|
|
135
|
+
"oxlint": "oxlint",
|
|
133
136
|
"change": "changeset",
|
|
134
137
|
"release": "pnpm run ci:version && pnpm run ci:publish",
|
|
135
138
|
"stub": "tsdown src/index.ts --format esm",
|
package/dist/esm/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/cli.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import process from "node:process";
|
|
4
|
-
import { cac } from "cac";
|
|
5
|
-
import { VERSION } from "./generated/version.js";
|
|
6
|
-
const cli = cac("jsselint");
|
|
7
|
-
const CONFIG_OPTIONS_STRING = `
|
|
8
|
-
{
|
|
9
|
-
/**
|
|
10
|
-
* ===================
|
|
11
|
-
* jsse eslint options
|
|
12
|
-
* ===================
|
|
13
|
-
*/
|
|
14
|
-
debug: false,
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Enable TypeScript support.
|
|
18
|
-
*/
|
|
19
|
-
// typescript: {
|
|
20
|
-
// tsconfigPath: "tsconfig.json", // or ["tsconfig.json", "tsconfig.eslint.json", ...]
|
|
21
|
-
// },
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Enable React support.
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
// react: true,
|
|
28
|
-
// reactRefresh: true,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Report unused disable directives
|
|
32
|
-
* @default true
|
|
33
|
-
*/
|
|
34
|
-
// reportUnusedDisableDirectives: false,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* rules 2 turn off
|
|
38
|
-
* @default []
|
|
39
|
-
* @example ["super-annoying-rule"]
|
|
40
|
-
*/
|
|
41
|
-
// off: [],
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
const CONFIG_STRING_CJS = `// @ts-check
|
|
45
|
-
|
|
46
|
-
module.exports = require("@jsse/eslint-config").jsse(
|
|
47
|
-
${CONFIG_OPTIONS_STRING}
|
|
48
|
-
)
|
|
49
|
-
`;
|
|
50
|
-
const CONFIG_STRING_ESM = `// @ts-check
|
|
51
|
-
import jsse from "@jsse/eslint-config";
|
|
52
|
-
|
|
53
|
-
export default jsse(
|
|
54
|
-
${CONFIG_OPTIONS_STRING}
|
|
55
|
-
);
|
|
56
|
-
`;
|
|
57
|
-
// DEFAULT COMMAND
|
|
58
|
-
cli.command("", "default command").action(() => {
|
|
59
|
-
cli.outputHelp();
|
|
60
|
-
process.exit(1);
|
|
61
|
-
});
|
|
62
|
-
cli
|
|
63
|
-
.command("init", "create eslint config file")
|
|
64
|
-
.option("--force", "force create eslint config file")
|
|
65
|
-
.action(async (options) => {
|
|
66
|
-
console.log("init");
|
|
67
|
-
const configPath = "eslint.config.js";
|
|
68
|
-
if (fs.existsSync(configPath)) {
|
|
69
|
-
const msg = "eslint.config.js already exists";
|
|
70
|
-
console.warn(msg);
|
|
71
|
-
if (!options.force) {
|
|
72
|
-
throw new Error(msg);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (!fs.existsSync("package.json")) {
|
|
76
|
-
const msg = "package.json not found";
|
|
77
|
-
console.warn(msg);
|
|
78
|
-
throw new Error(msg);
|
|
79
|
-
}
|
|
80
|
-
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
81
|
-
// type o package
|
|
82
|
-
const isModule = packageJson.type === "module";
|
|
83
|
-
const eslintConfigString = [
|
|
84
|
-
isModule ? CONFIG_STRING_ESM : CONFIG_STRING_CJS,
|
|
85
|
-
"/* ALT */",
|
|
86
|
-
(isModule ? CONFIG_STRING_CJS : CONFIG_STRING_ESM)
|
|
87
|
-
.split("\n")
|
|
88
|
-
.map((line) => `// ${line}`)
|
|
89
|
-
.join("\n"),
|
|
90
|
-
];
|
|
91
|
-
fs.writeFileSync(configPath, eslintConfigString.join("\n"));
|
|
92
|
-
console.log(`made eslint.config.js (type: ${packageJson.type})`);
|
|
93
|
-
});
|
|
94
|
-
cli.command("version", "echo version").action(() => {
|
|
95
|
-
console.log(VERSION);
|
|
96
|
-
});
|
|
97
|
-
cli.version(typeof VERSION === "string" ? VERSION : "unknown");
|
|
98
|
-
cli.help();
|
|
99
|
-
async function main(args) {
|
|
100
|
-
const argv = args ?? process.argv.slice(2);
|
|
101
|
-
try {
|
|
102
|
-
const parsed = cli.parse(argv, { run: false });
|
|
103
|
-
console.log("=====");
|
|
104
|
-
console.log(parsed);
|
|
105
|
-
console.log("=====");
|
|
106
|
-
await cli.runMatchedCommand();
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
if (error instanceof Error) {
|
|
110
|
-
console.error("Error: %s\n\n%s", error.message, error.stack);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
console.error(error);
|
|
114
|
-
}
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
main().catch((e) => {
|
|
119
|
-
console.error(e);
|
|
120
|
-
throw e;
|
|
121
|
-
});
|