@jsse/eslint-config 0.8.4 → 0.8.6
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 +13 -0
- package/dist/cli.js +80 -47
- package/dist/{const-D_tT7WuW.js → const-xMi9KGIh.js} +1 -1
- package/dist/index.d.ts +17 -7
- package/dist/index.js +57 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -11
package/CHANGELOG.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { r as VERSION, t as DEBUG } from "./const-
|
|
2
|
+
import { r as VERSION, t as DEBUG } from "./const-xMi9KGIh.js";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -6052,7 +6052,8 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
6052
6052
|
return dispatchByMode(combinedMode, () => parseSync(context), () => parseAsync(context));
|
|
6053
6053
|
},
|
|
6054
6054
|
getSuggestRuntimeNodes(state, path) {
|
|
6055
|
-
|
|
6055
|
+
const stateRecord = state != null && typeof state === "object" ? state : objectParser.initialState;
|
|
6056
|
+
return buildSuggestRuntimeNodesFromPairs(parserPairs, stateRecord, path);
|
|
6056
6057
|
},
|
|
6057
6058
|
complete(state, exec) {
|
|
6058
6059
|
return dispatchByMode(combinedMode, () => {
|
|
@@ -7098,7 +7099,8 @@ function extractDependencyMetadata(valueParser) {
|
|
|
7098
7099
|
getDefaultDependencyValues: defaultValuesFn,
|
|
7099
7100
|
replayParse,
|
|
7100
7101
|
replaySuggest: suggestFn != null ? (prefix, depValues) => {
|
|
7101
|
-
|
|
7102
|
+
const depArg = isMultiSource ? depValues : depValues[0];
|
|
7103
|
+
return suggestFn(prefix, depArg);
|
|
7102
7104
|
} : void 0
|
|
7103
7105
|
} };
|
|
7104
7106
|
}
|
|
@@ -7918,7 +7920,8 @@ function multiple(parser, options = {}) {
|
|
|
7918
7920
|
const canExtendMultipleItem = (state, itemIndex, exec) => state != null && !isTerminalMultipleItemState(state) && (isMatchedCommandParserState(parser, state) || parser.canSkip?.(state, withChildExecPath(exec, itemIndex)) !== true);
|
|
7919
7921
|
const parseSync = (context) => {
|
|
7920
7922
|
const currentItemState = context.state.at(-1);
|
|
7921
|
-
const
|
|
7923
|
+
const currentItemIndex = context.state.length - 1;
|
|
7924
|
+
const canExtendCurrent = canExtendMultipleItem(currentItemState, currentItemIndex, context.exec);
|
|
7922
7925
|
const canOpenFreshItem = context.state.length < max;
|
|
7923
7926
|
if (!canExtendCurrent && !canOpenFreshItem) return {
|
|
7924
7927
|
success: true,
|
|
@@ -7998,7 +8001,8 @@ function multiple(parser, options = {}) {
|
|
|
7998
8001
|
};
|
|
7999
8002
|
const parseAsync = async (context) => {
|
|
8000
8003
|
const currentItemState = context.state.at(-1);
|
|
8001
|
-
const
|
|
8004
|
+
const currentItemIndex = context.state.length - 1;
|
|
8005
|
+
const canExtendCurrent = canExtendMultipleItem(currentItemState, currentItemIndex, context.exec);
|
|
8002
8006
|
const canOpenFreshItem = context.state.length < max;
|
|
8003
8007
|
if (!canExtendCurrent && !canOpenFreshItem) return {
|
|
8004
8008
|
success: true,
|
|
@@ -8091,7 +8095,8 @@ function multiple(parser, options = {}) {
|
|
|
8091
8095
|
initialState: [],
|
|
8092
8096
|
canSkip(state, exec) {
|
|
8093
8097
|
if (state.length < min) return false;
|
|
8094
|
-
|
|
8098
|
+
const currentItemState = state.at(-1);
|
|
8099
|
+
return !canExtendMultipleItem(currentItemState, state.length - 1, exec);
|
|
8095
8100
|
},
|
|
8096
8101
|
getSuggestRuntimeNodes(state, path) {
|
|
8097
8102
|
const innerNodes = state.flatMap((item, i) => [...getInnerSuggestRuntimeNodes(item, [...path, i])]);
|
|
@@ -8192,7 +8197,8 @@ function multiple(parser, options = {}) {
|
|
|
8192
8197
|
},
|
|
8193
8198
|
suggest(context, prefix) {
|
|
8194
8199
|
const currentItemState = context.state.at(-1);
|
|
8195
|
-
const
|
|
8200
|
+
const currentItemIndex = context.state.length - 1;
|
|
8201
|
+
const canExtendCurrent = canExtendMultipleItem(currentItemState, currentItemIndex, context.exec);
|
|
8196
8202
|
const canOpenNew = context.state.length < max;
|
|
8197
8203
|
if (!canExtendCurrent && !canOpenNew) return dispatchIterableByMode(parser.mode, function* () {}, async function* () {});
|
|
8198
8204
|
const itemIndex = canExtendCurrent ? context.state.length - 1 : context.state.length;
|
|
@@ -12293,10 +12299,11 @@ function runParser(parserOrProgram, programNameOrArgs, argsOrOptions, optionsPar
|
|
|
12293
12299
|
maxWidth: maxWidth == null ? void 0 : maxWidth - 7,
|
|
12294
12300
|
expandCommands: true
|
|
12295
12301
|
}), 7)}`);
|
|
12296
|
-
|
|
12302
|
+
const errorMessage = formatMessage(validationError, {
|
|
12297
12303
|
colors,
|
|
12298
12304
|
quotes: !colors
|
|
12299
|
-
})
|
|
12305
|
+
});
|
|
12306
|
+
stderr(`Error: ${errorMessage}`);
|
|
12300
12307
|
return onError(1);
|
|
12301
12308
|
};
|
|
12302
12309
|
const displayHelp = (doc) => {
|
|
@@ -12351,7 +12358,8 @@ function runParser(parserOrProgram, programNameOrArgs, argsOrOptions, optionsPar
|
|
|
12351
12358
|
let res = processStep(result);
|
|
12352
12359
|
while (res === "continue") {
|
|
12353
12360
|
const next = helpGeneratorParser.parse(validationContext);
|
|
12354
|
-
|
|
12361
|
+
const resolved = next instanceof Promise ? await next : next;
|
|
12362
|
+
res = processStep(resolved);
|
|
12355
12363
|
}
|
|
12356
12364
|
if (res != null) return reportInvalidHelpCommand(res);
|
|
12357
12365
|
const docOrPromise$1 = getDocPage(docGeneratorParser, classified.commands);
|
|
@@ -12393,10 +12401,11 @@ function runParser(parserOrProgram, programNameOrArgs, argsOrOptions, optionsPar
|
|
|
12393
12401
|
maxWidth: maxWidth == null ? void 0 : maxWidth - 7,
|
|
12394
12402
|
expandCommands: true
|
|
12395
12403
|
}), 7)}`);
|
|
12396
|
-
|
|
12404
|
+
const errorMessage = formatMessage(classified.error, {
|
|
12397
12405
|
colors,
|
|
12398
12406
|
quotes: !colors
|
|
12399
|
-
})
|
|
12407
|
+
});
|
|
12408
|
+
stderr(`Error: ${errorMessage}`);
|
|
12400
12409
|
return onError(1);
|
|
12401
12410
|
};
|
|
12402
12411
|
if (aboveError === "help") {
|
|
@@ -12412,18 +12421,20 @@ function runParser(parserOrProgram, programNameOrArgs, argsOrOptions, optionsPar
|
|
|
12412
12421
|
const parserMode = parser.mode;
|
|
12413
12422
|
return dispatchByMode(parserMode, () => {
|
|
12414
12423
|
const attempted = attemptParseSync(parser, args);
|
|
12415
|
-
const
|
|
12424
|
+
const classified = attempted.kind === "success" ? {
|
|
12416
12425
|
type: "success",
|
|
12417
12426
|
value: attempted.value
|
|
12418
|
-
} : classifyParseFailure(attempted, helpOptionConfig ? [...helpOptionNames] : [], helpCommandConfig ? [...helpCommandNames] : [], versionOptionConfig ? [...versionOptionNames] : [], versionCommandConfig ? [...versionCommandNames] : [], completionOptionConfig ? [...completionOptionNames] : [], completionCommandConfig ? [...completionCommandNames] : [])
|
|
12427
|
+
} : classifyParseFailure(attempted, helpOptionConfig ? [...helpOptionNames] : [], helpCommandConfig ? [...helpCommandNames] : [], versionOptionConfig ? [...versionOptionNames] : [], versionCommandConfig ? [...versionCommandNames] : [], completionOptionConfig ? [...completionOptionNames] : [], completionCommandConfig ? [...completionCommandNames] : []);
|
|
12428
|
+
const handled = handleResult(classified);
|
|
12419
12429
|
if (handled instanceof Promise) throw new RunParserError("Synchronous parser returned async result.");
|
|
12420
12430
|
return handled;
|
|
12421
12431
|
}, async () => {
|
|
12422
12432
|
const attempted = await attemptParseAsync(parser, args);
|
|
12423
|
-
const
|
|
12433
|
+
const classified = attempted.kind === "success" ? {
|
|
12424
12434
|
type: "success",
|
|
12425
12435
|
value: attempted.value
|
|
12426
|
-
} : classifyParseFailure(attempted, helpOptionConfig ? [...helpOptionNames] : [], helpCommandConfig ? [...helpCommandNames] : [], versionOptionConfig ? [...versionOptionNames] : [], versionCommandConfig ? [...versionCommandNames] : [], completionOptionConfig ? [...completionOptionNames] : [], completionCommandConfig ? [...completionCommandNames] : [])
|
|
12436
|
+
} : classifyParseFailure(attempted, helpOptionConfig ? [...helpOptionNames] : [], helpCommandConfig ? [...helpCommandNames] : [], versionOptionConfig ? [...versionOptionNames] : [], versionCommandConfig ? [...versionCommandNames] : [], completionOptionConfig ? [...completionOptionNames] : [], completionCommandConfig ? [...completionCommandNames] : []);
|
|
12437
|
+
const handled = handleResult(classified);
|
|
12427
12438
|
return handled instanceof Promise ? await handled : handled;
|
|
12428
12439
|
});
|
|
12429
12440
|
}
|
|
@@ -12885,38 +12896,59 @@ import jsse from "@jsse/eslint-config";
|
|
|
12885
12896
|
export default jsse(
|
|
12886
12897
|
{
|
|
12887
12898
|
/**
|
|
12888
|
-
*
|
|
12889
|
-
*
|
|
12890
|
-
*
|
|
12891
|
-
*/
|
|
12892
|
-
debug: false,
|
|
12893
|
-
|
|
12894
|
-
/**
|
|
12895
|
-
* Enable TypeScript support.
|
|
12899
|
+
* @jsse/eslint-config defaults
|
|
12900
|
+
*
|
|
12901
|
+
* Uncomment an option to override its default.
|
|
12896
12902
|
*/
|
|
12903
|
+
// command: true,
|
|
12904
|
+
// componentExts: [],
|
|
12905
|
+
// debug: false, // debugging of config
|
|
12906
|
+
// diagnostics: true, // report cfg problems/diagnostics
|
|
12907
|
+
// extendTsconfigLintGlobs: ["tsconfig.json", "tsconfig.*.json"],
|
|
12908
|
+
// fast: false,
|
|
12909
|
+
// filesTypeAware: ["**/*.{ts,tsx}"],
|
|
12910
|
+
// gitignore: true,
|
|
12911
|
+
// ignoresTypeAware: ["**/*.md/**"],
|
|
12912
|
+
// isInEditor: false, // Auto-detected from the environment.
|
|
12913
|
+
// jsonc: true,
|
|
12914
|
+
// jsx: true,
|
|
12915
|
+
// markdown: false,
|
|
12916
|
+
// off: [],
|
|
12917
|
+
// overrides: {
|
|
12918
|
+
// javascript: {},
|
|
12919
|
+
// jsonc: {},
|
|
12920
|
+
// markdown: {},
|
|
12921
|
+
// test: {},
|
|
12922
|
+
// typescript: {},
|
|
12923
|
+
// yaml: {},
|
|
12924
|
+
// },
|
|
12925
|
+
// parserOptions: {},
|
|
12926
|
+
// pnpm: false,
|
|
12927
|
+
// prettier: true,
|
|
12928
|
+
// preReturn: (configs) => configs,
|
|
12929
|
+
// react: false,
|
|
12930
|
+
// reactRefresh: false,
|
|
12931
|
+
// regexp: true,
|
|
12932
|
+
// reportUnusedDisableDirectives: true,
|
|
12933
|
+
// rootId: "jsse",
|
|
12934
|
+
// sortGeojson: false,
|
|
12935
|
+
// sortImports: false,
|
|
12936
|
+
// sortPackageJson: true,
|
|
12937
|
+
// sortTsconfig: true,
|
|
12938
|
+
// stylistic: true,
|
|
12939
|
+
// stylistic: { indent: 2, jsx: true, quotes: "double" },
|
|
12940
|
+
// test: false, // Auto-detected from installed dependencies.
|
|
12941
|
+
// tsPrefix: "@typescript-eslint",
|
|
12942
|
+
// typeAware: false,
|
|
12943
|
+
// typescript: true,
|
|
12897
12944
|
// typescript: {
|
|
12898
|
-
//
|
|
12945
|
+
// overridesTypeAware: {},
|
|
12946
|
+
// strict: false,
|
|
12947
|
+
// tsconfig: "tsconfig.json",
|
|
12948
|
+
// typeAware: false,
|
|
12899
12949
|
// },
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
* Enable React support.
|
|
12903
|
-
* @default false
|
|
12904
|
-
*/
|
|
12905
|
-
// react: true,
|
|
12906
|
-
// reactRefresh: true,
|
|
12907
|
-
|
|
12908
|
-
/**
|
|
12909
|
-
* Report unused disable directives
|
|
12910
|
-
* @default true
|
|
12911
|
-
*/
|
|
12912
|
-
// reportUnusedDisableDirectives: false,
|
|
12913
|
-
|
|
12914
|
-
/**
|
|
12915
|
-
* rules 2 turn off
|
|
12916
|
-
* @default []
|
|
12917
|
-
* @example ["super-annoying-rule"]
|
|
12918
|
-
*/
|
|
12919
|
-
// off: [],
|
|
12950
|
+
// useProjectService: false,
|
|
12951
|
+
// yaml: false,
|
|
12920
12952
|
}
|
|
12921
12953
|
);
|
|
12922
12954
|
`;
|
|
@@ -12949,7 +12981,7 @@ function writeInitConfig(options) {
|
|
|
12949
12981
|
console.log(`made ${configPath} (esm-only)`);
|
|
12950
12982
|
}
|
|
12951
12983
|
async function main() {
|
|
12952
|
-
const
|
|
12984
|
+
const runOptions = {
|
|
12953
12985
|
brief: message`\`@jsse/eslint-config\` ~ cli ~ v${VERSION}`,
|
|
12954
12986
|
help: "both",
|
|
12955
12987
|
programName: "jsselint",
|
|
@@ -12958,7 +12990,8 @@ async function main() {
|
|
|
12958
12990
|
option: true,
|
|
12959
12991
|
value: VERSION
|
|
12960
12992
|
}
|
|
12961
|
-
}
|
|
12993
|
+
};
|
|
12994
|
+
const parsed = run(PARSER, { ...runOptions });
|
|
12962
12995
|
try {
|
|
12963
12996
|
if (DEBUG || parsed.debug) {
|
|
12964
12997
|
console.log("=====");
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { Linter } from "eslint";
|
|
|
16
16
|
import { FlatGitignoreOptions } from "eslint-config-flat-gitignore";
|
|
17
17
|
|
|
18
18
|
//#region src/_generated/version.d.ts
|
|
19
|
-
declare const VERSION = "0.8.
|
|
19
|
+
declare const VERSION = "0.8.6";
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/_generated/dts/builtins.d.ts
|
|
22
22
|
interface BuiltinsRuleOptions {
|
|
@@ -16323,9 +16323,10 @@ type OptionsConfig = OptionsComponentExts & OptionsTypeScriptParserOptions & {
|
|
|
16323
16323
|
*/
|
|
16324
16324
|
debug?: boolean;
|
|
16325
16325
|
/**
|
|
16326
|
-
* Enable
|
|
16326
|
+
* Enable configuration diagnostics.
|
|
16327
|
+
* @default true
|
|
16327
16328
|
*/
|
|
16328
|
-
|
|
16329
|
+
diagnostics?: boolean;
|
|
16329
16330
|
/**
|
|
16330
16331
|
* Enable reporting of unused disable directives.
|
|
16331
16332
|
* @default true
|
|
@@ -16334,7 +16335,7 @@ type OptionsConfig = OptionsComponentExts & OptionsTypeScriptParserOptions & {
|
|
|
16334
16335
|
/**
|
|
16335
16336
|
* Array of rules to turn off.
|
|
16336
16337
|
*/
|
|
16337
|
-
off?:
|
|
16338
|
+
off?: RuleName[] | Set<RuleName>;
|
|
16338
16339
|
/**
|
|
16339
16340
|
* Enable `eslint-plugin-command`
|
|
16340
16341
|
* @default true
|
|
@@ -16394,6 +16395,11 @@ type OptionsConfig = OptionsComponentExts & OptionsTypeScriptParserOptions & {
|
|
|
16394
16395
|
* @default true
|
|
16395
16396
|
*/
|
|
16396
16397
|
sortTsconfig?: boolean;
|
|
16398
|
+
/**
|
|
16399
|
+
* Enable sorting of geojson files.
|
|
16400
|
+
* @default false
|
|
16401
|
+
*/
|
|
16402
|
+
sortGeojson?: boolean;
|
|
16397
16403
|
/**
|
|
16398
16404
|
* Enable import/export sorting via perfectionist.
|
|
16399
16405
|
* @default false
|
|
@@ -16474,6 +16480,9 @@ type OptionsConfig = OptionsComponentExts & OptionsTypeScriptParserOptions & {
|
|
|
16474
16480
|
yaml?: Config["rules"];
|
|
16475
16481
|
};
|
|
16476
16482
|
};
|
|
16483
|
+
type NormalizedOptionsConfig = Omit<OptionsConfig, "off"> & {
|
|
16484
|
+
off: RuleName[];
|
|
16485
|
+
};
|
|
16477
16486
|
type RenamePrefix<T extends Record<string, unknown>, FromPref extends string, ToPref extends string> = { [K in keyof T as K extends `${FromPref}${infer Rest}` ? `${ToPref}${Rest}` : K]: T[K] };
|
|
16478
16487
|
//#endregion
|
|
16479
16488
|
//#region src/const.d.ts
|
|
@@ -16490,7 +16499,7 @@ declare function jsse(options?: OptionsConfig & Config, ...userConfigs: (Config
|
|
|
16490
16499
|
declare function defineConfig(options?: OptionsConfig & Config, ...userConfigs: (Config | Config[])[]): Promise<Config[]>;
|
|
16491
16500
|
type DefineConfig = typeof defineConfig;
|
|
16492
16501
|
declare namespace globs_d_exports {
|
|
16493
|
-
export { GLOB_ALL_SRC, GLOB_CODE, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_TS_SRC_EXT, GLOB_YAML };
|
|
16502
|
+
export { GLOB_ALL_SRC, GLOB_CODE, GLOB_CSS, GLOB_EXCLUDE, GLOB_GEOJSON, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_TS_SRC_EXT, GLOB_YAML };
|
|
16494
16503
|
}
|
|
16495
16504
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
16496
16505
|
declare const GLOB_JS_SRC_EXT = "?([cm])js?(x)";
|
|
@@ -16507,6 +16516,7 @@ declare const GLOB_SCSS = "**/*.scss";
|
|
|
16507
16516
|
declare const GLOB_JSON = "**/*.json";
|
|
16508
16517
|
declare const GLOB_JSON5 = "**/*.json5";
|
|
16509
16518
|
declare const GLOB_JSONC = "**/*.jsonc";
|
|
16519
|
+
declare const GLOB_GEOJSON = "**/*.geojson";
|
|
16510
16520
|
declare const GLOB_TOML = "**/*.toml";
|
|
16511
16521
|
declare const GLOB_MARKDOWN = "**/*.md";
|
|
16512
16522
|
declare const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
@@ -16522,7 +16532,7 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
16522
16532
|
//#endregion
|
|
16523
16533
|
//#region src/options.d.ts
|
|
16524
16534
|
declare function defaultOptions(): OptionsConfig;
|
|
16525
|
-
declare function normalizeOptions(options?: OptionsConfig):
|
|
16535
|
+
declare function normalizeOptions(options?: OptionsConfig): NormalizedOptionsConfig;
|
|
16526
16536
|
//#endregion
|
|
16527
16537
|
//#region src/plugins.d.ts
|
|
16528
16538
|
declare function importPluginReact(): Promise<{
|
|
@@ -16920,4 +16930,4 @@ declare function error2warn<T extends Config>(configs: T[]): T[];
|
|
|
16920
16930
|
declare function warn2error<T extends Config>(configs: T[]): T[];
|
|
16921
16931
|
declare function replaceTypescriptEslintPrefixInplace<T>(items: Record<string, T>, tsPrefix: string): void;
|
|
16922
16932
|
//#endregion
|
|
16923
|
-
export { type Awaitable, type Config, type EslintConfigFn, type JavascriptRuleOptions, type LanguageOptions, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type RenamePrefix, type RuleName, type RulesRecord, SLOW_RULES, type StylisticConfig, type TailwindEslintSettings, type TailwindOptions, type TypedFlatConfigItemWithId, type TypescriptConfigRules, type UnPromise, VERSION, changeRuleEntrySeverity, combine, combineAsync, jsse as default, jsse, defaultOptions, defineConfig, error2warn, globs_d_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 };
|
|
16933
|
+
export { type Awaitable, type Config, type EslintConfigFn, type JavascriptRuleOptions, type LanguageOptions, type NormalizedOptionsConfig, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type RenamePrefix, type RuleName, type RulesRecord, SLOW_RULES, type StylisticConfig, type TailwindEslintSettings, type TailwindOptions, type TypedFlatConfigItemWithId, type TypescriptConfigRules, type UnPromise, VERSION, changeRuleEntrySeverity, combine, combineAsync, jsse as default, jsse, defaultOptions, defineConfig, error2warn, globs_d_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 };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
+
import { n as SLOW_RULES, r as VERSION, t as DEBUG } from "./const-xMi9KGIh.js";
|
|
3
3
|
import { builtinModules, createRequire } from "node:module";
|
|
4
4
|
import process$1 from "node:process";
|
|
5
5
|
import fs, { realpathSync, statSync } from "node:fs";
|
|
@@ -33,6 +33,7 @@ var globs_exports = /* @__PURE__ */ __exportAll({
|
|
|
33
33
|
GLOB_CODE: () => GLOB_CODE,
|
|
34
34
|
GLOB_CSS: () => GLOB_CSS,
|
|
35
35
|
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
36
|
+
GLOB_GEOJSON: () => GLOB_GEOJSON,
|
|
36
37
|
GLOB_GRAPHQL: () => GLOB_GRAPHQL,
|
|
37
38
|
GLOB_HTML: () => GLOB_HTML,
|
|
38
39
|
GLOB_JS: () => GLOB_JS,
|
|
@@ -72,6 +73,7 @@ const GLOB_SCSS = "**/*.scss";
|
|
|
72
73
|
const GLOB_JSON = "**/*.json";
|
|
73
74
|
const GLOB_JSON5 = "**/*.json5";
|
|
74
75
|
const GLOB_JSONC = "**/*.jsonc";
|
|
76
|
+
const GLOB_GEOJSON = "**/*.geojson";
|
|
75
77
|
const GLOB_TOML = "**/*.toml";
|
|
76
78
|
const GLOB_MARKDOWN = "**/*.md";
|
|
77
79
|
const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
@@ -317,7 +319,7 @@ const parserPlain = {
|
|
|
317
319
|
};
|
|
318
320
|
function turnOffRules(configs, off, debug) {
|
|
319
321
|
if (off.length > 0) {
|
|
320
|
-
|
|
322
|
+
dbg("turning off rules: %O", off);
|
|
321
323
|
const currentlyActiveRules = /* @__PURE__ */ new Set();
|
|
322
324
|
for (const config of configs) {
|
|
323
325
|
const cfgRules = Object.keys(config.rules ?? {});
|
|
@@ -335,6 +337,7 @@ function turnOffRules(configs, off, debug) {
|
|
|
335
337
|
for (const rule of off) if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) cfgRules[rule] = "off";
|
|
336
338
|
}
|
|
337
339
|
}
|
|
340
|
+
dbg("finished turning off rules");
|
|
338
341
|
}
|
|
339
342
|
return configs;
|
|
340
343
|
}
|
|
@@ -4964,7 +4967,8 @@ const jsonc = async (options) => {
|
|
|
4964
4967
|
files: [
|
|
4965
4968
|
GLOB_JSON,
|
|
4966
4969
|
GLOB_JSON5,
|
|
4967
|
-
GLOB_JSONC
|
|
4970
|
+
GLOB_JSONC,
|
|
4971
|
+
GLOB_GEOJSON
|
|
4968
4972
|
],
|
|
4969
4973
|
ignores: ["*.min.json"],
|
|
4970
4974
|
languageOptions: { parser: parserJsonc },
|
|
@@ -5034,13 +5038,11 @@ function typescriptRulesTypeAware() {
|
|
|
5034
5038
|
}],
|
|
5035
5039
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
5036
5040
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
5037
|
-
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
|
5038
5041
|
"@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
|
|
5039
5042
|
"@typescript-eslint/no-floating-promises": ["error", {
|
|
5040
5043
|
ignoreVoid: true,
|
|
5041
5044
|
ignoreIIFE: true
|
|
5042
|
-
}]
|
|
5043
|
-
"@typescript-eslint/no-deprecated": "warn"
|
|
5045
|
+
}]
|
|
5044
5046
|
};
|
|
5045
5047
|
}
|
|
5046
5048
|
function typescriptRulesTypeOblivious() {
|
|
@@ -5156,7 +5158,8 @@ function typescriptRulesTypeOblivious() {
|
|
|
5156
5158
|
};
|
|
5157
5159
|
}
|
|
5158
5160
|
function tsPresetRules(props) {
|
|
5159
|
-
|
|
5161
|
+
const tseslintConfig = props?.typeAware ? props.strict ? tseslint.configs.strictTypeChecked : tseslint.configs.recommendedTypeChecked : props?.strict ? tseslint.configs.strict : tseslint.configs.recommended;
|
|
5162
|
+
return extractRules(tseslintConfig);
|
|
5160
5163
|
}
|
|
5161
5164
|
function typescriptRules(props) {
|
|
5162
5165
|
const normalized = {
|
|
@@ -5171,7 +5174,9 @@ function typescriptRules(props) {
|
|
|
5171
5174
|
return {
|
|
5172
5175
|
...rulesFromPreset,
|
|
5173
5176
|
...typescriptRulesTypeOblivious(),
|
|
5174
|
-
...normalized.typeAware && typescriptRulesTypeAware()
|
|
5177
|
+
...normalized.typeAware && typescriptRulesTypeAware(),
|
|
5178
|
+
...normalized.typeAware && !normalized.strict && { "@typescript-eslint/no-deprecated": "error" },
|
|
5179
|
+
...normalized.typeAware && normalized.strict && { "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: "only-allowed-literals" }] }
|
|
5175
5180
|
};
|
|
5176
5181
|
}
|
|
5177
5182
|
//#endregion
|
|
@@ -6075,6 +6080,31 @@ const yml = async (options) => {
|
|
|
6075
6080
|
}];
|
|
6076
6081
|
};
|
|
6077
6082
|
//#endregion
|
|
6083
|
+
//#region src/configs/sort-geojson.ts
|
|
6084
|
+
const sortGeojson = async () => {
|
|
6085
|
+
return [{
|
|
6086
|
+
files: [GLOB_GEOJSON, "!**/*.min.geojson"],
|
|
6087
|
+
name: "jsse/sort/geojson",
|
|
6088
|
+
rules: { "jsonc/sort-keys": ["error", {
|
|
6089
|
+
order: [
|
|
6090
|
+
"type",
|
|
6091
|
+
"id",
|
|
6092
|
+
"name",
|
|
6093
|
+
"crs",
|
|
6094
|
+
"bbox",
|
|
6095
|
+
"features",
|
|
6096
|
+
"geometry",
|
|
6097
|
+
"properties",
|
|
6098
|
+
{
|
|
6099
|
+
keyPattern: ".*",
|
|
6100
|
+
order: { type: "asc" }
|
|
6101
|
+
}
|
|
6102
|
+
],
|
|
6103
|
+
pathPattern: ".*"
|
|
6104
|
+
}] }
|
|
6105
|
+
}];
|
|
6106
|
+
};
|
|
6107
|
+
//#endregion
|
|
6078
6108
|
//#region node_modules/.pnpm/acorn@8.17.0/node_modules/acorn/dist/acorn.mjs
|
|
6079
6109
|
var astralIdentifierCodes = [
|
|
6080
6110
|
509,
|
|
@@ -11720,7 +11750,8 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
|
11720
11750
|
const format = extensionFormatMap[value];
|
|
11721
11751
|
if (format) return format;
|
|
11722
11752
|
if (ignoreErrors) return;
|
|
11723
|
-
|
|
11753
|
+
const filepath = fileURLToPath(url);
|
|
11754
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
|
|
11724
11755
|
}
|
|
11725
11756
|
function getHttpProtocolModuleFormat() {}
|
|
11726
11757
|
/**
|
|
@@ -11929,7 +11960,8 @@ function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
|
11929
11960
|
* @returns {never}
|
|
11930
11961
|
*/
|
|
11931
11962
|
function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
|
|
11932
|
-
|
|
11963
|
+
const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath(packageJsonUrl)}`;
|
|
11964
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(request, reason, base && fileURLToPath(base));
|
|
11933
11965
|
}
|
|
11934
11966
|
/**
|
|
11935
11967
|
* @param {string} subpath
|
|
@@ -12596,6 +12628,7 @@ function defaultOptions() {
|
|
|
12596
12628
|
command: true,
|
|
12597
12629
|
componentExts: [],
|
|
12598
12630
|
debug: DEBUG && process$1.env.TEST !== "true",
|
|
12631
|
+
diagnostics: true,
|
|
12599
12632
|
fast: false,
|
|
12600
12633
|
gitignore: true,
|
|
12601
12634
|
isInEditor: isInEditor(),
|
|
@@ -12609,6 +12642,7 @@ function defaultOptions() {
|
|
|
12609
12642
|
regexp: true,
|
|
12610
12643
|
reportUnusedDisableDirectives: true,
|
|
12611
12644
|
rootId: "jsse",
|
|
12645
|
+
sortGeojson: false,
|
|
12612
12646
|
sortImports: false,
|
|
12613
12647
|
sortPackageJson: true,
|
|
12614
12648
|
sortTsconfig: true,
|
|
@@ -12618,15 +12652,23 @@ function defaultOptions() {
|
|
|
12618
12652
|
tsPrefix: "@typescript-eslint",
|
|
12619
12653
|
typeAware: false,
|
|
12620
12654
|
typescript: typescriptExists,
|
|
12621
|
-
warnings: true,
|
|
12622
12655
|
yaml: false
|
|
12623
12656
|
};
|
|
12624
12657
|
}
|
|
12625
|
-
function
|
|
12626
|
-
const
|
|
12658
|
+
function normalizeOff(off) {
|
|
12659
|
+
const offArr = [...off instanceof Set ? off : new Set(off)].sort((a, b) => a.localeCompare(b, void 0, {
|
|
12627
12660
|
numeric: true,
|
|
12628
12661
|
sensitivity: "base"
|
|
12629
12662
|
}));
|
|
12663
|
+
const offSet = off instanceof Set ? off : new Set(off);
|
|
12664
|
+
if (offArr.length !== offSet.size && offArr.length > 1) {
|
|
12665
|
+
for (let i = 1; i < offArr.length; i++) if (offArr[i] === offArr[i - 1]) warn(`Duplicate rule "${offArr[i]}" found in the "off" array`);
|
|
12666
|
+
}
|
|
12667
|
+
return offArr;
|
|
12668
|
+
}
|
|
12669
|
+
function normalizeOptions(options = {}) {
|
|
12670
|
+
const configuredOff = normalizeOff(options.off ?? []);
|
|
12671
|
+
const off = options.fast ? normalizeOff(/* @__PURE__ */ new Set([...configuredOff, ...SLOW_RULES])) : configuredOff;
|
|
12630
12672
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? { ...options.stylistic } : {};
|
|
12631
12673
|
if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = options.jsx ?? true;
|
|
12632
12674
|
const defaults = defaultOptions();
|
|
@@ -12698,7 +12740,7 @@ const FLAT_CFG_PROPS = [
|
|
|
12698
12740
|
*/
|
|
12699
12741
|
async function jsse(options = {}, ...userConfigs) {
|
|
12700
12742
|
const normalizedOptions = normalizeOptions(options);
|
|
12701
|
-
const { command: enableCommand, componentExts, debug = false, gitignore: enableGitignore, isInEditor, jsonc: enableJsonc, markdown: enableMarkdown, off, overrides = {}, pnpm: enablePnpm, prettier: enablePrettier, react: enableReact, regexp: enableRegexp, reportUnusedDisableDirectives, rootId, sortImports: enableSortImports, sortPackageJson: enableSortPackageJson, sortTsconfig: enableSortTsconfig, stylistic: stylisticOptions, tailwind: tailwindOptions, test: enableTest, tsPrefix, typescript: typescriptOptions, yaml: enableYaml } = normalizedOptions;
|
|
12743
|
+
const { command: enableCommand, componentExts, debug = false, gitignore: enableGitignore, isInEditor, jsonc: enableJsonc, markdown: enableMarkdown, off, overrides = {}, pnpm: enablePnpm, 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, yaml: enableYaml } = normalizedOptions;
|
|
12702
12744
|
if (debug || process$1.argv.includes("--debug")) enableDbg();
|
|
12703
12745
|
dbg("@jsse/eslint-config debug=true");
|
|
12704
12746
|
dbg("@jsse/eslint-config isInEditor: %O", isInEditor);
|
|
@@ -12780,6 +12822,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12780
12822
|
}));
|
|
12781
12823
|
if (enableSortPackageJson) configs.push(sortPackageJson());
|
|
12782
12824
|
if (enableSortTsconfig) configs.push(sortTsconfig({ extendTsconfigGlobs: normalizedOptions.extendTsconfigLintGlobs }));
|
|
12825
|
+
if (enableSortGeojson) configs.push(sortGeojson());
|
|
12783
12826
|
}
|
|
12784
12827
|
if (tailwindOptions) console.error("Tailwind configuration is deprecated...");
|
|
12785
12828
|
const fusedConfig = FLAT_CFG_PROPS.reduce((acc, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/cli.ts","../src/config-
|
|
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/presets.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.6",
|
|
5
5
|
"description": "@jsse/eslint-config ~ WYSIWYG",
|
|
6
6
|
"author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
],
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
39
|
-
"@vitest/eslint-plugin": "^1.6.20",
|
|
40
39
|
"eslint": "^10.5.0",
|
|
41
40
|
"eslint-plugin-react": "^7.37.5",
|
|
42
41
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
@@ -46,9 +45,6 @@
|
|
|
46
45
|
"@eslint-react/eslint-plugin": {
|
|
47
46
|
"optional": true
|
|
48
47
|
},
|
|
49
|
-
"@vitest/eslint-plugin": {
|
|
50
|
-
"optional": true
|
|
51
|
-
},
|
|
52
48
|
"eslint": {
|
|
53
49
|
"optional": false
|
|
54
50
|
},
|
|
@@ -66,11 +62,12 @@
|
|
|
66
62
|
"@e18e/eslint-plugin": "^0.5.1",
|
|
67
63
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
68
64
|
"@eslint/js": "^10.0.1",
|
|
69
|
-
"@eslint/markdown": "^8.0.
|
|
65
|
+
"@eslint/markdown": "^8.0.3",
|
|
70
66
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
71
67
|
"@typescript-eslint/eslint-plugin": "^8.62.1",
|
|
72
68
|
"@typescript-eslint/parser": "^8.62.1",
|
|
73
69
|
"@typescript-eslint/rule-tester": "^8.62.1",
|
|
70
|
+
"@vitest/eslint-plugin": "^1.6.20",
|
|
74
71
|
"debug": "^4.4.3",
|
|
75
72
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
76
73
|
"eslint-merge-processors": "^2.0.0",
|
|
@@ -93,7 +90,7 @@
|
|
|
93
90
|
"eslint-plugin-yml": "^3.5.0",
|
|
94
91
|
"jsonc-eslint-parser": "^3.1.0",
|
|
95
92
|
"toml-eslint-parser": "^1.0.3",
|
|
96
|
-
"typescript-eslint": "^8.62.
|
|
93
|
+
"typescript-eslint": "^8.62.1",
|
|
97
94
|
"yaml-eslint-parser": "^2.0.0"
|
|
98
95
|
},
|
|
99
96
|
"devDependencies": {
|
|
@@ -114,14 +111,14 @@
|
|
|
114
111
|
"execa": "~9.6.1",
|
|
115
112
|
"fast-equals": "^6.0.0",
|
|
116
113
|
"fast-glob": "^3.3.3",
|
|
117
|
-
"fs-extra": "^11.3.
|
|
114
|
+
"fs-extra": "^11.3.6",
|
|
118
115
|
"globals": "^17.7.0",
|
|
119
116
|
"knip": "^6.23.0",
|
|
120
117
|
"local-pkg": "^1.2.1",
|
|
121
|
-
"oxfmt": "^0.
|
|
122
|
-
"oxlint": "^1.
|
|
118
|
+
"oxfmt": "^0.57.0",
|
|
119
|
+
"oxlint": "^1.72.0",
|
|
123
120
|
"picocolors": "^1.1.1",
|
|
124
|
-
"prettier": "^3.9.
|
|
121
|
+
"prettier": "^3.9.4",
|
|
125
122
|
"publint": "^0.3.21",
|
|
126
123
|
"react": "~19.2.7",
|
|
127
124
|
"rimraf": "^6.1.3",
|