@jsse/eslint-config 0.9.1 → 0.9.2
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 +68 -23
- package/dist/cli.js +2 -3
- package/dist/dist-DS02OtwI.js +143 -0
- package/dist/{fixable-rules-map-DICjDbU8.d.ts → fixable-rules-map-CCZ-PRHv.d.ts} +580 -643
- package/dist/fixable.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +807 -312
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +52 -53
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DJK8HYOj.js";
|
|
2
2
|
import { t as FIXABLE_RULES_MAP } from "./fixable-rules-map-dNndx2ig.js";
|
|
3
3
|
import { builtinModules, createRequire } from "node:module";
|
|
4
|
-
import fs, { realpathSync, statSync } from "node:fs";
|
|
5
4
|
import process$1 from "node:process";
|
|
6
5
|
import Debug from "debug";
|
|
7
6
|
import pluginE18e from "@e18e/eslint-plugin";
|
|
@@ -21,6 +20,7 @@ import createCommand from "eslint-plugin-command/config";
|
|
|
21
20
|
import eslintjs from "@eslint/js";
|
|
22
21
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
23
22
|
import tseslint from "typescript-eslint";
|
|
23
|
+
import fs, { realpathSync, statSync } from "node:fs";
|
|
24
24
|
import path, { dirname, join, win32 } from "node:path";
|
|
25
25
|
import fsPromises from "node:fs/promises";
|
|
26
26
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -28,7 +28,7 @@ import assert from "node:assert";
|
|
|
28
28
|
import v8 from "node:v8";
|
|
29
29
|
import { format, inspect } from "node:util";
|
|
30
30
|
//#region src/_generated/version.ts
|
|
31
|
-
const VERSION = "0.9.
|
|
31
|
+
const VERSION = "0.9.2";
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/globs.ts
|
|
34
34
|
var globs_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -118,6 +118,7 @@ const GLOB_EXCLUDE = [
|
|
|
118
118
|
"**/.vitepress/cache",
|
|
119
119
|
"**/*.bak",
|
|
120
120
|
"**/*.min.*",
|
|
121
|
+
"**/.wireit",
|
|
121
122
|
"**/.yarn",
|
|
122
123
|
"**/.pnp.*",
|
|
123
124
|
"**/auto-import?(s).d.ts",
|
|
@@ -227,13 +228,23 @@ const warn = (...args) => {
|
|
|
227
228
|
};
|
|
228
229
|
//#endregion
|
|
229
230
|
//#region src/utils.ts
|
|
231
|
+
function isPromiseLike(value) {
|
|
232
|
+
return typeof value === "object" && value !== null && "then" in value && typeof value.then === "function";
|
|
233
|
+
}
|
|
234
|
+
function flattenConfigs(configs) {
|
|
235
|
+
return configs.flatMap((config) => Array.isArray(config) ? config : [config]);
|
|
236
|
+
}
|
|
237
|
+
async function resolveAndFlattenConfigs(configs) {
|
|
238
|
+
return flattenConfigs(await Promise.all(configs.map((config) => Promise.resolve(config))));
|
|
239
|
+
}
|
|
230
240
|
/**
|
|
231
241
|
* Combine array and non-array configs into a single array.
|
|
232
242
|
* @param configs configs to combine and flatten
|
|
233
243
|
* @returns combined configs as a flattened array
|
|
234
244
|
*/
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
function combineAsync(...configs) {
|
|
246
|
+
if (configs.every((config) => !isPromiseLike(config))) return flattenConfigs(configs);
|
|
247
|
+
return resolveAndFlattenConfigs(configs);
|
|
237
248
|
}
|
|
238
249
|
function renameRules(rules, from, to) {
|
|
239
250
|
if (from === to) return rules;
|
|
@@ -267,6 +278,7 @@ function matchesRulePrefix(ruleName, rulePrefixes) {
|
|
|
267
278
|
return rulePrefixes.some((prefix) => ruleName.startsWith(`${prefix}/`));
|
|
268
279
|
}
|
|
269
280
|
function scopeTypeScriptRules(configs, options) {
|
|
281
|
+
dbg("scoping rules with prefixes %O to files: %O", options.rulePrefixes, options.files);
|
|
270
282
|
const { files, rulePrefixes } = options;
|
|
271
283
|
const normalizedPrefixes = uniqueStrings(rulePrefixes).filter(Boolean);
|
|
272
284
|
if (normalizedPrefixes.length === 0) return configs;
|
|
@@ -436,75 +448,6 @@ const eslintComments = () => [{
|
|
|
436
448
|
}
|
|
437
449
|
}];
|
|
438
450
|
//#endregion
|
|
439
|
-
//#region src/configs/react-hooks.ts
|
|
440
|
-
const reactHooks = async () => {
|
|
441
|
-
const pluginReactHooks = await interopDefault(import("eslint-plugin-react-hooks"));
|
|
442
|
-
return [{
|
|
443
|
-
files: [GLOB_SRC],
|
|
444
|
-
name: "jsse/react-hooks/rules",
|
|
445
|
-
plugins: { "react-hooks": pluginReactHooks },
|
|
446
|
-
rules: {
|
|
447
|
-
"react-hooks/exhaustive-deps": "error",
|
|
448
|
-
"react-hooks/rules-of-hooks": "error",
|
|
449
|
-
...pluginReactHooks.configs.recommended.rules
|
|
450
|
-
},
|
|
451
|
-
settings: { react: { version: "detect" } }
|
|
452
|
-
}];
|
|
453
|
-
};
|
|
454
|
-
//#endregion
|
|
455
|
-
//#region src/configs/eslint-react.ts
|
|
456
|
-
async function importReactPlugins() {
|
|
457
|
-
const [pluginReact, pluginReactRefresh] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin")), interopDefault(import("eslint-plugin-react-refresh"))]);
|
|
458
|
-
return {
|
|
459
|
-
pluginReact,
|
|
460
|
-
pluginReactRefresh
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
const eslintReact = async (options) => {
|
|
464
|
-
const { overrides = {}, reactRefresh } = options ?? {};
|
|
465
|
-
const { pluginReact, pluginReactRefresh } = await importReactPlugins();
|
|
466
|
-
const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
|
|
467
|
-
if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
|
|
468
|
-
const reactHooksConfig = await reactHooks();
|
|
469
|
-
const config = [
|
|
470
|
-
{
|
|
471
|
-
files: [GLOB_SRC],
|
|
472
|
-
name: "jsse/react/setup",
|
|
473
|
-
plugins: {
|
|
474
|
-
"@eslint-react": coreReactPlugins,
|
|
475
|
-
"react-refresh": pluginReactRefresh
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
files: [GLOB_SRC],
|
|
480
|
-
name: "jsse/react/rules",
|
|
481
|
-
rules: {
|
|
482
|
-
...pluginReact.configs.recommended.rules,
|
|
483
|
-
"react/dom-no-string-style-prop": "off",
|
|
484
|
-
"react/dom-no-unknown-property": "off",
|
|
485
|
-
...overrides
|
|
486
|
-
},
|
|
487
|
-
settings: { react: { version: "detect" } }
|
|
488
|
-
},
|
|
489
|
-
...reactHooksConfig,
|
|
490
|
-
{
|
|
491
|
-
files: [GLOB_JSX, GLOB_TSX],
|
|
492
|
-
name: "jsse/react/disables",
|
|
493
|
-
rules: { "unicorn/no-null": "off" }
|
|
494
|
-
}
|
|
495
|
-
];
|
|
496
|
-
if (reactRefresh) config.push({
|
|
497
|
-
files: [GLOB_SRC],
|
|
498
|
-
name: "jsse/react/refresh",
|
|
499
|
-
rules: { "react-refresh/only-export-components": "error" }
|
|
500
|
-
}, {
|
|
501
|
-
files: ["**/*.stories.tsx"],
|
|
502
|
-
name: "jsse/react-refresh/stories",
|
|
503
|
-
rules: { "react-refresh/only-export-components": "off" }
|
|
504
|
-
});
|
|
505
|
-
return config;
|
|
506
|
-
};
|
|
507
|
-
//#endregion
|
|
508
451
|
//#region src/configs/ignores.ts
|
|
509
452
|
const ignores = () => {
|
|
510
453
|
return [{
|
|
@@ -4664,7 +4607,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4664
4607
|
var import_globals = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4665
4608
|
module.exports = require_globals$1();
|
|
4666
4609
|
})))(), 1);
|
|
4667
|
-
function
|
|
4610
|
+
function javascriptSelectedRules() {
|
|
4668
4611
|
return {
|
|
4669
4612
|
"accessor-pairs": ["error", {
|
|
4670
4613
|
enforceForClassMembers: true,
|
|
@@ -4846,7 +4789,7 @@ const javascript = (options) => {
|
|
|
4846
4789
|
plugins: { "unused-imports": pluginUnusedImports },
|
|
4847
4790
|
rules: {
|
|
4848
4791
|
...eslintjs.configs.recommended.rules,
|
|
4849
|
-
...
|
|
4792
|
+
...javascriptSelectedRules(),
|
|
4850
4793
|
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
4851
4794
|
"unused-imports/no-unused-vars": ["error", {
|
|
4852
4795
|
args: "after-used",
|
|
@@ -4975,11 +4918,95 @@ const jsonc = async (options) => {
|
|
|
4975
4918
|
}];
|
|
4976
4919
|
};
|
|
4977
4920
|
//#endregion
|
|
4978
|
-
//#region src/configs/ts/
|
|
4921
|
+
//#region src/configs/ts/presets.ts
|
|
4922
|
+
const TYPESCRIPT_PRESET_CONFIGS = {
|
|
4923
|
+
all: "all",
|
|
4924
|
+
base: "base",
|
|
4925
|
+
"disable-type-checked": "disableTypeChecked",
|
|
4926
|
+
"eslint-recommended": "eslintRecommended",
|
|
4927
|
+
recommended: "recommended",
|
|
4928
|
+
"recommended-type-checked": "recommendedTypeChecked",
|
|
4929
|
+
"recommended-type-checked-only": "recommendedTypeCheckedOnly",
|
|
4930
|
+
strict: "strict",
|
|
4931
|
+
"strict-type-checked": "strictTypeChecked",
|
|
4932
|
+
"strict-type-checked-only": "strictTypeCheckedOnly",
|
|
4933
|
+
stylistic: "stylistic",
|
|
4934
|
+
"stylistic-type-checked": "stylisticTypeChecked",
|
|
4935
|
+
"stylistic-type-checked-only": "stylisticTypeCheckedOnly"
|
|
4936
|
+
};
|
|
4937
|
+
const TYPE_CHECKED_PRESETS = /* @__PURE__ */ new Set([
|
|
4938
|
+
"all",
|
|
4939
|
+
"disable-type-checked",
|
|
4940
|
+
"recommended-type-checked",
|
|
4941
|
+
"recommended-type-checked-only",
|
|
4942
|
+
"strict-type-checked",
|
|
4943
|
+
"strict-type-checked-only",
|
|
4944
|
+
"stylistic-type-checked",
|
|
4945
|
+
"stylistic-type-checked-only"
|
|
4946
|
+
]);
|
|
4947
|
+
const TYPE_OBLIVIOUS_PRESET_EQUIVALENTS = {
|
|
4948
|
+
"recommended-type-checked": "recommended",
|
|
4949
|
+
"strict-type-checked": "strict",
|
|
4950
|
+
"stylistic-type-checked": "stylistic"
|
|
4951
|
+
};
|
|
4979
4952
|
const extractRules = (configs) => {
|
|
4980
4953
|
const rules = configs.filter((config) => config.rules !== void 0).map((config) => config.rules ?? {});
|
|
4981
4954
|
return Object.assign({}, ...rules);
|
|
4982
4955
|
};
|
|
4956
|
+
function isTypescriptPreset(preset) {
|
|
4957
|
+
return Object.hasOwn(TYPESCRIPT_PRESET_CONFIGS, preset);
|
|
4958
|
+
}
|
|
4959
|
+
function normalizePresets(presets) {
|
|
4960
|
+
if (presets === void 0) return;
|
|
4961
|
+
const presetList = Array.isArray(presets) ? presets : [presets];
|
|
4962
|
+
const normalized = [];
|
|
4963
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4964
|
+
for (const preset of presetList) {
|
|
4965
|
+
if (!isTypescriptPreset(preset)) {
|
|
4966
|
+
const validPresets = Object.keys(TYPESCRIPT_PRESET_CONFIGS).join(", ");
|
|
4967
|
+
throw new Error(`Unknown TypeScript ESLint preset "${String(preset)}". Expected one of: ${validPresets}`);
|
|
4968
|
+
}
|
|
4969
|
+
if (seen.has(preset)) {
|
|
4970
|
+
warn(`Duplicate TypeScript ESLint preset "${preset}" ignored`);
|
|
4971
|
+
continue;
|
|
4972
|
+
}
|
|
4973
|
+
seen.add(preset);
|
|
4974
|
+
normalized.push(preset);
|
|
4975
|
+
}
|
|
4976
|
+
return normalized.length === 0 ? void 0 : normalized;
|
|
4977
|
+
}
|
|
4978
|
+
function defaultPresets(props) {
|
|
4979
|
+
return props?.typeAware ? props.strict ? ["strict-type-checked"] : ["recommended-type-checked"] : props?.strict ? ["strict"] : ["recommended"];
|
|
4980
|
+
}
|
|
4981
|
+
function presetsForScope(presets, typeAware) {
|
|
4982
|
+
if (typeAware) return presets;
|
|
4983
|
+
const scopedPresets = [];
|
|
4984
|
+
for (const preset of presets) {
|
|
4985
|
+
if (!TYPE_CHECKED_PRESETS.has(preset)) {
|
|
4986
|
+
scopedPresets.push(preset);
|
|
4987
|
+
continue;
|
|
4988
|
+
}
|
|
4989
|
+
const equivalent = TYPE_OBLIVIOUS_PRESET_EQUIVALENTS[preset];
|
|
4990
|
+
if (equivalent !== void 0) scopedPresets.push(equivalent);
|
|
4991
|
+
}
|
|
4992
|
+
return scopedPresets;
|
|
4993
|
+
}
|
|
4994
|
+
function configForPreset(preset) {
|
|
4995
|
+
const configName = TYPESCRIPT_PRESET_CONFIGS[preset];
|
|
4996
|
+
return tseslint.configs[configName];
|
|
4997
|
+
}
|
|
4998
|
+
function includesStrictPreset(presets) {
|
|
4999
|
+
if (presets === void 0) return false;
|
|
5000
|
+
return (Array.isArray(presets) ? presets : [presets]).some((preset) => preset === "strict" || preset.startsWith("strict-type-checked"));
|
|
5001
|
+
}
|
|
5002
|
+
function tsPresetRules(props) {
|
|
5003
|
+
const scopedPresets = presetsForScope(normalizePresets(props?.presets) ?? defaultPresets(props), props?.typeAware ?? false);
|
|
5004
|
+
const rules = {};
|
|
5005
|
+
for (const preset of scopedPresets) Object.assign(rules, extractRules(configForPreset(preset)));
|
|
5006
|
+
return rules;
|
|
5007
|
+
}
|
|
5008
|
+
//#endregion
|
|
5009
|
+
//#region src/configs/ts/typescript-rules.ts
|
|
4983
5010
|
function typescriptRulesTypeAware() {
|
|
4984
5011
|
return {
|
|
4985
5012
|
"@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
|
|
@@ -4991,9 +5018,25 @@ function typescriptRulesTypeAware() {
|
|
|
4991
5018
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
4992
5019
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
4993
5020
|
"@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
|
|
5021
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
4994
5022
|
"@typescript-eslint/no-floating-promises": ["error", {
|
|
4995
5023
|
ignoreVoid: true,
|
|
4996
5024
|
ignoreIIFE: true
|
|
5025
|
+
}],
|
|
5026
|
+
"@typescript-eslint/restrict-template-expressions": ["error", {
|
|
5027
|
+
allow: [{
|
|
5028
|
+
name: [
|
|
5029
|
+
"Error",
|
|
5030
|
+
"URL",
|
|
5031
|
+
"URLSearchParams"
|
|
5032
|
+
],
|
|
5033
|
+
from: "lib"
|
|
5034
|
+
}],
|
|
5035
|
+
allowAny: false,
|
|
5036
|
+
allowBoolean: true,
|
|
5037
|
+
allowNullish: true,
|
|
5038
|
+
allowNumber: true,
|
|
5039
|
+
allowRegExp: true
|
|
4997
5040
|
}]
|
|
4998
5041
|
};
|
|
4999
5042
|
}
|
|
@@ -5109,10 +5152,6 @@ function typescriptRulesTypeOblivious() {
|
|
|
5109
5152
|
]
|
|
5110
5153
|
};
|
|
5111
5154
|
}
|
|
5112
|
-
function tsPresetRules(props) {
|
|
5113
|
-
const tseslintConfig = props?.typeAware ? props.strict ? tseslint.configs.strictTypeChecked : tseslint.configs.recommendedTypeChecked : props?.strict ? tseslint.configs.strict : tseslint.configs.recommended;
|
|
5114
|
-
return extractRules(tseslintConfig);
|
|
5115
|
-
}
|
|
5116
5155
|
function typescriptRules(props) {
|
|
5117
5156
|
const normalized = {
|
|
5118
5157
|
includeTsEslintPresetRules: true,
|
|
@@ -5120,15 +5159,17 @@ function typescriptRules(props) {
|
|
|
5120
5159
|
strict: false,
|
|
5121
5160
|
...props
|
|
5122
5161
|
};
|
|
5162
|
+
if (normalized.presets !== void 0 && normalized.strictProvided) throw new Error("Use either TypeScript `presets` or deprecated `strict`, not both.");
|
|
5123
5163
|
dbg("building typescript rules: %O", normalized);
|
|
5124
5164
|
const rulesFromPreset = normalized.includeTsEslintPresetRules ? tsPresetRules(normalized) : {};
|
|
5165
|
+
const strictRules = normalized.presets === void 0 ? normalized.strict : includesStrictPreset(normalized.presets);
|
|
5125
5166
|
dbg("ts-eslint preset rules: %O", rulesFromPreset);
|
|
5126
5167
|
return {
|
|
5127
5168
|
...rulesFromPreset,
|
|
5128
5169
|
...typescriptRulesTypeOblivious(),
|
|
5129
5170
|
...normalized.typeAware && typescriptRulesTypeAware(),
|
|
5130
|
-
...normalized.typeAware && !
|
|
5131
|
-
...normalized.typeAware &&
|
|
5171
|
+
...normalized.typeAware && !strictRules && { "@typescript-eslint/no-deprecated": "error" },
|
|
5172
|
+
...normalized.typeAware && strictRules && { "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: "only-allowed-literals" }] }
|
|
5132
5173
|
};
|
|
5133
5174
|
}
|
|
5134
5175
|
//#endregion
|
|
@@ -5354,121 +5395,321 @@ const pnpm = async (options) => {
|
|
|
5354
5395
|
}];
|
|
5355
5396
|
};
|
|
5356
5397
|
//#endregion
|
|
5398
|
+
//#region src/_generated/eslint-config-prettier-rules.ts
|
|
5399
|
+
const ESLINT_CONFIG_PRETTIER_RULES = {
|
|
5400
|
+
"@stylistic/array-bracket-newline": "off",
|
|
5401
|
+
"@stylistic/array-bracket-spacing": "off",
|
|
5402
|
+
"@stylistic/array-element-newline": "off",
|
|
5403
|
+
"@stylistic/arrow-parens": "off",
|
|
5404
|
+
"@stylistic/arrow-spacing": "off",
|
|
5405
|
+
"@stylistic/block-spacing": "off",
|
|
5406
|
+
"@stylistic/brace-style": "off",
|
|
5407
|
+
"@stylistic/comma-dangle": "off",
|
|
5408
|
+
"@stylistic/comma-spacing": "off",
|
|
5409
|
+
"@stylistic/comma-style": "off",
|
|
5410
|
+
"@stylistic/computed-property-spacing": "off",
|
|
5411
|
+
"@stylistic/dot-location": "off",
|
|
5412
|
+
"@stylistic/eol-last": "off",
|
|
5413
|
+
"@stylistic/func-call-spacing": "off",
|
|
5414
|
+
"@stylistic/function-call-argument-newline": "off",
|
|
5415
|
+
"@stylistic/function-call-spacing": "off",
|
|
5416
|
+
"@stylistic/function-paren-newline": "off",
|
|
5417
|
+
"@stylistic/generator-star-spacing": "off",
|
|
5418
|
+
"@stylistic/implicit-arrow-linebreak": "off",
|
|
5419
|
+
"@stylistic/indent": "off",
|
|
5420
|
+
"@stylistic/indent-binary-ops": "off",
|
|
5421
|
+
"@stylistic/js/array-bracket-newline": "off",
|
|
5422
|
+
"@stylistic/js/array-bracket-spacing": "off",
|
|
5423
|
+
"@stylistic/js/array-element-newline": "off",
|
|
5424
|
+
"@stylistic/js/arrow-parens": "off",
|
|
5425
|
+
"@stylistic/js/arrow-spacing": "off",
|
|
5426
|
+
"@stylistic/js/block-spacing": "off",
|
|
5427
|
+
"@stylistic/js/brace-style": "off",
|
|
5428
|
+
"@stylistic/js/comma-dangle": "off",
|
|
5429
|
+
"@stylistic/js/comma-spacing": "off",
|
|
5430
|
+
"@stylistic/js/comma-style": "off",
|
|
5431
|
+
"@stylistic/js/computed-property-spacing": "off",
|
|
5432
|
+
"@stylistic/js/dot-location": "off",
|
|
5433
|
+
"@stylistic/js/eol-last": "off",
|
|
5434
|
+
"@stylistic/js/func-call-spacing": "off",
|
|
5435
|
+
"@stylistic/js/function-call-argument-newline": "off",
|
|
5436
|
+
"@stylistic/js/function-call-spacing": "off",
|
|
5437
|
+
"@stylistic/js/function-paren-newline": "off",
|
|
5438
|
+
"@stylistic/js/generator-star-spacing": "off",
|
|
5439
|
+
"@stylistic/js/implicit-arrow-linebreak": "off",
|
|
5440
|
+
"@stylistic/js/indent": "off",
|
|
5441
|
+
"@stylistic/js/jsx-quotes": "off",
|
|
5442
|
+
"@stylistic/js/key-spacing": "off",
|
|
5443
|
+
"@stylistic/js/keyword-spacing": "off",
|
|
5444
|
+
"@stylistic/js/linebreak-style": "off",
|
|
5445
|
+
"@stylistic/js/lines-around-comment": 0,
|
|
5446
|
+
"@stylistic/js/max-len": 0,
|
|
5447
|
+
"@stylistic/js/max-statements-per-line": "off",
|
|
5448
|
+
"@stylistic/js/multiline-ternary": "off",
|
|
5449
|
+
"@stylistic/js/new-parens": "off",
|
|
5450
|
+
"@stylistic/js/newline-per-chained-call": "off",
|
|
5451
|
+
"@stylistic/js/no-confusing-arrow": 0,
|
|
5452
|
+
"@stylistic/js/no-extra-parens": "off",
|
|
5453
|
+
"@stylistic/js/no-extra-semi": "off",
|
|
5454
|
+
"@stylistic/js/no-floating-decimal": "off",
|
|
5455
|
+
"@stylistic/js/no-mixed-operators": 0,
|
|
5456
|
+
"@stylistic/js/no-mixed-spaces-and-tabs": "off",
|
|
5457
|
+
"@stylistic/js/no-multi-spaces": "off",
|
|
5458
|
+
"@stylistic/js/no-multiple-empty-lines": "off",
|
|
5459
|
+
"@stylistic/js/no-tabs": 0,
|
|
5460
|
+
"@stylistic/js/no-trailing-spaces": "off",
|
|
5461
|
+
"@stylistic/js/no-whitespace-before-property": "off",
|
|
5462
|
+
"@stylistic/js/nonblock-statement-body-position": "off",
|
|
5463
|
+
"@stylistic/js/object-curly-newline": "off",
|
|
5464
|
+
"@stylistic/js/object-curly-spacing": "off",
|
|
5465
|
+
"@stylistic/js/object-property-newline": "off",
|
|
5466
|
+
"@stylistic/js/one-var-declaration-per-line": "off",
|
|
5467
|
+
"@stylistic/js/operator-linebreak": "off",
|
|
5468
|
+
"@stylistic/js/padded-blocks": "off",
|
|
5469
|
+
"@stylistic/js/quote-props": "off",
|
|
5470
|
+
"@stylistic/js/quotes": 0,
|
|
5471
|
+
"@stylistic/js/rest-spread-spacing": "off",
|
|
5472
|
+
"@stylistic/js/semi": "off",
|
|
5473
|
+
"@stylistic/js/semi-spacing": "off",
|
|
5474
|
+
"@stylistic/js/semi-style": "off",
|
|
5475
|
+
"@stylistic/js/space-before-blocks": "off",
|
|
5476
|
+
"@stylistic/js/space-before-function-paren": "off",
|
|
5477
|
+
"@stylistic/js/space-in-parens": "off",
|
|
5478
|
+
"@stylistic/js/space-infix-ops": "off",
|
|
5479
|
+
"@stylistic/js/space-unary-ops": "off",
|
|
5480
|
+
"@stylistic/js/switch-colon-spacing": "off",
|
|
5481
|
+
"@stylistic/js/template-curly-spacing": "off",
|
|
5482
|
+
"@stylistic/js/template-tag-spacing": "off",
|
|
5483
|
+
"@stylistic/js/wrap-iife": "off",
|
|
5484
|
+
"@stylistic/js/wrap-regex": "off",
|
|
5485
|
+
"@stylistic/js/yield-star-spacing": "off",
|
|
5486
|
+
"@stylistic/jsx-child-element-spacing": "off",
|
|
5487
|
+
"@stylistic/jsx-closing-bracket-location": "off",
|
|
5488
|
+
"@stylistic/jsx-closing-tag-location": "off",
|
|
5489
|
+
"@stylistic/jsx-curly-newline": "off",
|
|
5490
|
+
"@stylistic/jsx-curly-spacing": "off",
|
|
5491
|
+
"@stylistic/jsx-equals-spacing": "off",
|
|
5492
|
+
"@stylistic/jsx-first-prop-new-line": "off",
|
|
5493
|
+
"@stylistic/jsx-indent": "off",
|
|
5494
|
+
"@stylistic/jsx-indent-props": "off",
|
|
5495
|
+
"@stylistic/jsx-max-props-per-line": "off",
|
|
5496
|
+
"@stylistic/jsx-newline": "off",
|
|
5497
|
+
"@stylistic/jsx-one-expression-per-line": "off",
|
|
5498
|
+
"@stylistic/jsx-props-no-multi-spaces": "off",
|
|
5499
|
+
"@stylistic/jsx-quotes": "off",
|
|
5500
|
+
"@stylistic/jsx-tag-spacing": "off",
|
|
5501
|
+
"@stylistic/jsx-wrap-multilines": "off",
|
|
5502
|
+
"@stylistic/jsx/jsx-child-element-spacing": "off",
|
|
5503
|
+
"@stylistic/jsx/jsx-closing-bracket-location": "off",
|
|
5504
|
+
"@stylistic/jsx/jsx-closing-tag-location": "off",
|
|
5505
|
+
"@stylistic/jsx/jsx-curly-newline": "off",
|
|
5506
|
+
"@stylistic/jsx/jsx-curly-spacing": "off",
|
|
5507
|
+
"@stylistic/jsx/jsx-equals-spacing": "off",
|
|
5508
|
+
"@stylistic/jsx/jsx-first-prop-new-line": "off",
|
|
5509
|
+
"@stylistic/jsx/jsx-indent": "off",
|
|
5510
|
+
"@stylistic/jsx/jsx-indent-props": "off",
|
|
5511
|
+
"@stylistic/jsx/jsx-max-props-per-line": "off",
|
|
5512
|
+
"@stylistic/key-spacing": "off",
|
|
5513
|
+
"@stylistic/keyword-spacing": "off",
|
|
5514
|
+
"@stylistic/linebreak-style": "off",
|
|
5515
|
+
"@stylistic/lines-around-comment": 0,
|
|
5516
|
+
"@stylistic/max-len": 0,
|
|
5517
|
+
"@stylistic/max-statements-per-line": "off",
|
|
5518
|
+
"@stylistic/member-delimiter-style": "off",
|
|
5519
|
+
"@stylistic/multiline-ternary": "off",
|
|
5520
|
+
"@stylistic/new-parens": "off",
|
|
5521
|
+
"@stylistic/newline-per-chained-call": "off",
|
|
5522
|
+
"@stylistic/no-confusing-arrow": 0,
|
|
5523
|
+
"@stylistic/no-extra-parens": "off",
|
|
5524
|
+
"@stylistic/no-extra-semi": "off",
|
|
5525
|
+
"@stylistic/no-floating-decimal": "off",
|
|
5526
|
+
"@stylistic/no-mixed-operators": 0,
|
|
5527
|
+
"@stylistic/no-mixed-spaces-and-tabs": "off",
|
|
5528
|
+
"@stylistic/no-multi-spaces": "off",
|
|
5529
|
+
"@stylistic/no-multiple-empty-lines": "off",
|
|
5530
|
+
"@stylistic/no-tabs": 0,
|
|
5531
|
+
"@stylistic/no-trailing-spaces": "off",
|
|
5532
|
+
"@stylistic/no-whitespace-before-property": "off",
|
|
5533
|
+
"@stylistic/nonblock-statement-body-position": "off",
|
|
5534
|
+
"@stylistic/object-curly-newline": "off",
|
|
5535
|
+
"@stylistic/object-curly-spacing": "off",
|
|
5536
|
+
"@stylistic/object-property-newline": "off",
|
|
5537
|
+
"@stylistic/one-var-declaration-per-line": "off",
|
|
5538
|
+
"@stylistic/operator-linebreak": "off",
|
|
5539
|
+
"@stylistic/padded-blocks": "off",
|
|
5540
|
+
"@stylistic/quote-props": "off",
|
|
5541
|
+
"@stylistic/quotes": 0,
|
|
5542
|
+
"@stylistic/rest-spread-spacing": "off",
|
|
5543
|
+
"@stylistic/semi": "off",
|
|
5544
|
+
"@stylistic/semi-spacing": "off",
|
|
5545
|
+
"@stylistic/semi-style": "off",
|
|
5546
|
+
"@stylistic/space-before-blocks": "off",
|
|
5547
|
+
"@stylistic/space-before-function-paren": "off",
|
|
5548
|
+
"@stylistic/space-in-parens": "off",
|
|
5549
|
+
"@stylistic/space-infix-ops": "off",
|
|
5550
|
+
"@stylistic/space-unary-ops": "off",
|
|
5551
|
+
"@stylistic/switch-colon-spacing": "off",
|
|
5552
|
+
"@stylistic/template-curly-spacing": "off",
|
|
5553
|
+
"@stylistic/template-tag-spacing": "off",
|
|
5554
|
+
"@stylistic/ts/block-spacing": "off",
|
|
5555
|
+
"@stylistic/ts/brace-style": "off",
|
|
5556
|
+
"@stylistic/ts/comma-dangle": "off",
|
|
5557
|
+
"@stylistic/ts/comma-spacing": "off",
|
|
5558
|
+
"@stylistic/ts/func-call-spacing": "off",
|
|
5559
|
+
"@stylistic/ts/function-call-spacing": "off",
|
|
5560
|
+
"@stylistic/ts/indent": "off",
|
|
5561
|
+
"@stylistic/ts/key-spacing": "off",
|
|
5562
|
+
"@stylistic/ts/keyword-spacing": "off",
|
|
5563
|
+
"@stylistic/ts/lines-around-comment": 0,
|
|
5564
|
+
"@stylistic/ts/member-delimiter-style": "off",
|
|
5565
|
+
"@stylistic/ts/no-extra-parens": "off",
|
|
5566
|
+
"@stylistic/ts/no-extra-semi": "off",
|
|
5567
|
+
"@stylistic/ts/object-curly-spacing": "off",
|
|
5568
|
+
"@stylistic/ts/quotes": 0,
|
|
5569
|
+
"@stylistic/ts/semi": "off",
|
|
5570
|
+
"@stylistic/ts/space-before-blocks": "off",
|
|
5571
|
+
"@stylistic/ts/space-before-function-paren": "off",
|
|
5572
|
+
"@stylistic/ts/space-infix-ops": "off",
|
|
5573
|
+
"@stylistic/ts/type-annotation-spacing": "off",
|
|
5574
|
+
"@stylistic/type-annotation-spacing": "off",
|
|
5575
|
+
"@stylistic/type-generic-spacing": "off",
|
|
5576
|
+
"@stylistic/type-named-tuple-spacing": "off",
|
|
5577
|
+
"@stylistic/wrap-iife": "off",
|
|
5578
|
+
"@stylistic/wrap-regex": "off",
|
|
5579
|
+
"@stylistic/yield-star-spacing": "off",
|
|
5580
|
+
"@typescript-eslint/block-spacing": "off",
|
|
5581
|
+
"@typescript-eslint/brace-style": "off",
|
|
5582
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
5583
|
+
"@typescript-eslint/comma-spacing": "off",
|
|
5584
|
+
"@typescript-eslint/func-call-spacing": "off",
|
|
5585
|
+
"@typescript-eslint/indent": "off",
|
|
5586
|
+
"@typescript-eslint/key-spacing": "off",
|
|
5587
|
+
"@typescript-eslint/keyword-spacing": "off",
|
|
5588
|
+
"@typescript-eslint/lines-around-comment": 0,
|
|
5589
|
+
"@typescript-eslint/member-delimiter-style": "off",
|
|
5590
|
+
"@typescript-eslint/no-extra-parens": "off",
|
|
5591
|
+
"@typescript-eslint/no-extra-semi": "off",
|
|
5592
|
+
"@typescript-eslint/object-curly-spacing": "off",
|
|
5593
|
+
"@typescript-eslint/quotes": 0,
|
|
5594
|
+
"@typescript-eslint/semi": "off",
|
|
5595
|
+
"@typescript-eslint/space-before-blocks": "off",
|
|
5596
|
+
"@typescript-eslint/space-before-function-paren": "off",
|
|
5597
|
+
"@typescript-eslint/space-infix-ops": "off",
|
|
5598
|
+
"@typescript-eslint/type-annotation-spacing": "off",
|
|
5599
|
+
"array-bracket-newline": "off",
|
|
5600
|
+
"array-bracket-spacing": "off",
|
|
5601
|
+
"array-element-newline": "off",
|
|
5602
|
+
"arrow-parens": "off",
|
|
5603
|
+
"arrow-spacing": "off",
|
|
5604
|
+
"block-spacing": "off",
|
|
5605
|
+
"brace-style": "off",
|
|
5606
|
+
"comma-dangle": "off",
|
|
5607
|
+
"comma-spacing": "off",
|
|
5608
|
+
"comma-style": "off",
|
|
5609
|
+
"computed-property-spacing": "off",
|
|
5610
|
+
curly: 0,
|
|
5611
|
+
"dot-location": "off",
|
|
5612
|
+
"eol-last": "off",
|
|
5613
|
+
"func-call-spacing": "off",
|
|
5614
|
+
"function-call-argument-newline": "off",
|
|
5615
|
+
"function-paren-newline": "off",
|
|
5616
|
+
"generator-star": "off",
|
|
5617
|
+
"generator-star-spacing": "off",
|
|
5618
|
+
"implicit-arrow-linebreak": "off",
|
|
5619
|
+
indent: "off",
|
|
5620
|
+
"indent-legacy": "off",
|
|
5621
|
+
"jsx-quotes": "off",
|
|
5622
|
+
"key-spacing": "off",
|
|
5623
|
+
"keyword-spacing": "off",
|
|
5624
|
+
"linebreak-style": "off",
|
|
5625
|
+
"lines-around-comment": 0,
|
|
5626
|
+
"max-len": 0,
|
|
5627
|
+
"max-statements-per-line": "off",
|
|
5628
|
+
"multiline-ternary": "off",
|
|
5629
|
+
"new-parens": "off",
|
|
5630
|
+
"newline-per-chained-call": "off",
|
|
5631
|
+
"no-arrow-condition": "off",
|
|
5632
|
+
"no-comma-dangle": "off",
|
|
5633
|
+
"no-confusing-arrow": 0,
|
|
5634
|
+
"no-extra-parens": "off",
|
|
5635
|
+
"no-extra-semi": "off",
|
|
5636
|
+
"no-floating-decimal": "off",
|
|
5637
|
+
"no-mixed-operators": 0,
|
|
5638
|
+
"no-mixed-spaces-and-tabs": "off",
|
|
5639
|
+
"no-multi-spaces": "off",
|
|
5640
|
+
"no-multiple-empty-lines": "off",
|
|
5641
|
+
"no-reserved-keys": "off",
|
|
5642
|
+
"no-space-before-semi": "off",
|
|
5643
|
+
"no-spaced-func": "off",
|
|
5644
|
+
"no-tabs": 0,
|
|
5645
|
+
"no-trailing-spaces": "off",
|
|
5646
|
+
"no-unexpected-multiline": 0,
|
|
5647
|
+
"no-whitespace-before-property": "off",
|
|
5648
|
+
"no-wrap-func": "off",
|
|
5649
|
+
"nonblock-statement-body-position": "off",
|
|
5650
|
+
"object-curly-newline": "off",
|
|
5651
|
+
"object-curly-spacing": "off",
|
|
5652
|
+
"object-property-newline": "off",
|
|
5653
|
+
"one-var-declaration-per-line": "off",
|
|
5654
|
+
"operator-linebreak": "off",
|
|
5655
|
+
"padded-blocks": "off",
|
|
5656
|
+
"quote-props": "off",
|
|
5657
|
+
quotes: 0,
|
|
5658
|
+
"react/jsx-child-element-spacing": "off",
|
|
5659
|
+
"react/jsx-closing-bracket-location": "off",
|
|
5660
|
+
"react/jsx-closing-tag-location": "off",
|
|
5661
|
+
"react/jsx-curly-newline": "off",
|
|
5662
|
+
"react/jsx-curly-spacing": "off",
|
|
5663
|
+
"react/jsx-equals-spacing": "off",
|
|
5664
|
+
"react/jsx-first-prop-new-line": "off",
|
|
5665
|
+
"react/jsx-indent": "off",
|
|
5666
|
+
"react/jsx-indent-props": "off",
|
|
5667
|
+
"react/jsx-max-props-per-line": "off",
|
|
5668
|
+
"react/jsx-newline": "off",
|
|
5669
|
+
"react/jsx-one-expression-per-line": "off",
|
|
5670
|
+
"react/jsx-props-no-multi-spaces": "off",
|
|
5671
|
+
"react/jsx-space-before-closing": "off",
|
|
5672
|
+
"react/jsx-tag-spacing": "off",
|
|
5673
|
+
"react/jsx-wrap-multilines": "off",
|
|
5674
|
+
"rest-spread-spacing": "off",
|
|
5675
|
+
semi: "off",
|
|
5676
|
+
"semi-spacing": "off",
|
|
5677
|
+
"semi-style": "off",
|
|
5678
|
+
"space-after-function-name": "off",
|
|
5679
|
+
"space-after-keywords": "off",
|
|
5680
|
+
"space-before-blocks": "off",
|
|
5681
|
+
"space-before-function-paren": "off",
|
|
5682
|
+
"space-before-function-parentheses": "off",
|
|
5683
|
+
"space-before-keywords": "off",
|
|
5684
|
+
"space-in-brackets": "off",
|
|
5685
|
+
"space-in-parens": "off",
|
|
5686
|
+
"space-infix-ops": "off",
|
|
5687
|
+
"space-return-throw-case": "off",
|
|
5688
|
+
"space-unary-ops": "off",
|
|
5689
|
+
"space-unary-word-ops": "off",
|
|
5690
|
+
"standard/array-bracket-even-spacing": "off",
|
|
5691
|
+
"standard/computed-property-even-spacing": "off",
|
|
5692
|
+
"standard/object-curly-even-spacing": "off",
|
|
5693
|
+
"switch-colon-spacing": "off",
|
|
5694
|
+
"template-curly-spacing": "off",
|
|
5695
|
+
"template-tag-spacing": "off",
|
|
5696
|
+
"unicorn/empty-brace-spaces": "off",
|
|
5697
|
+
"unicorn/no-nested-ternary": "off",
|
|
5698
|
+
"unicorn/number-literal-case": "off",
|
|
5699
|
+
"unicorn/template-indent": 0,
|
|
5700
|
+
"wrap-iife": "off",
|
|
5701
|
+
"wrap-regex": "off",
|
|
5702
|
+
"yield-star-spacing": "off"
|
|
5703
|
+
};
|
|
5704
|
+
//#endregion
|
|
5357
5705
|
//#region src/configs/prettier.ts
|
|
5358
5706
|
/**
|
|
5359
|
-
*
|
|
5707
|
+
* Generated from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
|
|
5360
5708
|
* Main difference is we exclude rules we don't care about.... (flow/babel/etc)
|
|
5361
5709
|
* @returns ESLint rules to disable when using Prettier
|
|
5362
5710
|
*/
|
|
5363
5711
|
function eslintConfigPrettierRules() {
|
|
5364
|
-
return
|
|
5365
|
-
"@typescript-eslint/block-spacing": "off",
|
|
5366
|
-
"@typescript-eslint/brace-style": "off",
|
|
5367
|
-
"@typescript-eslint/comma-dangle": "off",
|
|
5368
|
-
"@typescript-eslint/comma-spacing": "off",
|
|
5369
|
-
"@typescript-eslint/func-call-spacing": "off",
|
|
5370
|
-
"@typescript-eslint/indent": "off",
|
|
5371
|
-
"@typescript-eslint/key-spacing": "off",
|
|
5372
|
-
"@typescript-eslint/keyword-spacing": "off",
|
|
5373
|
-
"@typescript-eslint/lines-around-comment": 0,
|
|
5374
|
-
"@typescript-eslint/member-delimiter-style": "off",
|
|
5375
|
-
"@typescript-eslint/no-extra-parens": "off",
|
|
5376
|
-
"@typescript-eslint/no-extra-semi": "off",
|
|
5377
|
-
"@typescript-eslint/object-curly-spacing": "off",
|
|
5378
|
-
"@typescript-eslint/quotes": 0,
|
|
5379
|
-
"@typescript-eslint/semi": "off",
|
|
5380
|
-
"@typescript-eslint/space-before-blocks": "off",
|
|
5381
|
-
"@typescript-eslint/space-before-function-paren": "off",
|
|
5382
|
-
"@typescript-eslint/space-infix-ops": "off",
|
|
5383
|
-
"@typescript-eslint/type-annotation-spacing": "off",
|
|
5384
|
-
"array-bracket-newline": "off",
|
|
5385
|
-
"array-bracket-spacing": "off",
|
|
5386
|
-
"array-element-newline": "off",
|
|
5387
|
-
"arrow-parens": "off",
|
|
5388
|
-
"arrow-spacing": "off",
|
|
5389
|
-
"block-spacing": "off",
|
|
5390
|
-
"brace-style": "off",
|
|
5391
|
-
"comma-dangle": "off",
|
|
5392
|
-
"comma-spacing": "off",
|
|
5393
|
-
"comma-style": "off",
|
|
5394
|
-
"computed-property-spacing": "off",
|
|
5395
|
-
curly: 0,
|
|
5396
|
-
"dot-location": "off",
|
|
5397
|
-
"eol-last": "off",
|
|
5398
|
-
"func-call-spacing": "off",
|
|
5399
|
-
"function-call-argument-newline": "off",
|
|
5400
|
-
"function-paren-newline": "off",
|
|
5401
|
-
"generator-star-spacing": "off",
|
|
5402
|
-
"implicit-arrow-linebreak": "off",
|
|
5403
|
-
indent: "off",
|
|
5404
|
-
"jsx-quotes": "off",
|
|
5405
|
-
"key-spacing": "off",
|
|
5406
|
-
"keyword-spacing": "off",
|
|
5407
|
-
"linebreak-style": "off",
|
|
5408
|
-
"lines-around-comment": 0,
|
|
5409
|
-
"max-len": 0,
|
|
5410
|
-
"max-statements-per-line": "off",
|
|
5411
|
-
"multiline-ternary": "off",
|
|
5412
|
-
"new-parens": "off",
|
|
5413
|
-
"newline-per-chained-call": "off",
|
|
5414
|
-
"no-confusing-arrow": 0,
|
|
5415
|
-
"no-extra-parens": "off",
|
|
5416
|
-
"no-extra-semi": "off",
|
|
5417
|
-
"no-floating-decimal": "off",
|
|
5418
|
-
"no-mixed-operators": 0,
|
|
5419
|
-
"no-mixed-spaces-and-tabs": "off",
|
|
5420
|
-
"no-multi-spaces": "off",
|
|
5421
|
-
"no-multiple-empty-lines": "off",
|
|
5422
|
-
"no-tabs": 0,
|
|
5423
|
-
"no-trailing-spaces": "off",
|
|
5424
|
-
"no-unexpected-multiline": 0,
|
|
5425
|
-
"no-whitespace-before-property": "off",
|
|
5426
|
-
"nonblock-statement-body-position": "off",
|
|
5427
|
-
"object-curly-newline": "off",
|
|
5428
|
-
"object-curly-spacing": "off",
|
|
5429
|
-
"object-property-newline": "off",
|
|
5430
|
-
"one-var-declaration-per-line": "off",
|
|
5431
|
-
"operator-linebreak": "off",
|
|
5432
|
-
"padded-blocks": "off",
|
|
5433
|
-
"quote-props": "off",
|
|
5434
|
-
quotes: 0,
|
|
5435
|
-
"react/jsx-child-element-spacing": "off",
|
|
5436
|
-
"react/jsx-closing-bracket-location": "off",
|
|
5437
|
-
"react/jsx-closing-tag-location": "off",
|
|
5438
|
-
"react/jsx-curly-newline": "off",
|
|
5439
|
-
"react/jsx-curly-spacing": "off",
|
|
5440
|
-
"react/jsx-equals-spacing": "off",
|
|
5441
|
-
"react/jsx-first-prop-new-line": "off",
|
|
5442
|
-
"react/jsx-indent": "off",
|
|
5443
|
-
"react/jsx-indent-props": "off",
|
|
5444
|
-
"react/jsx-max-props-per-line": "off",
|
|
5445
|
-
"react/jsx-newline": "off",
|
|
5446
|
-
"react/jsx-one-expression-per-line": "off",
|
|
5447
|
-
"react/jsx-props-no-multi-spaces": "off",
|
|
5448
|
-
"react/jsx-tag-spacing": "off",
|
|
5449
|
-
"react/jsx-wrap-multilines": "off",
|
|
5450
|
-
"rest-spread-spacing": "off",
|
|
5451
|
-
semi: "off",
|
|
5452
|
-
"semi-spacing": "off",
|
|
5453
|
-
"semi-style": "off",
|
|
5454
|
-
"space-before-blocks": "off",
|
|
5455
|
-
"space-before-function-paren": "off",
|
|
5456
|
-
"space-in-parens": "off",
|
|
5457
|
-
"space-infix-ops": "off",
|
|
5458
|
-
"space-unary-ops": "off",
|
|
5459
|
-
"standard/array-bracket-even-spacing": "off",
|
|
5460
|
-
"standard/computed-property-even-spacing": "off",
|
|
5461
|
-
"standard/object-curly-even-spacing": "off",
|
|
5462
|
-
"switch-colon-spacing": "off",
|
|
5463
|
-
"template-curly-spacing": "off",
|
|
5464
|
-
"template-tag-spacing": "off",
|
|
5465
|
-
"unicorn/empty-brace-spaces": "off",
|
|
5466
|
-
"unicorn/no-nested-ternary": "off",
|
|
5467
|
-
"unicorn/number-literal-case": "off",
|
|
5468
|
-
"wrap-iife": "off",
|
|
5469
|
-
"wrap-regex": "off",
|
|
5470
|
-
"yield-star-spacing": "off"
|
|
5471
|
-
};
|
|
5712
|
+
return ESLINT_CONFIG_PRETTIER_RULES;
|
|
5472
5713
|
}
|
|
5473
5714
|
const prettier = () => {
|
|
5474
5715
|
return [{
|
|
@@ -5478,19 +5719,292 @@ const prettier = () => {
|
|
|
5478
5719
|
}];
|
|
5479
5720
|
};
|
|
5480
5721
|
//#endregion
|
|
5722
|
+
//#region src/configs/react/eslint-react.ts
|
|
5723
|
+
const REACT_PRESETS = /* @__PURE__ */ new Set([
|
|
5724
|
+
"recommended",
|
|
5725
|
+
"recommended-type-checked",
|
|
5726
|
+
"recommended-typescript",
|
|
5727
|
+
"strict",
|
|
5728
|
+
"strict-type-checked",
|
|
5729
|
+
"strict-typescript"
|
|
5730
|
+
]);
|
|
5731
|
+
function isReactPreset(preset) {
|
|
5732
|
+
return REACT_PRESETS.has(preset);
|
|
5733
|
+
}
|
|
5734
|
+
function normalizeReactPreset(preset) {
|
|
5735
|
+
if (preset === void 0) return "recommended";
|
|
5736
|
+
if (!isReactPreset(preset)) {
|
|
5737
|
+
const validPresets = [...REACT_PRESETS].join(", ");
|
|
5738
|
+
throw new Error(`Unknown @eslint-react preset "${String(preset)}". Expected one of: ${validPresets}`);
|
|
5739
|
+
}
|
|
5740
|
+
return preset;
|
|
5741
|
+
}
|
|
5742
|
+
async function importReactPlugins() {
|
|
5743
|
+
return { pluginReact: await Promise.resolve(interopDefault(import("@eslint-react/eslint-plugin"))) };
|
|
5744
|
+
}
|
|
5745
|
+
const eslintReact = async (options) => {
|
|
5746
|
+
const { preset } = options ?? {};
|
|
5747
|
+
const { pluginReact } = await importReactPlugins();
|
|
5748
|
+
const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
|
|
5749
|
+
if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
|
|
5750
|
+
const presetRules = pluginReact.configs[normalizeReactPreset(preset)].rules;
|
|
5751
|
+
return [{
|
|
5752
|
+
files: [GLOB_SRC],
|
|
5753
|
+
name: "jsse/react/setup",
|
|
5754
|
+
plugins: { "@eslint-react": coreReactPlugins }
|
|
5755
|
+
}, {
|
|
5756
|
+
files: [GLOB_SRC],
|
|
5757
|
+
name: "jsse/react/rules",
|
|
5758
|
+
rules: { ...presetRules },
|
|
5759
|
+
settings: { react: { version: "detect" } }
|
|
5760
|
+
}];
|
|
5761
|
+
};
|
|
5762
|
+
//#endregion
|
|
5763
|
+
//#region src/configs/react/hooks.ts
|
|
5764
|
+
async function importPluginReactHooks() {
|
|
5765
|
+
try {
|
|
5766
|
+
return await interopDefault(import("eslint-plugin-react-hooks"));
|
|
5767
|
+
} catch (error) {
|
|
5768
|
+
throw new Error("eslint-plugin-react-hooks is not installed", { cause: error });
|
|
5769
|
+
}
|
|
5770
|
+
}
|
|
5771
|
+
const reactHooks = async ({ overrides = {}, preset = "recommended" } = {}) => {
|
|
5772
|
+
const pluginReactHooks = await importPluginReactHooks();
|
|
5773
|
+
const presetRules = pluginReactHooks.configs[preset].rules;
|
|
5774
|
+
return [{
|
|
5775
|
+
files: [GLOB_SRC],
|
|
5776
|
+
name: "jsse/react-hooks/rules",
|
|
5777
|
+
plugins: { "react-hooks": pluginReactHooks },
|
|
5778
|
+
rules: {
|
|
5779
|
+
"react-hooks/exhaustive-deps": "error",
|
|
5780
|
+
"react-hooks/rules-of-hooks": "error",
|
|
5781
|
+
...presetRules,
|
|
5782
|
+
...overrides
|
|
5783
|
+
},
|
|
5784
|
+
settings: { react: { version: "detect" } }
|
|
5785
|
+
}];
|
|
5786
|
+
};
|
|
5787
|
+
//#endregion
|
|
5788
|
+
//#region src/configs/react/refresh.ts
|
|
5789
|
+
async function importPluginReactRefresh() {
|
|
5790
|
+
try {
|
|
5791
|
+
return await interopDefault(import("eslint-plugin-react-refresh"));
|
|
5792
|
+
} catch (error) {
|
|
5793
|
+
throw new Error("eslint-plugin-react-refresh is not installed", { cause: error });
|
|
5794
|
+
}
|
|
5795
|
+
}
|
|
5796
|
+
const reactRefresh = async () => {
|
|
5797
|
+
const pluginReactRefresh = await importPluginReactRefresh();
|
|
5798
|
+
return [
|
|
5799
|
+
{
|
|
5800
|
+
files: [GLOB_SRC],
|
|
5801
|
+
name: "jsse/react-refresh/setup",
|
|
5802
|
+
plugins: { "react-refresh": pluginReactRefresh }
|
|
5803
|
+
},
|
|
5804
|
+
{
|
|
5805
|
+
files: [GLOB_SRC],
|
|
5806
|
+
name: "jsse/react/refresh",
|
|
5807
|
+
rules: { "react-refresh/only-export-components": "error" }
|
|
5808
|
+
},
|
|
5809
|
+
{
|
|
5810
|
+
files: ["**/*.stories.tsx"],
|
|
5811
|
+
name: "jsse/react-refresh/stories",
|
|
5812
|
+
rules: { "react-refresh/only-export-components": "off" }
|
|
5813
|
+
}
|
|
5814
|
+
];
|
|
5815
|
+
};
|
|
5816
|
+
//#endregion
|
|
5817
|
+
//#region src/configs/react/react.ts
|
|
5818
|
+
const LEGACY_REACT_REFRESH_OPTION = "reactRefresh";
|
|
5819
|
+
const react = async (options) => {
|
|
5820
|
+
const { hooks = true, overrides, ...rest } = options ?? {};
|
|
5821
|
+
const refresh = options?.refresh ?? options?.[LEGACY_REACT_REFRESH_OPTION] ?? true;
|
|
5822
|
+
const config = [
|
|
5823
|
+
...await eslintReact({
|
|
5824
|
+
...rest,
|
|
5825
|
+
overrides
|
|
5826
|
+
}),
|
|
5827
|
+
...hooks === false ? [] : await reactHooks({
|
|
5828
|
+
overrides,
|
|
5829
|
+
preset: hooks === true ? void 0 : hooks
|
|
5830
|
+
}),
|
|
5831
|
+
{
|
|
5832
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
5833
|
+
name: "jsse/react/disables",
|
|
5834
|
+
rules: { "unicorn/no-null": "off" }
|
|
5835
|
+
}
|
|
5836
|
+
];
|
|
5837
|
+
if (refresh) config.push(...await reactRefresh());
|
|
5838
|
+
if (options?.overrides) config.push({
|
|
5839
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
5840
|
+
name: "jsse/react/overrides",
|
|
5841
|
+
rules: { ...options.overrides }
|
|
5842
|
+
});
|
|
5843
|
+
return config;
|
|
5844
|
+
};
|
|
5845
|
+
//#endregion
|
|
5481
5846
|
//#region src/configs/regexp.ts
|
|
5482
5847
|
const regexp = () => {
|
|
5483
5848
|
const config = configs["flat/recommended"];
|
|
5484
|
-
const rules = { ...config.rules };
|
|
5485
5849
|
return [{
|
|
5486
5850
|
...config,
|
|
5487
5851
|
files: [GLOB_SRC],
|
|
5488
5852
|
name: "jsse/regexp/rules",
|
|
5489
|
-
rules
|
|
5853
|
+
rules: { ...config.rules }
|
|
5490
5854
|
}];
|
|
5491
5855
|
};
|
|
5492
5856
|
//#endregion
|
|
5493
5857
|
//#region src/configs/sort-package-json.ts
|
|
5858
|
+
const WIREIT_SCRIPT_PATH = String.raw`wireit(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])`;
|
|
5859
|
+
const WIREIT_ENV_PATH_BASE = String.raw`${WIREIT_SCRIPT_PATH}\.env`;
|
|
5860
|
+
const WIREIT_SERVICE_PATH_BASE = String.raw`${WIREIT_SCRIPT_PATH}\.service`;
|
|
5861
|
+
const WIREIT_DEPENDENCY_PATH = String.raw`^${WIREIT_SCRIPT_PATH}\.dependencies\[\d+\]$`;
|
|
5862
|
+
const WIREIT_ENV_PATH = `^${WIREIT_ENV_PATH_BASE}$`;
|
|
5863
|
+
const WIREIT_ENV_VALUE_PATH = String.raw`^${WIREIT_ENV_PATH_BASE}(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])$`;
|
|
5864
|
+
const WIREIT_SERVICE_PATH = `^${WIREIT_SERVICE_PATH_BASE}$`;
|
|
5865
|
+
const WIREIT_READY_WHEN_PATH = String.raw`^${WIREIT_SERVICE_PATH_BASE}\.readyWhen$`;
|
|
5866
|
+
const PACKAGE_JSON_ORDER = [
|
|
5867
|
+
"$schema",
|
|
5868
|
+
"name",
|
|
5869
|
+
"displayName",
|
|
5870
|
+
"version",
|
|
5871
|
+
"stableVersion",
|
|
5872
|
+
"gitHead",
|
|
5873
|
+
"private",
|
|
5874
|
+
"description",
|
|
5875
|
+
"categories",
|
|
5876
|
+
"keywords",
|
|
5877
|
+
"homepage",
|
|
5878
|
+
"bugs",
|
|
5879
|
+
"license",
|
|
5880
|
+
"author",
|
|
5881
|
+
"maintainers",
|
|
5882
|
+
"contributors",
|
|
5883
|
+
"repository",
|
|
5884
|
+
"funding",
|
|
5885
|
+
"donate",
|
|
5886
|
+
"sponsor",
|
|
5887
|
+
"qna",
|
|
5888
|
+
"publisher",
|
|
5889
|
+
"man",
|
|
5890
|
+
"style",
|
|
5891
|
+
"example",
|
|
5892
|
+
"examplestyle",
|
|
5893
|
+
"assets",
|
|
5894
|
+
"bin",
|
|
5895
|
+
"source",
|
|
5896
|
+
"directories",
|
|
5897
|
+
"workspaces",
|
|
5898
|
+
"binary",
|
|
5899
|
+
"files",
|
|
5900
|
+
"os",
|
|
5901
|
+
"cpu",
|
|
5902
|
+
"libc",
|
|
5903
|
+
"type",
|
|
5904
|
+
"sideEffects",
|
|
5905
|
+
"main",
|
|
5906
|
+
"module",
|
|
5907
|
+
"browser",
|
|
5908
|
+
"types",
|
|
5909
|
+
"typings",
|
|
5910
|
+
"typesVersions",
|
|
5911
|
+
"typeScriptVersion",
|
|
5912
|
+
"typesPublisherContentHash",
|
|
5913
|
+
"react-native",
|
|
5914
|
+
"svelte",
|
|
5915
|
+
"unpkg",
|
|
5916
|
+
"jsdelivr",
|
|
5917
|
+
"jsnext:main",
|
|
5918
|
+
"umd",
|
|
5919
|
+
"umd:main",
|
|
5920
|
+
"es5",
|
|
5921
|
+
"esm5",
|
|
5922
|
+
"fesm5",
|
|
5923
|
+
"es2015",
|
|
5924
|
+
"esm2015",
|
|
5925
|
+
"fesm2015",
|
|
5926
|
+
"es2020",
|
|
5927
|
+
"esm2020",
|
|
5928
|
+
"fesm2020",
|
|
5929
|
+
"esnext",
|
|
5930
|
+
"imports",
|
|
5931
|
+
"exports",
|
|
5932
|
+
"publishConfig",
|
|
5933
|
+
"scripts",
|
|
5934
|
+
"betterScripts",
|
|
5935
|
+
"wireit",
|
|
5936
|
+
"dependencies",
|
|
5937
|
+
"devDependencies",
|
|
5938
|
+
"dependenciesMeta",
|
|
5939
|
+
"peerDependencies",
|
|
5940
|
+
"peerDependenciesMeta",
|
|
5941
|
+
"optionalDependencies",
|
|
5942
|
+
"bundledDependencies",
|
|
5943
|
+
"bundleDependencies",
|
|
5944
|
+
"resolutions",
|
|
5945
|
+
"overrides",
|
|
5946
|
+
"husky",
|
|
5947
|
+
"simple-git-hooks",
|
|
5948
|
+
"vite-staged",
|
|
5949
|
+
"lint-staged",
|
|
5950
|
+
"nano-staged",
|
|
5951
|
+
"pre-commit",
|
|
5952
|
+
"commitlint",
|
|
5953
|
+
"l10n",
|
|
5954
|
+
"contributes",
|
|
5955
|
+
"activationEvents",
|
|
5956
|
+
"extensionPack",
|
|
5957
|
+
"extensionDependencies",
|
|
5958
|
+
"extensionKind",
|
|
5959
|
+
"icon",
|
|
5960
|
+
"badges",
|
|
5961
|
+
"galleryBanner",
|
|
5962
|
+
"preview",
|
|
5963
|
+
"markdown",
|
|
5964
|
+
"napi",
|
|
5965
|
+
"flat",
|
|
5966
|
+
"config",
|
|
5967
|
+
"nodemonConfig",
|
|
5968
|
+
"browserify",
|
|
5969
|
+
"babel",
|
|
5970
|
+
"browserslist",
|
|
5971
|
+
"xo",
|
|
5972
|
+
"prettier",
|
|
5973
|
+
"eslintConfig",
|
|
5974
|
+
"eslintIgnore",
|
|
5975
|
+
"standard",
|
|
5976
|
+
"npmpkgjsonlint",
|
|
5977
|
+
"npmPackageJsonLintConfig",
|
|
5978
|
+
"npmpackagejsonlint",
|
|
5979
|
+
"release",
|
|
5980
|
+
"auto-changelog",
|
|
5981
|
+
"remarkConfig",
|
|
5982
|
+
"stylelint",
|
|
5983
|
+
"typescript",
|
|
5984
|
+
"typedoc",
|
|
5985
|
+
"tshy",
|
|
5986
|
+
"tsdown",
|
|
5987
|
+
"size-limit",
|
|
5988
|
+
"ava",
|
|
5989
|
+
"jest",
|
|
5990
|
+
"jest-junit",
|
|
5991
|
+
"jest-stare",
|
|
5992
|
+
"mocha",
|
|
5993
|
+
"nyc",
|
|
5994
|
+
"c8",
|
|
5995
|
+
"tap",
|
|
5996
|
+
"tsd",
|
|
5997
|
+
"typeCoverage",
|
|
5998
|
+
"oclif",
|
|
5999
|
+
"languageName",
|
|
6000
|
+
"preferGlobal",
|
|
6001
|
+
"devEngines",
|
|
6002
|
+
"engines",
|
|
6003
|
+
"engineStrict",
|
|
6004
|
+
"volta",
|
|
6005
|
+
"packageManager",
|
|
6006
|
+
"pnpm"
|
|
6007
|
+
];
|
|
5494
6008
|
/**
|
|
5495
6009
|
* Sort package.json
|
|
5496
6010
|
*
|
|
@@ -5509,53 +6023,7 @@ const sortPackageJson = () => {
|
|
|
5509
6023
|
"jsonc/sort-keys": [
|
|
5510
6024
|
"error",
|
|
5511
6025
|
{
|
|
5512
|
-
order: [
|
|
5513
|
-
"publisher",
|
|
5514
|
-
"name",
|
|
5515
|
-
"displayName",
|
|
5516
|
-
"type",
|
|
5517
|
-
"version",
|
|
5518
|
-
"private",
|
|
5519
|
-
"packageManager",
|
|
5520
|
-
"description",
|
|
5521
|
-
"author",
|
|
5522
|
-
"contributors",
|
|
5523
|
-
"license",
|
|
5524
|
-
"funding",
|
|
5525
|
-
"homepage",
|
|
5526
|
-
"repository",
|
|
5527
|
-
"bugs",
|
|
5528
|
-
"keywords",
|
|
5529
|
-
"categories",
|
|
5530
|
-
"sideEffects",
|
|
5531
|
-
"imports",
|
|
5532
|
-
"exports",
|
|
5533
|
-
"main",
|
|
5534
|
-
"module",
|
|
5535
|
-
"unpkg",
|
|
5536
|
-
"jsdelivr",
|
|
5537
|
-
"types",
|
|
5538
|
-
"typesVersions",
|
|
5539
|
-
"bin",
|
|
5540
|
-
"icon",
|
|
5541
|
-
"files",
|
|
5542
|
-
"engines",
|
|
5543
|
-
"activationEvents",
|
|
5544
|
-
"contributes",
|
|
5545
|
-
"scripts",
|
|
5546
|
-
"peerDependencies",
|
|
5547
|
-
"peerDependenciesMeta",
|
|
5548
|
-
"dependencies",
|
|
5549
|
-
"optionalDependencies",
|
|
5550
|
-
"devDependencies",
|
|
5551
|
-
"pnpm",
|
|
5552
|
-
"overrides",
|
|
5553
|
-
"resolutions",
|
|
5554
|
-
"husky",
|
|
5555
|
-
"simple-git-hooks",
|
|
5556
|
-
"lint-staged",
|
|
5557
|
-
"eslintConfig"
|
|
5558
|
-
],
|
|
6026
|
+
order: [...PACKAGE_JSON_ORDER],
|
|
5559
6027
|
pathPattern: "^$"
|
|
5560
6028
|
},
|
|
5561
6029
|
{
|
|
@@ -5566,6 +6034,60 @@ const sortPackageJson = () => {
|
|
|
5566
6034
|
order: { type: "asc" },
|
|
5567
6035
|
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
5568
6036
|
},
|
|
6037
|
+
{
|
|
6038
|
+
order: { type: "asc" },
|
|
6039
|
+
pathPattern: "^wireit$"
|
|
6040
|
+
},
|
|
6041
|
+
{
|
|
6042
|
+
order: [
|
|
6043
|
+
"command",
|
|
6044
|
+
"dependencies",
|
|
6045
|
+
"files",
|
|
6046
|
+
"output",
|
|
6047
|
+
{
|
|
6048
|
+
keyPattern: ".*",
|
|
6049
|
+
order: { type: "asc" }
|
|
6050
|
+
}
|
|
6051
|
+
],
|
|
6052
|
+
pathPattern: `^${WIREIT_SCRIPT_PATH}$`
|
|
6053
|
+
},
|
|
6054
|
+
{
|
|
6055
|
+
order: [
|
|
6056
|
+
"script",
|
|
6057
|
+
"cascade",
|
|
6058
|
+
{
|
|
6059
|
+
keyPattern: ".*",
|
|
6060
|
+
order: { type: "asc" }
|
|
6061
|
+
}
|
|
6062
|
+
],
|
|
6063
|
+
pathPattern: WIREIT_DEPENDENCY_PATH
|
|
6064
|
+
},
|
|
6065
|
+
{
|
|
6066
|
+
order: { type: "asc" },
|
|
6067
|
+
pathPattern: WIREIT_ENV_PATH
|
|
6068
|
+
},
|
|
6069
|
+
{
|
|
6070
|
+
order: [
|
|
6071
|
+
"external",
|
|
6072
|
+
"default",
|
|
6073
|
+
{
|
|
6074
|
+
keyPattern: ".*",
|
|
6075
|
+
order: { type: "asc" }
|
|
6076
|
+
}
|
|
6077
|
+
],
|
|
6078
|
+
pathPattern: WIREIT_ENV_VALUE_PATH
|
|
6079
|
+
},
|
|
6080
|
+
{
|
|
6081
|
+
order: ["readyWhen", {
|
|
6082
|
+
keyPattern: ".*",
|
|
6083
|
+
order: { type: "asc" }
|
|
6084
|
+
}],
|
|
6085
|
+
pathPattern: WIREIT_SERVICE_PATH
|
|
6086
|
+
},
|
|
6087
|
+
{
|
|
6088
|
+
order: { type: "asc" },
|
|
6089
|
+
pathPattern: WIREIT_READY_WHEN_PATH
|
|
6090
|
+
},
|
|
5569
6091
|
{
|
|
5570
6092
|
order: [
|
|
5571
6093
|
"types",
|
|
@@ -5808,7 +6330,8 @@ function typescriptParser(options) {
|
|
|
5808
6330
|
//#region src/configs/ts/typescript.ts
|
|
5809
6331
|
const typescript = (options) => {
|
|
5810
6332
|
dbg("typescript-options: %O", options);
|
|
5811
|
-
const { componentExts = [], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [GLOB_MARKDOWN], overrides = {}, overridesTypeAware = {}, parserOptions = {}, prefix, strict = false, tsconfig: tsconfigPath, typeAware = true } = options ?? {};
|
|
6333
|
+
const { componentExts = [], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [GLOB_MARKDOWN], overrides = {}, overridesTypeAware = {}, parserOptions = {}, prefix, presets, strict = false, tsconfig: tsconfigPath, typeAware = true } = options ?? {};
|
|
6334
|
+
const strictProvided = options?.strict !== void 0;
|
|
5812
6335
|
const hasCustomTypeAwareScope = options?.filesTypeAware !== void 0 || options?.ignoresTypeAware !== void 0;
|
|
5813
6336
|
const parserConfigs = typeAware ? [typescriptParser({
|
|
5814
6337
|
filesTypeAware,
|
|
@@ -5834,7 +6357,9 @@ const typescript = (options) => {
|
|
|
5834
6357
|
const tsRules = {
|
|
5835
6358
|
"no-invalid-this": "off",
|
|
5836
6359
|
...typescriptRules({
|
|
6360
|
+
presets,
|
|
5837
6361
|
strict,
|
|
6362
|
+
strictProvided,
|
|
5838
6363
|
typeAware: false
|
|
5839
6364
|
}),
|
|
5840
6365
|
...overrides
|
|
@@ -5864,7 +6389,9 @@ const typescript = (options) => {
|
|
|
5864
6389
|
name: "jsse/typescript/rules-type-aware",
|
|
5865
6390
|
rules: renameRules({
|
|
5866
6391
|
...typescriptRules({
|
|
6392
|
+
presets,
|
|
5867
6393
|
strict,
|
|
6394
|
+
strictProvided,
|
|
5868
6395
|
typeAware: true
|
|
5869
6396
|
}),
|
|
5870
6397
|
...overrides,
|
|
@@ -5902,9 +6429,7 @@ const typescript = (options) => {
|
|
|
5902
6429
|
function unicornOff() {
|
|
5903
6430
|
return {
|
|
5904
6431
|
"unicorn/catch-error-name": "off",
|
|
5905
|
-
"unicorn/comment-content": "off",
|
|
5906
6432
|
"unicorn/consistent-boolean-name": "off",
|
|
5907
|
-
"unicorn/consistent-destructuring": "off",
|
|
5908
6433
|
"unicorn/name-replacements": "off",
|
|
5909
6434
|
"unicorn/no-array-reduce": "off",
|
|
5910
6435
|
"unicorn/no-nested-ternary": "off",
|
|
@@ -5915,6 +6440,16 @@ function unicornOff() {
|
|
|
5915
6440
|
"unicorn/prevent-abbreviations": "off"
|
|
5916
6441
|
};
|
|
5917
6442
|
}
|
|
6443
|
+
function unicornSelectedRules() {
|
|
6444
|
+
return {
|
|
6445
|
+
"unicorn/better-regex": "error",
|
|
6446
|
+
"unicorn/custom-error-definition": "error",
|
|
6447
|
+
"unicorn/no-array-push-push": "error",
|
|
6448
|
+
"unicorn/no-hex-escape": "error",
|
|
6449
|
+
"unicorn/no-instanceof-array": "error",
|
|
6450
|
+
"unicorn/prefer-dom-node-dataset": "error"
|
|
6451
|
+
};
|
|
6452
|
+
}
|
|
5918
6453
|
function unicornRecommended(pluginUnicorn) {
|
|
5919
6454
|
const rules = pluginUnicorn.configs.recommended.rules;
|
|
5920
6455
|
if (rules === void 0) throw new Error("Expected rules to be defined in unicorn plugin");
|
|
@@ -5936,59 +6471,7 @@ const unicorn = ({ overrides = {}, preset = "recommended" } = {}) => {
|
|
|
5936
6471
|
rules: {
|
|
5937
6472
|
...unicornPresetRules(pluginUnicorn, preset),
|
|
5938
6473
|
...unicornOff(),
|
|
5939
|
-
|
|
5940
|
-
"unicorn/consistent-empty-array-spread": "error",
|
|
5941
|
-
"unicorn/custom-error-definition": "error",
|
|
5942
|
-
"unicorn/error-message": "error",
|
|
5943
|
-
"unicorn/escape-case": "error",
|
|
5944
|
-
"unicorn/explicit-length-check": "error",
|
|
5945
|
-
"unicorn/filename-case": "error",
|
|
5946
|
-
"unicorn/new-for-builtins": "error",
|
|
5947
|
-
"unicorn/no-array-callback-reference": "error",
|
|
5948
|
-
"unicorn/no-array-method-this-argument": "error",
|
|
5949
|
-
"unicorn/no-array-push-push": "error",
|
|
5950
|
-
"unicorn/no-console-spaces": "error",
|
|
5951
|
-
"unicorn/no-for-loop": "error",
|
|
5952
|
-
"unicorn/no-hex-escape": "error",
|
|
5953
|
-
"unicorn/no-instanceof-array": "error",
|
|
5954
|
-
"unicorn/no-invalid-remove-event-listener": "error",
|
|
5955
|
-
"unicorn/no-lonely-if": "error",
|
|
5956
|
-
"unicorn/no-new-array": "error",
|
|
5957
|
-
"unicorn/no-new-buffer": "error",
|
|
5958
|
-
"unicorn/no-static-only-class": "error",
|
|
5959
|
-
"unicorn/no-unnecessary-await": "error",
|
|
5960
|
-
"unicorn/no-zero-fractions": "error",
|
|
5961
|
-
"unicorn/number-literal-case": "error",
|
|
5962
|
-
"unicorn/prefer-add-event-listener": "error",
|
|
5963
|
-
"unicorn/prefer-array-find": "error",
|
|
5964
|
-
"unicorn/prefer-array-flat-map": "error",
|
|
5965
|
-
"unicorn/prefer-array-index-of": "error",
|
|
5966
|
-
"unicorn/prefer-array-some": "error",
|
|
5967
|
-
"unicorn/prefer-at": "error",
|
|
5968
|
-
"unicorn/prefer-blob-reading-methods": "error",
|
|
5969
|
-
"unicorn/prefer-date-now": "error",
|
|
5970
|
-
"unicorn/prefer-dom-node-append": "error",
|
|
5971
|
-
"unicorn/prefer-dom-node-dataset": "error",
|
|
5972
|
-
"unicorn/prefer-dom-node-remove": "error",
|
|
5973
|
-
"unicorn/prefer-dom-node-text-content": "error",
|
|
5974
|
-
"unicorn/prefer-includes": "error",
|
|
5975
|
-
"unicorn/prefer-keyboard-event-key": "error",
|
|
5976
|
-
"unicorn/prefer-math-trunc": "error",
|
|
5977
|
-
"unicorn/prefer-modern-dom-apis": "error",
|
|
5978
|
-
"unicorn/prefer-modern-math-apis": "error",
|
|
5979
|
-
"unicorn/prefer-negative-index": "error",
|
|
5980
|
-
"unicorn/prefer-node-protocol": "error",
|
|
5981
|
-
"unicorn/prefer-number-properties": "error",
|
|
5982
|
-
"unicorn/prefer-prototype-methods": "error",
|
|
5983
|
-
"unicorn/prefer-query-selector": "error",
|
|
5984
|
-
"unicorn/prefer-reflect-apply": "error",
|
|
5985
|
-
"unicorn/prefer-regexp-test": "error",
|
|
5986
|
-
"unicorn/prefer-string-replace-all": "error",
|
|
5987
|
-
"unicorn/prefer-string-slice": "error",
|
|
5988
|
-
"unicorn/prefer-string-starts-ends-with": "error",
|
|
5989
|
-
"unicorn/prefer-string-trim-start-end": "error",
|
|
5990
|
-
"unicorn/prefer-type-error": "error",
|
|
5991
|
-
"unicorn/throw-new-error": "error",
|
|
6474
|
+
...unicornSelectedRules(),
|
|
5992
6475
|
...overrides
|
|
5993
6476
|
}
|
|
5994
6477
|
}, {
|
|
@@ -12768,6 +13251,17 @@ const FLAT_CFG_PROPS = [
|
|
|
12768
13251
|
"rules",
|
|
12769
13252
|
"settings"
|
|
12770
13253
|
];
|
|
13254
|
+
function getReactRefreshOption(options) {
|
|
13255
|
+
const compatOptions = options;
|
|
13256
|
+
return options.refresh ?? compatOptions.reactRefresh;
|
|
13257
|
+
}
|
|
13258
|
+
async function gitignoreConfig(options) {
|
|
13259
|
+
if (options === false) return [];
|
|
13260
|
+
const flatGitignore = await interopDefault(import("./dist-DS02OtwI.js"));
|
|
13261
|
+
const config = options === true ? flatGitignore() : flatGitignore(options);
|
|
13262
|
+
dbg("Using eslint-config-flat-gitignore: %O", config);
|
|
13263
|
+
return [config];
|
|
13264
|
+
}
|
|
12771
13265
|
/**
|
|
12772
13266
|
* Construct an array of ESLint flat config items.
|
|
12773
13267
|
* @param options Configuration options `@jsse/eslint-config` & ESLint Flat Config
|
|
@@ -12784,23 +13278,19 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12784
13278
|
dbg("@jsse/eslint-config enableTypeScript: %O", typescriptOptions);
|
|
12785
13279
|
dbg("@jsse/eslint-config normalizedOptions: %O", normalizedOptions);
|
|
12786
13280
|
const configs = [];
|
|
12787
|
-
if (enableGitignore)
|
|
12788
|
-
if (fs.existsSync(".gitignore")) configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => {
|
|
12789
|
-
const res = r();
|
|
12790
|
-
dbg("Using eslint-config-flat-gitignore res: %O", res);
|
|
12791
|
-
return [res];
|
|
12792
|
-
}));
|
|
12793
|
-
} else configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => {
|
|
12794
|
-
dbg("Using eslint-config-flat-gitignore: %O", r);
|
|
12795
|
-
const res = r(enableGitignore);
|
|
12796
|
-
dbg("Using eslint-config-flat-gitignore: %O", res);
|
|
12797
|
-
return [res];
|
|
12798
|
-
}));
|
|
13281
|
+
if (enableGitignore) configs.push(gitignoreConfig(enableGitignore));
|
|
12799
13282
|
configs.push(ignores(), javascript({
|
|
12800
13283
|
isInEditor,
|
|
12801
13284
|
...javascriptOptions,
|
|
12802
13285
|
reportUnusedDisableDirectives
|
|
12803
|
-
}), eslintComments()
|
|
13286
|
+
}), eslintComments());
|
|
13287
|
+
if (nOptions) configs.push(n(typeof nOptions === "object" ? nOptions : void 0));
|
|
13288
|
+
if (jsdocOptions) configs.push(jsdoc(typeof jsdocOptions === "object" ? jsdocOptions : void 0));
|
|
13289
|
+
configs.push(imports({ stylistic: stylisticOptions }));
|
|
13290
|
+
if (unicornOptions) configs.push(unicorn(typeof unicornOptions === "object" ? unicornOptions : {}));
|
|
13291
|
+
if (antfuOptions) configs.push(antfu(typeof antfuOptions === "object" ? antfuOptions : void 0));
|
|
13292
|
+
if (deMorganOptions) configs.push(deMorgan(typeof deMorganOptions === "object" ? deMorganOptions : void 0));
|
|
13293
|
+
if (e18eOptions) configs.push(e18e(typeof e18eOptions === "object" ? e18eOptions : {}));
|
|
12804
13294
|
if (enableSortImports) configs.push(perfectionist());
|
|
12805
13295
|
/**
|
|
12806
13296
|
* =========================================================================
|
|
@@ -12844,9 +13334,9 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12844
13334
|
const ymlConfig = yml(typeof enableYaml === "object" ? enableYaml : void 0);
|
|
12845
13335
|
configs.push(ymlConfig);
|
|
12846
13336
|
}
|
|
12847
|
-
if (enableReact) configs.push(
|
|
13337
|
+
if (enableReact) configs.push(react({
|
|
12848
13338
|
...typeof enableReact === "object" && enableReact,
|
|
12849
|
-
|
|
13339
|
+
refresh: typeof enableReact === "object" && getReactRefreshOption(enableReact) !== void 0 ? getReactRefreshOption(enableReact) : normalizedOptions.reactRefresh !== false
|
|
12850
13340
|
}));
|
|
12851
13341
|
if (enablePrettier) configs.push(prettier());
|
|
12852
13342
|
if (stylisticOptions) configs.push(stylistic(stylisticOptions === true ? {} : stylisticOptions));
|
|
@@ -12874,7 +13364,11 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12874
13364
|
return acc;
|
|
12875
13365
|
}, {});
|
|
12876
13366
|
if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
|
|
12877
|
-
|
|
13367
|
+
dbg("ENTER::combining-configs");
|
|
13368
|
+
const combinedConfigs = await combineAsync(...configs, ...userConfigs);
|
|
13369
|
+
dbg("EXIT::combining-configs");
|
|
13370
|
+
dbg("ENTER::post-processing configs");
|
|
13371
|
+
const finalizedConfigs = postProcessConfigs(combinedConfigs, {
|
|
12878
13372
|
componentExts,
|
|
12879
13373
|
debug,
|
|
12880
13374
|
off,
|
|
@@ -12882,6 +13376,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12882
13376
|
tsPrefix,
|
|
12883
13377
|
typescript: !!typescriptOptions
|
|
12884
13378
|
});
|
|
13379
|
+
dbg("EXIT::post-processing configs");
|
|
12885
13380
|
if (normalizedOptions.preReturn) {
|
|
12886
13381
|
dbg("Running preReturn");
|
|
12887
13382
|
const res = await normalizedOptions.preReturn(finalizedConfigs);
|