@jsse/eslint-config 0.8.6 → 0.8.7
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 +6 -0
- package/README.md +19 -2
- package/dist/cli.js +78 -11884
- package/dist/index.d.ts +533 -809
- package/dist/index.js +141 -88
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -8
- package/dist/const-xMi9KGIh.js +0 -49
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DJK8HYOj.js";
|
|
2
|
-
import { n as SLOW_RULES, r as VERSION, t as DEBUG } from "./const-xMi9KGIh.js";
|
|
3
2
|
import { builtinModules, createRequire } from "node:module";
|
|
4
|
-
import process$1 from "node:process";
|
|
5
3
|
import fs, { realpathSync, statSync } from "node:fs";
|
|
4
|
+
import process$1 from "node:process";
|
|
6
5
|
import Debug from "debug";
|
|
7
6
|
import pluginE18e from "@e18e/eslint-plugin";
|
|
8
7
|
import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
@@ -14,7 +13,7 @@ import pluginImportLite from "eslint-plugin-import-lite";
|
|
|
14
13
|
import pluginN from "eslint-plugin-n";
|
|
15
14
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
16
15
|
import pluginPnpm from "eslint-plugin-pnpm";
|
|
17
|
-
import
|
|
16
|
+
import { configs } from "eslint-plugin-regexp";
|
|
18
17
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
19
18
|
import pluginUnusedImports from "eslint-plugin-unused-imports";
|
|
20
19
|
import createCommand from "eslint-plugin-command/config";
|
|
@@ -27,6 +26,9 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
27
26
|
import assert from "node:assert";
|
|
28
27
|
import v8 from "node:v8";
|
|
29
28
|
import { format, inspect } from "node:util";
|
|
29
|
+
//#region src/_generated/version.ts
|
|
30
|
+
const VERSION = "0.8.7";
|
|
31
|
+
//#endregion
|
|
30
32
|
//#region src/globs.ts
|
|
31
33
|
var globs_exports = /* @__PURE__ */ __exportAll({
|
|
32
34
|
GLOB_ALL_SRC: () => GLOB_ALL_SRC,
|
|
@@ -232,14 +234,6 @@ const warn = (...args) => {
|
|
|
232
234
|
async function combineAsync(...configs) {
|
|
233
235
|
return (await Promise.all(configs)).flatMap((config) => Array.isArray(config) ? config : [config]);
|
|
234
236
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Combine array and non-array configs into a single array.
|
|
237
|
-
* @param configs configs to combine
|
|
238
|
-
* @returns combined configs as an array
|
|
239
|
-
*/
|
|
240
|
-
async function combine(...configs) {
|
|
241
|
-
return combineAsync(...configs);
|
|
242
|
-
}
|
|
243
237
|
function renameRules(rules, from, to) {
|
|
244
238
|
if (from === to) return rules;
|
|
245
239
|
return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
|
|
@@ -341,29 +335,6 @@ function turnOffRules(configs, off, debug) {
|
|
|
341
335
|
}
|
|
342
336
|
return configs;
|
|
343
337
|
}
|
|
344
|
-
function changeRuleEntrySeverity(ruleConfig, level) {
|
|
345
|
-
if (Array.isArray(ruleConfig)) {
|
|
346
|
-
if (ruleConfig[0] !== level) ruleConfig[0] = level;
|
|
347
|
-
return ruleConfig;
|
|
348
|
-
}
|
|
349
|
-
return level;
|
|
350
|
-
}
|
|
351
|
-
function error2warn(configs) {
|
|
352
|
-
for (const config of configs) if (config.rules) config.rules = Object.fromEntries(Object.entries(config.rules).map(([key, value]) => {
|
|
353
|
-
if (value === "error" || value === 2) return [key, changeRuleEntrySeverity(value, "warn")];
|
|
354
|
-
if (Array.isArray(value) && (value[0] === "error" || value[0] === 2)) return [key, changeRuleEntrySeverity(value, "warn")];
|
|
355
|
-
return [key, value];
|
|
356
|
-
}));
|
|
357
|
-
return configs;
|
|
358
|
-
}
|
|
359
|
-
function warn2error(configs) {
|
|
360
|
-
for (const config of configs) if (config.rules) config.rules = Object.fromEntries(Object.entries(config.rules).map(([key, value]) => {
|
|
361
|
-
if (value === "warn" || value === 1) return [key, changeRuleEntrySeverity(value, "error")];
|
|
362
|
-
if (Array.isArray(value) && (value[0] === "warn" || value[0] === 1)) return [key, changeRuleEntrySeverity(value, "error")];
|
|
363
|
-
return [key, value];
|
|
364
|
-
}));
|
|
365
|
-
return configs;
|
|
366
|
-
}
|
|
367
338
|
const TYPESCRIPT_ESLINT_PREFIX = "@typescript-eslint/";
|
|
368
339
|
function replaceTypescriptEslintPrefixInplace(items, tsPrefix) {
|
|
369
340
|
for (const [key, value] of Object.entries(items)) {
|
|
@@ -374,12 +345,6 @@ function replaceTypescriptEslintPrefixInplace(items, tsPrefix) {
|
|
|
374
345
|
}
|
|
375
346
|
//#endregion
|
|
376
347
|
//#region src/plugins.ts
|
|
377
|
-
async function importPluginReact() {
|
|
378
|
-
return { pluginReact: await interopDefault(import("eslint-plugin-react")) };
|
|
379
|
-
}
|
|
380
|
-
async function importPluginReactRefresh() {
|
|
381
|
-
return { pluginReactRefresh: await interopDefault(import("eslint-plugin-react-refresh")) };
|
|
382
|
-
}
|
|
383
348
|
async function importPluginMarkdown() {
|
|
384
349
|
return { pluginMarkdown: await interopDefault(import("@eslint/markdown")) };
|
|
385
350
|
}
|
|
@@ -393,7 +358,10 @@ const antfu = async (options) => {
|
|
|
393
358
|
files: GLOB_CODE,
|
|
394
359
|
name: "jsse/antfu",
|
|
395
360
|
plugins: { antfu: pluginAntfu },
|
|
396
|
-
rules: {
|
|
361
|
+
rules: {
|
|
362
|
+
"antfu/top-level-function": options?.topLevelFunction ?? "off",
|
|
363
|
+
...options?.overrides
|
|
364
|
+
}
|
|
397
365
|
}];
|
|
398
366
|
};
|
|
399
367
|
//#endregion
|
|
@@ -405,20 +373,29 @@ const antfu = async (options) => {
|
|
|
405
373
|
* Docs: https://eslint-plugin-command.antfu.me/guide/
|
|
406
374
|
* @returns Typed config arr
|
|
407
375
|
*/
|
|
408
|
-
const command = async () => {
|
|
376
|
+
const command = async (options) => {
|
|
377
|
+
const config = createCommand();
|
|
409
378
|
return [{
|
|
410
|
-
...
|
|
379
|
+
...config,
|
|
411
380
|
files: GLOB_CODE,
|
|
412
|
-
name: "jsse/command/rules"
|
|
381
|
+
name: "jsse/command/rules",
|
|
382
|
+
rules: {
|
|
383
|
+
...config.rules,
|
|
384
|
+
...options?.overrides
|
|
385
|
+
}
|
|
413
386
|
}];
|
|
414
387
|
};
|
|
415
388
|
//#endregion
|
|
416
389
|
//#region src/configs/de-morgan.ts
|
|
417
|
-
const deMorgan = async () => {
|
|
390
|
+
const deMorgan = async (options) => {
|
|
418
391
|
return [{
|
|
419
392
|
...pluginDeMorgan.configs.recommended,
|
|
420
393
|
files: GLOB_CODE,
|
|
421
|
-
name: "jsse/de-morgan"
|
|
394
|
+
name: "jsse/de-morgan",
|
|
395
|
+
rules: {
|
|
396
|
+
...pluginDeMorgan.configs.recommended.rules,
|
|
397
|
+
...options?.overrides
|
|
398
|
+
}
|
|
422
399
|
}];
|
|
423
400
|
};
|
|
424
401
|
//#endregion
|
|
@@ -505,7 +482,7 @@ async function importReactPlugins() {
|
|
|
505
482
|
};
|
|
506
483
|
}
|
|
507
484
|
const eslintReact = async (options) => {
|
|
508
|
-
const { componentExts, parserOptions = {}, react, reactRefresh, tsconfig } = options ?? {};
|
|
485
|
+
const { componentExts, overrides = {}, parserOptions = {}, react, reactRefresh, tsconfig } = options ?? {};
|
|
509
486
|
const { pluginReact, pluginReactRefresh } = await importReactPlugins();
|
|
510
487
|
const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
|
|
511
488
|
if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
|
|
@@ -531,7 +508,8 @@ const eslintReact = async (options) => {
|
|
|
531
508
|
rules: {
|
|
532
509
|
...pluginReact.configs.recommended.rules,
|
|
533
510
|
"react/dom-no-string-style-prop": "off",
|
|
534
|
-
"react/dom-no-unknown-property": "off"
|
|
511
|
+
"react/dom-no-unknown-property": "off",
|
|
512
|
+
...overrides
|
|
535
513
|
},
|
|
536
514
|
settings: { react: { version: "detect" } }
|
|
537
515
|
},
|
|
@@ -4914,7 +4892,7 @@ const javascript = async (options) => {
|
|
|
4914
4892
|
};
|
|
4915
4893
|
//#endregion
|
|
4916
4894
|
//#region src/configs/jsdoc.ts
|
|
4917
|
-
const jsdoc = async () => {
|
|
4895
|
+
const jsdoc = async (options) => {
|
|
4918
4896
|
return [{
|
|
4919
4897
|
files: GLOB_CODE,
|
|
4920
4898
|
name: "jsse/jsdoc",
|
|
@@ -4937,7 +4915,8 @@ const jsdoc = async () => {
|
|
|
4937
4915
|
"jsdoc/require-returns-check": "warn",
|
|
4938
4916
|
"jsdoc/require-returns-description": "warn",
|
|
4939
4917
|
"jsdoc/require-yields-check": "warn",
|
|
4940
|
-
"jsdoc/tag-lines": "warn"
|
|
4918
|
+
"jsdoc/tag-lines": "warn",
|
|
4919
|
+
...options?.overrides
|
|
4941
4920
|
}
|
|
4942
4921
|
}];
|
|
4943
4922
|
};
|
|
@@ -5261,7 +5240,7 @@ const markdown = async (options) => {
|
|
|
5261
5240
|
};
|
|
5262
5241
|
//#endregion
|
|
5263
5242
|
//#region src/configs/n.ts
|
|
5264
|
-
const n = async () => {
|
|
5243
|
+
const n = async (options) => {
|
|
5265
5244
|
return [{
|
|
5266
5245
|
files: GLOB_CODE,
|
|
5267
5246
|
name: "jsse/n",
|
|
@@ -5274,7 +5253,8 @@ const n = async () => {
|
|
|
5274
5253
|
"n/no-path-concat": "error",
|
|
5275
5254
|
"n/prefer-global/buffer": ["error", "never"],
|
|
5276
5255
|
"n/prefer-global/process": ["error", "never"],
|
|
5277
|
-
"n/process-exit-as-throw": "error"
|
|
5256
|
+
"n/process-exit-as-throw": "error",
|
|
5257
|
+
...options?.overrides
|
|
5278
5258
|
}
|
|
5279
5259
|
}];
|
|
5280
5260
|
};
|
|
@@ -5355,7 +5335,9 @@ const perfectionist = async () => {
|
|
|
5355
5335
|
};
|
|
5356
5336
|
//#endregion
|
|
5357
5337
|
//#region src/configs/pnpm.ts
|
|
5358
|
-
const pnpm = async () => {
|
|
5338
|
+
const pnpm = async (options) => {
|
|
5339
|
+
const jsonOverrides = Object.fromEntries(Object.entries(options?.overrides ?? {}).filter(([rule]) => rule.startsWith("pnpm/json-")));
|
|
5340
|
+
const yamlOverrides = Object.fromEntries(Object.entries(options?.overrides ?? {}).filter(([rule]) => rule.startsWith("pnpm/yaml-")));
|
|
5359
5341
|
return [{
|
|
5360
5342
|
files: ["package.json", "**/package.json"],
|
|
5361
5343
|
languageOptions: { parser: await import("jsonc-eslint-parser") },
|
|
@@ -5364,7 +5346,8 @@ const pnpm = async () => {
|
|
|
5364
5346
|
rules: {
|
|
5365
5347
|
"pnpm/json-enforce-catalog": "error",
|
|
5366
5348
|
"pnpm/json-prefer-workspace-settings": "error",
|
|
5367
|
-
"pnpm/json-valid-catalog": "error"
|
|
5349
|
+
"pnpm/json-valid-catalog": "error",
|
|
5350
|
+
...jsonOverrides
|
|
5368
5351
|
}
|
|
5369
5352
|
}, {
|
|
5370
5353
|
files: ["pnpm-workspace.yaml"],
|
|
@@ -5373,7 +5356,8 @@ const pnpm = async () => {
|
|
|
5373
5356
|
plugins: { pnpm: pluginPnpm },
|
|
5374
5357
|
rules: {
|
|
5375
5358
|
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
5376
|
-
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
5359
|
+
"pnpm/yaml-no-unused-catalog-item": "error",
|
|
5360
|
+
...yamlOverrides
|
|
5377
5361
|
}
|
|
5378
5362
|
}];
|
|
5379
5363
|
};
|
|
@@ -5620,6 +5604,11 @@ const sortPackageJson = async () => {
|
|
|
5620
5604
|
};
|
|
5621
5605
|
//#endregion
|
|
5622
5606
|
//#region src/configs/sort-tsconfig.ts
|
|
5607
|
+
/**
|
|
5608
|
+
* Sort tsconfig.json
|
|
5609
|
+
*
|
|
5610
|
+
* Requires `jsonc` config
|
|
5611
|
+
*/
|
|
5623
5612
|
const tsconfigGlobs = (extendGlobs) => {
|
|
5624
5613
|
return extendGlobs === void 0 || extendGlobs.length === 0 ? GLOB_TSCONFIG : uniqueStrings(GLOB_TSCONFIG, extendGlobs);
|
|
5625
5614
|
};
|
|
@@ -5896,7 +5885,7 @@ const typescript = async (options) => {
|
|
|
5896
5885
|
});
|
|
5897
5886
|
tsEslintConfigs.push({
|
|
5898
5887
|
files: ["**/*.d.ts"],
|
|
5899
|
-
name: "jsse/typescript
|
|
5888
|
+
name: "jsse/typescript/disables/dts",
|
|
5900
5889
|
rules: {
|
|
5901
5890
|
"eslint-comments/no-unlimited-disable": "off",
|
|
5902
5891
|
"import/no-duplicates": "off",
|
|
@@ -5905,14 +5894,14 @@ const typescript = async (options) => {
|
|
|
5905
5894
|
}
|
|
5906
5895
|
}, {
|
|
5907
5896
|
files: ["**/*.{test,spec}.ts?(x)"],
|
|
5908
|
-
name: "jsse/typescript
|
|
5897
|
+
name: "jsse/typescript/disables/test",
|
|
5909
5898
|
rules: {
|
|
5910
5899
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
5911
5900
|
"no-unused-expressions": "off"
|
|
5912
5901
|
}
|
|
5913
5902
|
}, {
|
|
5914
5903
|
files: ["**/*.js", "**/*.cjs"],
|
|
5915
|
-
name: "jsse/typescript/
|
|
5904
|
+
name: "jsse/typescript/disables/js",
|
|
5916
5905
|
rules: {
|
|
5917
5906
|
"@typescript-eslint/no-require-imports": "off",
|
|
5918
5907
|
"@typescript-eslint/no-var-requires": "off"
|
|
@@ -5943,13 +5932,21 @@ function unicornRecommended(pluginUnicorn) {
|
|
|
5943
5932
|
if (rules === void 0) throw new Error("Expected rules to be defined in unicorn plugin");
|
|
5944
5933
|
return rules;
|
|
5945
5934
|
}
|
|
5946
|
-
|
|
5935
|
+
function unicornPresetRules(pluginUnicorn, preset) {
|
|
5936
|
+
switch (preset) {
|
|
5937
|
+
case "recommended": return unicornRecommended(pluginUnicorn);
|
|
5938
|
+
case "unopinionated": return pluginUnicorn.configs.unopinionated.rules ?? {};
|
|
5939
|
+
case "all": return pluginUnicorn.configs.all.rules ?? {};
|
|
5940
|
+
default: throw new Error(`Unknown preset: ${preset}`);
|
|
5941
|
+
}
|
|
5942
|
+
}
|
|
5943
|
+
const unicorn = async ({ overrides = {}, preset = "recommended" } = {}) => {
|
|
5947
5944
|
return [{
|
|
5948
5945
|
files: GLOB_CODE,
|
|
5949
5946
|
name: "jsse/unicorn",
|
|
5950
5947
|
plugins: { unicorn: pluginUnicorn },
|
|
5951
5948
|
rules: {
|
|
5952
|
-
...
|
|
5949
|
+
...unicornPresetRules(pluginUnicorn, preset),
|
|
5953
5950
|
...unicornOff(),
|
|
5954
5951
|
"unicorn/better-regex": "error",
|
|
5955
5952
|
"unicorn/consistent-empty-array-spread": "error",
|
|
@@ -6003,7 +6000,8 @@ const unicorn = async () => {
|
|
|
6003
6000
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
6004
6001
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
6005
6002
|
"unicorn/prefer-type-error": "error",
|
|
6006
|
-
"unicorn/throw-new-error": "error"
|
|
6003
|
+
"unicorn/throw-new-error": "error",
|
|
6004
|
+
...overrides
|
|
6007
6005
|
}
|
|
6008
6006
|
}, {
|
|
6009
6007
|
files: GLOB_TESTS,
|
|
@@ -12620,22 +12618,70 @@ quansync(function* (name, cwd) {
|
|
|
12620
12618
|
return name in (pkg.dependencies || {}) || name in (pkg.devDependencies || {});
|
|
12621
12619
|
}).sync;
|
|
12622
12620
|
//#endregion
|
|
12621
|
+
//#region src/const.ts
|
|
12622
|
+
/**
|
|
12623
|
+
* CONSTANTS LISTS AND REFERENCES OH MY!
|
|
12624
|
+
*/
|
|
12625
|
+
const isEnvDebug = () => {
|
|
12626
|
+
return [
|
|
12627
|
+
"DEBUG",
|
|
12628
|
+
"JSSE_DEBUG",
|
|
12629
|
+
"JSSEDEBUG"
|
|
12630
|
+
].some((env) => {
|
|
12631
|
+
const value = process$1.env[env];
|
|
12632
|
+
return [
|
|
12633
|
+
"1",
|
|
12634
|
+
"true",
|
|
12635
|
+
"t",
|
|
12636
|
+
"on",
|
|
12637
|
+
"yes",
|
|
12638
|
+
"y"
|
|
12639
|
+
].includes(value ?? "");
|
|
12640
|
+
});
|
|
12641
|
+
};
|
|
12642
|
+
const DEBUG = isEnvDebug();
|
|
12643
|
+
const SLOW_RULES = [
|
|
12644
|
+
"@typescript-eslint/no-misused-promises",
|
|
12645
|
+
"@typescript-eslint/no-redeclare",
|
|
12646
|
+
"@typescript-eslint/no-unsafe-assignment",
|
|
12647
|
+
"@typescript-eslint/no-unsafe-call",
|
|
12648
|
+
"@typescript-eslint/no-unsafe-member-access",
|
|
12649
|
+
"@typescript-eslint/no-unsafe-return",
|
|
12650
|
+
"import/no-duplicates",
|
|
12651
|
+
"jsdoc/check-access",
|
|
12652
|
+
"jsdoc/check-alignment",
|
|
12653
|
+
"jsdoc/check-property-names",
|
|
12654
|
+
"jsdoc/check-types",
|
|
12655
|
+
"jsdoc/empty-tags",
|
|
12656
|
+
"jsdoc/multiline-blocks",
|
|
12657
|
+
"jsdoc/no-multi-asterisks",
|
|
12658
|
+
"jsdoc/require-property-description",
|
|
12659
|
+
"jsdoc/require-property-name",
|
|
12660
|
+
"jsdoc/require-property",
|
|
12661
|
+
"unicorn/expiring-todo-comments",
|
|
12662
|
+
"unicorn/no-unnecessary-polyfills"
|
|
12663
|
+
];
|
|
12664
|
+
//#endregion
|
|
12623
12665
|
//#region src/options.ts
|
|
12624
12666
|
function defaultOptions() {
|
|
12625
12667
|
const typescriptExists = isPackageExists("typescript");
|
|
12626
12668
|
const vitestExists = isPackageExists("vitest");
|
|
12627
12669
|
return {
|
|
12670
|
+
antfu: true,
|
|
12628
12671
|
command: true,
|
|
12629
12672
|
componentExts: [],
|
|
12630
12673
|
debug: DEBUG && process$1.env.TEST !== "true",
|
|
12674
|
+
demorgan: true,
|
|
12631
12675
|
diagnostics: true,
|
|
12676
|
+
e18e: true,
|
|
12632
12677
|
fast: false,
|
|
12633
12678
|
gitignore: true,
|
|
12634
12679
|
isInEditor: isInEditor(),
|
|
12680
|
+
jsdoc: true,
|
|
12635
12681
|
jsonc: true,
|
|
12636
12682
|
markdown: false,
|
|
12683
|
+
n: true,
|
|
12637
12684
|
off: [],
|
|
12638
|
-
overrides: {},
|
|
12639
12685
|
pnpm: false,
|
|
12640
12686
|
prettier: true,
|
|
12641
12687
|
react: false,
|
|
@@ -12652,6 +12698,7 @@ function defaultOptions() {
|
|
|
12652
12698
|
tsPrefix: "@typescript-eslint",
|
|
12653
12699
|
typeAware: false,
|
|
12654
12700
|
typescript: typescriptExists,
|
|
12701
|
+
unicorn: true,
|
|
12655
12702
|
yaml: false
|
|
12656
12703
|
};
|
|
12657
12704
|
}
|
|
@@ -12739,8 +12786,9 @@ const FLAT_CFG_PROPS = [
|
|
|
12739
12786
|
* @returns Array of ESLint flat config items
|
|
12740
12787
|
*/
|
|
12741
12788
|
async function jsse(options = {}, ...userConfigs) {
|
|
12789
|
+
const startTime = process$1.hrtime.bigint();
|
|
12742
12790
|
const normalizedOptions = normalizeOptions(options);
|
|
12743
|
-
const { command:
|
|
12791
|
+
const { antfu: antfuOptions, command: commandOptions, componentExts, debug = false, demorgan: deMorganOptions, e18e: e18eOptions, gitignore: enableGitignore, isInEditor, javascript: javascriptOptions, jsdoc: jsdocOptions, jsonc: enableJsonc, markdown: enableMarkdown, n: nOptions, off, pnpm: pnpmOptions, prettier: enablePrettier, react: enableReact, regexp: enableRegexp, reportUnusedDisableDirectives, rootId, sortGeojson: enableSortGeojson, sortImports: enableSortImports, sortPackageJson: enableSortPackageJson, sortTsconfig: enableSortTsconfig, stylistic: stylisticOptions, tailwind: tailwindOptions, test: enableTest, tsPrefix, typescript: typescriptOptions, unicorn: unicornOptions, yaml: enableYaml } = normalizedOptions;
|
|
12744
12792
|
if (debug || process$1.argv.includes("--debug")) enableDbg();
|
|
12745
12793
|
dbg("@jsse/eslint-config debug=true");
|
|
12746
12794
|
dbg("@jsse/eslint-config isInEditor: %O", isInEditor);
|
|
@@ -12761,22 +12809,22 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12761
12809
|
}));
|
|
12762
12810
|
configs.push(ignores(), javascript({
|
|
12763
12811
|
isInEditor,
|
|
12764
|
-
|
|
12812
|
+
...javascriptOptions,
|
|
12765
12813
|
reportUnusedDisableDirectives
|
|
12766
|
-
}), eslintComments(), n(), jsdoc(), imports({ stylistic: stylisticOptions }), unicorn(), antfu(), deMorgan(), e18e());
|
|
12814
|
+
}), eslintComments(), ...nOptions ? [n(typeof nOptions === "object" ? nOptions : void 0)] : [], ...jsdocOptions ? [jsdoc(typeof jsdocOptions === "object" ? jsdocOptions : void 0)] : [], imports({ stylistic: stylisticOptions }), ...unicornOptions ? [unicorn(typeof unicornOptions === "object" ? unicornOptions : {})] : [], ...antfuOptions ? [antfu(typeof antfuOptions === "object" ? antfuOptions : void 0)] : [], ...deMorganOptions ? [deMorgan(typeof deMorganOptions === "object" ? deMorganOptions : void 0)] : [], ...e18eOptions ? [e18e(typeof e18eOptions === "object" ? e18eOptions : {})] : []);
|
|
12767
12815
|
if (enableSortImports) configs.push(perfectionist());
|
|
12768
12816
|
/**
|
|
12769
12817
|
* =========================================================================
|
|
12770
12818
|
* COMMAND
|
|
12771
12819
|
* ========================================================================
|
|
12772
12820
|
*/
|
|
12773
|
-
if (
|
|
12821
|
+
if (commandOptions) configs.push(command(typeof commandOptions === "object" ? commandOptions : void 0));
|
|
12774
12822
|
/**
|
|
12775
12823
|
* =========================================================================
|
|
12776
12824
|
* PNPM
|
|
12777
12825
|
* ========================================================================
|
|
12778
12826
|
*/
|
|
12779
|
-
if (
|
|
12827
|
+
if (pnpmOptions) configs.push(pnpm(typeof pnpmOptions === "object" ? pnpmOptions : void 0));
|
|
12780
12828
|
/**
|
|
12781
12829
|
* =========================================================================
|
|
12782
12830
|
* TYPESCRIPT
|
|
@@ -12788,13 +12836,11 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12788
12836
|
const tscfg = typescript({
|
|
12789
12837
|
...typeof typescriptOptions !== "boolean" && typescriptOptions,
|
|
12790
12838
|
componentExts,
|
|
12791
|
-
overrides: overrides.typescript,
|
|
12792
|
-
overridesTypeAware: typeof typescriptOptions === "object" ? typescriptOptions.overridesTypeAware : void 0,
|
|
12793
12839
|
prefix: {
|
|
12794
12840
|
from: "@typescript-eslint",
|
|
12795
12841
|
to: tsPrefix ?? "@typescript-eslint"
|
|
12796
12842
|
},
|
|
12797
|
-
react: enableReact,
|
|
12843
|
+
react: !!enableReact,
|
|
12798
12844
|
typeAware: effectiveTypeAware
|
|
12799
12845
|
});
|
|
12800
12846
|
configs.push(tscfg);
|
|
@@ -12802,26 +12848,39 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12802
12848
|
ignores: [GLOB_TS, GLOB_TSX],
|
|
12803
12849
|
name: "jsse/ignores/typescript-disabled"
|
|
12804
12850
|
}]);
|
|
12805
|
-
if (enableMarkdown) configs.push(markdown(
|
|
12851
|
+
if (enableMarkdown) configs.push(markdown({
|
|
12852
|
+
componentExts,
|
|
12853
|
+
...typeof enableMarkdown === "object" && enableMarkdown
|
|
12854
|
+
}));
|
|
12806
12855
|
if (enableYaml) {
|
|
12807
|
-
const ymlConfig = yml();
|
|
12856
|
+
const ymlConfig = yml(typeof enableYaml === "object" ? enableYaml : void 0);
|
|
12808
12857
|
configs.push(ymlConfig);
|
|
12809
12858
|
}
|
|
12810
|
-
if (enableReact) configs.push(eslintReact({
|
|
12859
|
+
if (enableReact) configs.push(eslintReact({
|
|
12860
|
+
componentExts,
|
|
12861
|
+
parserOptions: normalizedOptions.parserOptions,
|
|
12862
|
+
...typeof typescriptOptions === "object" && { tsconfig: typescriptOptions.tsconfig },
|
|
12863
|
+
...typeof enableReact === "object" && enableReact,
|
|
12864
|
+
react: true,
|
|
12865
|
+
reactRefresh: typeof enableReact === "object" && enableReact.reactRefresh !== void 0 ? enableReact.reactRefresh : normalizedOptions.reactRefresh !== false
|
|
12866
|
+
}));
|
|
12811
12867
|
if (enablePrettier) configs.push(prettier());
|
|
12812
12868
|
if (stylisticOptions) configs.push(stylistic(stylisticOptions === true ? {} : stylisticOptions));
|
|
12813
12869
|
if (enableRegexp) configs.push(regexp());
|
|
12814
12870
|
if (enableTest) configs.push(vitest({
|
|
12815
12871
|
isInEditor,
|
|
12816
|
-
|
|
12872
|
+
...typeof enableTest === "object" && enableTest
|
|
12817
12873
|
}), noOnlyTests({ isInEditor }));
|
|
12818
12874
|
if (enableJsonc) {
|
|
12819
12875
|
configs.push(jsonc({
|
|
12820
|
-
|
|
12821
|
-
|
|
12876
|
+
stylistic: stylisticOptions,
|
|
12877
|
+
...typeof enableJsonc === "object" && enableJsonc
|
|
12822
12878
|
}));
|
|
12823
12879
|
if (enableSortPackageJson) configs.push(sortPackageJson());
|
|
12824
|
-
if (enableSortTsconfig) configs.push(sortTsconfig({
|
|
12880
|
+
if (enableSortTsconfig) configs.push(sortTsconfig({
|
|
12881
|
+
extendTsconfigGlobs: typeof enableSortTsconfig === "object" ? enableSortTsconfig.extendTsconfigGlobs : normalizedOptions.extendTsconfigLintGlobs,
|
|
12882
|
+
...typeof enableSortTsconfig === "object" && enableSortTsconfig
|
|
12883
|
+
}));
|
|
12825
12884
|
if (enableSortGeojson) configs.push(sortGeojson());
|
|
12826
12885
|
}
|
|
12827
12886
|
if (tailwindOptions) console.error("Tailwind configuration is deprecated...");
|
|
@@ -12843,22 +12902,16 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12843
12902
|
const res = await normalizedOptions.preReturn(finalizedConfigs);
|
|
12844
12903
|
dbg("preReturn finished");
|
|
12845
12904
|
dbg("final config", res);
|
|
12905
|
+
const endTime = process$1.hrtime.bigint();
|
|
12906
|
+
dbg("defineConfig completed in %d ms", Number(endTime - startTime) / 1e6);
|
|
12846
12907
|
return res;
|
|
12847
12908
|
}
|
|
12909
|
+
const endTime = process$1.hrtime.bigint();
|
|
12910
|
+
dbg("defineConfig completed in %d ms", Number(endTime - startTime) / 1e6);
|
|
12848
12911
|
return finalizedConfigs;
|
|
12849
12912
|
}
|
|
12850
12913
|
async function defineConfig(options = {}, ...userConfigs) {
|
|
12851
12914
|
return jsse(options, ...userConfigs);
|
|
12852
12915
|
}
|
|
12853
12916
|
//#endregion
|
|
12854
|
-
|
|
12855
|
-
const jsseReact = (options, ...configs) => {
|
|
12856
|
-
return jsse({
|
|
12857
|
-
react: true,
|
|
12858
|
-
reactRefresh: true,
|
|
12859
|
-
typescript: { tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"] },
|
|
12860
|
-
...options
|
|
12861
|
-
}, ...configs);
|
|
12862
|
-
};
|
|
12863
|
-
//#endregion
|
|
12864
|
-
export { SLOW_RULES, VERSION, changeRuleEntrySeverity, combine, combineAsync, jsse as default, jsse, defaultOptions, defineConfig, error2warn, globs_exports as globs, importPluginMarkdown, importPluginReact, importPluginReactRefresh, importPluginStylistic, interopDefault, isCI, isInEditor, jsseReact, normalizeOptions, parserPlain, parserTs, pluginAntfu, pluginDeMorgan, pluginE18e, pluginEslintComments, pluginImportLite, pluginN, pluginPerfectionist, pluginPnpm, pluginRegexp, pluginTs, pluginUnicorn, pluginUnusedImports, renameRules, replaceTypescriptEslintPrefixInplace, scopeTypeScriptRules, turnOffRules, uniqueStrings, warn2error };
|
|
12917
|
+
export { VERSION, jsse as default, jsse, defaultOptions, defineConfig, globs_exports as globs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/cli.ts","../src/config-registry.test.ts","../src/config-registry.ts","../src/const.ts","../src/define-config.ts","../src/fixable.test.ts","../src/fixable.ts","../src/globs.ts","../src/index.ts","../src/lager.ts","../src/options.test.ts","../src/options.ts","../src/plugin-registry.test.ts","../src/plugin-registry.ts","../src/plugins.ts","../src/postprocess.test.ts","../src/postprocess.ts","../src/
|
|
1
|
+
{"root":["../src/cli.ts","../src/config-registry.test.ts","../src/config-registry.ts","../src/const.ts","../src/define-config.ts","../src/fixable.test.ts","../src/fixable.ts","../src/globs.ts","../src/index.ts","../src/lager.ts","../src/options.test.ts","../src/options.ts","../src/plugin-registry.test.ts","../src/plugin-registry.ts","../src/plugins.ts","../src/postprocess.test.ts","../src/postprocess.ts","../src/types.ts","../src/utils.ts","../src/_generated/fixable-rules-map.ts","../src/_generated/rule-options.d.ts","../src/_generated/version.ts","../src/_generated/dts/antfu.d.ts","../src/_generated/dts/builtins.d.ts","../src/_generated/dts/command.d.ts","../src/_generated/dts/de-morgan.d.ts","../src/_generated/dts/e18e.d.ts","../src/_generated/dts/eslint-comments.d.ts","../src/_generated/dts/eslint-react.d.ts","../src/_generated/dts/ignores.d.ts","../src/_generated/dts/imports.d.ts","../src/_generated/dts/javascript.d.ts","../src/_generated/dts/jsdoc.d.ts","../src/_generated/dts/jsonc.d.ts","../src/_generated/dts/markdown.d.ts","../src/_generated/dts/n.d.ts","../src/_generated/dts/no-only-tests.d.ts","../src/_generated/dts/perfectionist.d.ts","../src/_generated/dts/pnpm.d.ts","../src/_generated/dts/prettier.d.ts","../src/_generated/dts/react-hooks.d.ts","../src/_generated/dts/regexp.d.ts","../src/_generated/dts/sort-package-json.d.ts","../src/_generated/dts/sort-tsconfig.d.ts","../src/_generated/dts/stylistic.d.ts","../src/_generated/dts/toml.d.ts","../src/_generated/dts/typescript.d.ts","../src/_generated/dts/unicorn.d.ts","../src/_generated/dts/vitest.d.ts","../src/_generated/dts/yml.d.ts","../src/configs/_template.ts","../src/configs/antfu.ts","../src/configs/command.ts","../src/configs/de-morgan.ts","../src/configs/disables.ts","../src/configs/e18e.ts","../src/configs/eslint-comments.ts","../src/configs/eslint-react.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/jsdoc.ts","../src/configs/jsonc.ts","../src/configs/markdown.ts","../src/configs/n.ts","../src/configs/no-only-tests.ts","../src/configs/perfectionist.ts","../src/configs/pnpm.ts","../src/configs/prettier.ts","../src/configs/react-hooks.ts","../src/configs/react.ts","../src/configs/regexp.ts","../src/configs/rules.test.ts","../src/configs/sort-geojson.ts","../src/configs/sort-package-json.ts","../src/configs/sort-tsconfig.ts","../src/configs/stylistic.ts","../src/configs/toml.ts","../src/configs/tsdoc.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/configs/yml.ts","../src/configs/_legacy/tailwind.ts","../src/configs/_legacy/typescript-legacy-rules.ts","../src/configs/ts/parser.ts","../src/configs/ts/requires-type-checking.ts","../src/configs/ts/typescript-language-options.ts","../src/configs/ts/typescript-rules.ts","../src/configs/ts/typescript.ts"],"version":"6.0.3"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsse/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.7",
|
|
5
5
|
"description": "@jsse/eslint-config ~ WYSIWYG",
|
|
6
6
|
"author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
-
"./package.json": "./package.json"
|
|
23
|
-
"./dist/*": "./dist/*"
|
|
22
|
+
"./package.json": "./package.json"
|
|
24
23
|
},
|
|
25
24
|
"main": "./dist/index.js",
|
|
26
25
|
"types": "./dist/index.d.ts",
|
|
@@ -85,7 +84,7 @@
|
|
|
85
84
|
"eslint-plugin-react-refresh": "^0.5.3",
|
|
86
85
|
"eslint-plugin-regexp": "^3.1.1",
|
|
87
86
|
"eslint-plugin-toml": "^1.4.0",
|
|
88
|
-
"eslint-plugin-unicorn": "^
|
|
87
|
+
"eslint-plugin-unicorn": "^70.0.0",
|
|
89
88
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
90
89
|
"eslint-plugin-yml": "^3.5.0",
|
|
91
90
|
"jsonc-eslint-parser": "^3.1.0",
|
|
@@ -95,7 +94,7 @@
|
|
|
95
94
|
},
|
|
96
95
|
"devDependencies": {
|
|
97
96
|
"@changesets/cli": "^2.31.0",
|
|
98
|
-
"@eslint-react/eslint-plugin": "^5.10.
|
|
97
|
+
"@eslint-react/eslint-plugin": "^5.10.1",
|
|
99
98
|
"@jsse/prettier-config": "^1.0.2",
|
|
100
99
|
"@jsse/tsconfig": "^0.5.1",
|
|
101
100
|
"@optique/core": "^1.1.1",
|
|
@@ -113,7 +112,7 @@
|
|
|
113
112
|
"fast-glob": "^3.3.3",
|
|
114
113
|
"fs-extra": "^11.3.6",
|
|
115
114
|
"globals": "^17.7.0",
|
|
116
|
-
"knip": "^6.
|
|
115
|
+
"knip": "^6.24.0",
|
|
117
116
|
"local-pkg": "^1.2.1",
|
|
118
117
|
"oxfmt": "^0.57.0",
|
|
119
118
|
"oxlint": "^1.72.0",
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
"react": "~19.2.7",
|
|
124
123
|
"rimraf": "^6.1.3",
|
|
125
124
|
"tsdown": "^0.22.3",
|
|
126
|
-
"tsx": "^4.22.
|
|
125
|
+
"tsx": "^4.22.5",
|
|
127
126
|
"typescript": "~6.0.3",
|
|
128
127
|
"vitest": "^4.1.9"
|
|
129
128
|
},
|
|
@@ -131,7 +130,7 @@
|
|
|
131
130
|
"scripts": {
|
|
132
131
|
"build": "pnpm gen && pnpm build-fast --dts && pnpm build:tsc && eslint .",
|
|
133
132
|
"build:tsc": "tsc -b tsconfig.build.json",
|
|
134
|
-
"build-fast": "tsdown
|
|
133
|
+
"build-fast": "tsdown --clean",
|
|
135
134
|
"gen": "tsx scripts/gen.ts && prettier -w --cache --object-wrap=collapse src/_generated",
|
|
136
135
|
"dev": "tsdown src/index.ts --format esm --watch",
|
|
137
136
|
"fmt": "prettier -w --object-wrap=collapse .",
|
package/dist/const-xMi9KGIh.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import process from "node:process";
|
|
2
|
-
//#region src/_generated/version.ts
|
|
3
|
-
const VERSION = "0.8.6";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/const.ts
|
|
6
|
-
/**
|
|
7
|
-
* CONSTANTS LISTS AND REFERENCES OH MY!
|
|
8
|
-
*/
|
|
9
|
-
const isEnvDebug = () => {
|
|
10
|
-
return [
|
|
11
|
-
"DEBUG",
|
|
12
|
-
"JSSE_DEBUG",
|
|
13
|
-
"JSSEDEBUG"
|
|
14
|
-
].some((env) => {
|
|
15
|
-
const value = process.env[env];
|
|
16
|
-
return [
|
|
17
|
-
"1",
|
|
18
|
-
"true",
|
|
19
|
-
"t",
|
|
20
|
-
"on",
|
|
21
|
-
"yes",
|
|
22
|
-
"y"
|
|
23
|
-
].includes(value ?? "");
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
const DEBUG = isEnvDebug();
|
|
27
|
-
const SLOW_RULES = [
|
|
28
|
-
"@typescript-eslint/no-misused-promises",
|
|
29
|
-
"@typescript-eslint/no-redeclare",
|
|
30
|
-
"@typescript-eslint/no-unsafe-assignment",
|
|
31
|
-
"@typescript-eslint/no-unsafe-call",
|
|
32
|
-
"@typescript-eslint/no-unsafe-member-access",
|
|
33
|
-
"@typescript-eslint/no-unsafe-return",
|
|
34
|
-
"import/no-duplicates",
|
|
35
|
-
"jsdoc/check-access",
|
|
36
|
-
"jsdoc/check-alignment",
|
|
37
|
-
"jsdoc/check-property-names",
|
|
38
|
-
"jsdoc/check-types",
|
|
39
|
-
"jsdoc/empty-tags",
|
|
40
|
-
"jsdoc/multiline-blocks",
|
|
41
|
-
"jsdoc/no-multi-asterisks",
|
|
42
|
-
"jsdoc/require-property-description",
|
|
43
|
-
"jsdoc/require-property-name",
|
|
44
|
-
"jsdoc/require-property",
|
|
45
|
-
"unicorn/expiring-todo-comments",
|
|
46
|
-
"unicorn/no-unnecessary-polyfills"
|
|
47
|
-
];
|
|
48
|
-
//#endregion
|
|
49
|
-
export { SLOW_RULES as n, VERSION as r, DEBUG as t };
|