@isentinel/eslint-config 6.0.0-beta.44 → 6.0.0-beta.45
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/dist/cli.mjs +1 -1
- package/dist/index.mjs +116 -8
- package/dist/lint-cli.mjs +1 -1
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import path from "node:path";
|
|
|
9
9
|
import { existsSync, readFileSync } from "fs";
|
|
10
10
|
import { execSync } from "node:child_process";
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "6.0.0-beta.
|
|
12
|
+
var version = "6.0.0-beta.45";
|
|
13
13
|
var package_default = {
|
|
14
14
|
name: "@isentinel/eslint-config",
|
|
15
15
|
version,
|
package/dist/index.mjs
CHANGED
|
@@ -3932,6 +3932,7 @@ async function pnpm(options) {
|
|
|
3932
3932
|
"pnpm/yaml-enforce-settings": ["error", { settings: {
|
|
3933
3933
|
catalogMode: "prefer",
|
|
3934
3934
|
cleanupUnusedCatalogs: true,
|
|
3935
|
+
minimumReleaseAgeExcludePrune: true,
|
|
3935
3936
|
shellEmulator: true,
|
|
3936
3937
|
trustPolicy: "no-downgrade",
|
|
3937
3938
|
trustPolicyIgnoreAfter: 10080
|
|
@@ -4907,6 +4908,7 @@ function sortPnpmWorkspace() {
|
|
|
4907
4908
|
"blockExoticSubdeps",
|
|
4908
4909
|
"cacheDir",
|
|
4909
4910
|
"catalogMode",
|
|
4911
|
+
"catalogPrune",
|
|
4910
4912
|
"cleanupUnusedCatalogs",
|
|
4911
4913
|
"dedupeDirectDeps",
|
|
4912
4914
|
"dedupePeerDependents",
|
|
@@ -4916,6 +4918,7 @@ function sortPnpmWorkspace() {
|
|
|
4916
4918
|
"enablePrePostScripts",
|
|
4917
4919
|
"engineStrict",
|
|
4918
4920
|
"extendNodePath",
|
|
4921
|
+
"globalShims",
|
|
4919
4922
|
"hoist",
|
|
4920
4923
|
"hoistPattern",
|
|
4921
4924
|
"hoistWorkspacePackages",
|
|
@@ -4931,6 +4934,7 @@ function sortPnpmWorkspace() {
|
|
|
4931
4934
|
"managePackageManagerVersions",
|
|
4932
4935
|
"minimumReleaseAge",
|
|
4933
4936
|
"minimumReleaseAgeExclude",
|
|
4937
|
+
"minimumReleaseAgeExcludePrune",
|
|
4934
4938
|
"minimumReleaseAgeIgnoreMissingTime",
|
|
4935
4939
|
"minimumReleaseAgeStrict",
|
|
4936
4940
|
"modulesDir",
|
|
@@ -4953,6 +4957,7 @@ function sortPnpmWorkspace() {
|
|
|
4953
4957
|
"shamefullyHoist",
|
|
4954
4958
|
"sharedWorkspaceLockfile",
|
|
4955
4959
|
"shellEmulator",
|
|
4960
|
+
"sideEffectsCache",
|
|
4956
4961
|
"stateDir",
|
|
4957
4962
|
"strictDepBuilds",
|
|
4958
4963
|
"strictPeerDependencies",
|
|
@@ -4965,7 +4970,8 @@ function sortPnpmWorkspace() {
|
|
|
4965
4970
|
"trustPolicyIgnoreAfter",
|
|
4966
4971
|
"updateConfig",
|
|
4967
4972
|
"updateNotifier",
|
|
4968
|
-
"verifyDepsBeforeRun"
|
|
4973
|
+
"verifyDepsBeforeRun",
|
|
4974
|
+
"virtualStoreType"
|
|
4969
4975
|
],
|
|
4970
4976
|
...[
|
|
4971
4977
|
"gitBranchLockfile",
|
|
@@ -4992,7 +4998,8 @@ function sortPnpmWorkspace() {
|
|
|
4992
4998
|
"onlyBuiltDependencies",
|
|
4993
4999
|
"onlyBuiltDependenciesFile",
|
|
4994
5000
|
"packageExtensions",
|
|
4995
|
-
"peerDependencyRules"
|
|
5001
|
+
"peerDependencyRules",
|
|
5002
|
+
"tasks"
|
|
4996
5003
|
],
|
|
4997
5004
|
{ order: { type: "asc" } }
|
|
4998
5005
|
],
|
|
@@ -5017,7 +5024,7 @@ function sortPnpmWorkspace() {
|
|
|
5017
5024
|
natural: true,
|
|
5018
5025
|
type: "asc"
|
|
5019
5026
|
},
|
|
5020
|
-
pathPattern: "^(supportedArchitectures\\.(cpu|libc|os)|updateConfig\\.ignoreDependencies|peerDependencyRules\\.(allowAny|ignoreMissing)|auditConfig\\.(ignoreCves|ignoreGhsas))$"
|
|
5027
|
+
pathPattern: "^(supportedArchitectures\\.(cpu|libc|os)|update\\.ignoreDeps|updateConfig\\.ignoreDependencies|peerDependencyRules\\.(allowAny|ignoreMissing)|audit\\.ignore|auditConfig\\.(ignoreCves|ignoreGhsas)|sideEffectsCache\\.remote\\.packages|tasks\\.[^.]+\\.dependsOn)$"
|
|
5021
5028
|
}
|
|
5022
5029
|
]
|
|
5023
5030
|
}
|
|
@@ -19839,8 +19846,10 @@ var oxlint_drop_exports = /* @__PURE__ */ __exportAll$2({
|
|
|
19839
19846
|
* Warn when a user-supplied config references a rule that oxlint owns in hybrid
|
|
19840
19847
|
* mode (`oxlint: true`). The preset drops every oxlint-covered rule from the
|
|
19841
19848
|
* ESLint side and lets oxlint format real JS/TS files, so such entries silently
|
|
19842
|
-
* do nothing.
|
|
19843
|
-
* virtual files, so the preset re-enables those
|
|
19849
|
+
* do nothing. Configs oxlint cannot reach are exempt: Markdown-scoped ones
|
|
19850
|
+
* (oxlint cannot lint Markdown virtual files, so the preset re-enables those
|
|
19851
|
+
* rules there) and ones scoped to a non-JS/TS language, which oxlint never
|
|
19852
|
+
* parses.
|
|
19844
19853
|
*
|
|
19845
19854
|
* @param configs - The resolved flat config items.
|
|
19846
19855
|
* @param mode - The hybrid mode; in `native` mode jsPlugin rules and formatting
|
|
@@ -19870,6 +19879,11 @@ function warnMissingTsgolint() {
|
|
|
19870
19879
|
* sibling is inserted directly after the original so later configs (for
|
|
19871
19880
|
* example the markdown disables) still take precedence.
|
|
19872
19881
|
*
|
|
19882
|
+
* Configs scoped to a language oxlint does not parse are skipped outright: it
|
|
19883
|
+
* reads only the JS/TS family, so handing it `oxfmt/oxfmt` for YAML, JSON, CSS
|
|
19884
|
+
* or GraphQL would drop the formatter from ESLint without any engine picking it
|
|
19885
|
+
* up. See {@link targetsJsOrTs}.
|
|
19886
|
+
*
|
|
19873
19887
|
* @param configs - The resolved flat config items (mutated in place).
|
|
19874
19888
|
* @param typeAware - Whether oxlint runs type-aware (oxlint-tsgolint present).
|
|
19875
19889
|
* When `false`, tsgolint rules are kept in ESLint so they do not vanish from
|
|
@@ -19879,7 +19893,7 @@ function warnMissingTsgolint() {
|
|
|
19879
19893
|
function dropOxlintCoveredRules(configs, typeAware = true, mode = "full") {
|
|
19880
19894
|
for (let index = 0; index < configs.length; index += 1) {
|
|
19881
19895
|
const config = configs[index];
|
|
19882
|
-
if (config?.name === void 0 || !config.name.startsWith("isentinel/") || config.name.endsWith("/markdown-code") || config.rules === void 0 || targetsMarkdown(config.files)) continue;
|
|
19896
|
+
if (config?.name === void 0 || !config.name.startsWith("isentinel/") || config.name.endsWith("/markdown-code") || config.rules === void 0 || targetsMarkdown(config.files) || !targetsJsOrTs(config.files)) continue;
|
|
19883
19897
|
const dropped = dropCoveredRulesFromConfig(config.rules, typeAware, mode);
|
|
19884
19898
|
if (Object.keys(dropped).length === 0) continue;
|
|
19885
19899
|
if ((config.ignores ?? []).some((pattern) => typeof pattern === "string" && pattern.includes(".md/"))) continue;
|
|
@@ -19928,10 +19942,98 @@ function targetsMarkdown(files) {
|
|
|
19928
19942
|
const patterns = files.flat();
|
|
19929
19943
|
return patterns.length > 0 && patterns.every((pattern) => typeof pattern === "string" && pattern.includes(".md"));
|
|
19930
19944
|
}
|
|
19945
|
+
/**
|
|
19946
|
+
* The strings one part of a {@link GLOB_GROUP_SPLIT} split can stand for: the
|
|
19947
|
+
* comma-separated members of a brace group, the individual characters of a
|
|
19948
|
+
* bracket group, or the literal text itself. A part that still holds a group
|
|
19949
|
+
* delimiter is a nested or unterminated group, which is not expanded.
|
|
19950
|
+
*
|
|
19951
|
+
* @param part - One part of a glob fragment split on its groups.
|
|
19952
|
+
* @returns The alternatives, or `undefined` when the part is not expandable.
|
|
19953
|
+
*/
|
|
19954
|
+
function groupAlternatives(part) {
|
|
19955
|
+
const body = part.slice(1, -1);
|
|
19956
|
+
if (part.startsWith("{")) return body.split(",");
|
|
19957
|
+
if (part.startsWith("[")) return body.match(GLOB_ANY_CHARACTER) ?? [];
|
|
19958
|
+
return GLOB_GROUP_DELIMITER.test(part) ? void 0 : [part];
|
|
19959
|
+
}
|
|
19960
|
+
/**
|
|
19961
|
+
* Expand the brace and character-class alternatives of a glob fragment.
|
|
19962
|
+
*
|
|
19963
|
+
* Only the closed forms the preset's globs use are handled (`{,c,m}`, `[jt]`);
|
|
19964
|
+
* anything with a wildcard, a nested group or an unterminated group yields
|
|
19965
|
+
* `undefined`, meaning "could be anything". Callers treat that as a match, so
|
|
19966
|
+
* an unknown pattern keeps the pre-existing drop behavior.
|
|
19967
|
+
*
|
|
19968
|
+
* @param fragment - The glob fragment to expand.
|
|
19969
|
+
* @returns Every literal string the fragment can produce, or `undefined` when
|
|
19970
|
+
* the fragment is not a closed set of literals.
|
|
19971
|
+
*/
|
|
19972
|
+
function expandGlobAlternatives(fragment) {
|
|
19973
|
+
if (GLOB_WILDCARD.test(fragment)) return;
|
|
19974
|
+
let results = [""];
|
|
19975
|
+
for (const part of fragment.split(GLOB_GROUP_SPLIT)) {
|
|
19976
|
+
const alternatives = groupAlternatives(part);
|
|
19977
|
+
if (alternatives === void 0) return;
|
|
19978
|
+
results = results.flatMap((prefix) => {
|
|
19979
|
+
return alternatives.map((alternative) => prefix + alternative);
|
|
19980
|
+
});
|
|
19981
|
+
}
|
|
19982
|
+
return results;
|
|
19983
|
+
}
|
|
19984
|
+
/**
|
|
19985
|
+
* The index of the extension dot in a glob's last path segment, or `-1` when it
|
|
19986
|
+
* has none. Dots inside a brace or bracket group are masked out first: they
|
|
19987
|
+
* belong to an alternative, not to the extension boundary.
|
|
19988
|
+
*
|
|
19989
|
+
* @param segment - The last path segment of a `files` pattern.
|
|
19990
|
+
* @returns The index of the extension dot, or `-1`.
|
|
19991
|
+
*/
|
|
19992
|
+
function extensionDotIndex(segment) {
|
|
19993
|
+
return segment.replaceAll(GLOB_GROUP, (group) => "\0".repeat(group.length)).lastIndexOf(".");
|
|
19994
|
+
}
|
|
19995
|
+
/**
|
|
19996
|
+
* Whether a single `files` pattern can match a file oxlint reads.
|
|
19997
|
+
*
|
|
19998
|
+
* Oxlint parses only the JS/TS family, so a pattern whose extension is a closed
|
|
19999
|
+
* set of non-JS/TS extensions (`**\/*.y{,a}ml`, `**\/*.json{,5,c}`) describes
|
|
20000
|
+
* files oxlint never sees. A pattern whose last segment has no extension, or
|
|
20001
|
+
* whose extension is not a closed set, matches conservatively.
|
|
20002
|
+
*
|
|
20003
|
+
* @param pattern - The `files` pattern to classify.
|
|
20004
|
+
* @returns Whether oxlint can lint something the pattern matches.
|
|
20005
|
+
*/
|
|
20006
|
+
function patternTargetsJsOrTs(pattern) {
|
|
20007
|
+
const segment = pattern.slice(pattern.lastIndexOf("/") + 1);
|
|
20008
|
+
const dot = extensionDotIndex(segment);
|
|
20009
|
+
if (dot === -1) return true;
|
|
20010
|
+
const extensions = expandGlobAlternatives(segment.slice(dot + 1));
|
|
20011
|
+
if (extensions === void 0) return true;
|
|
20012
|
+
return extensions.some((extension) => JS_TS_EXTENSIONS.has(extension));
|
|
20013
|
+
}
|
|
20014
|
+
/**
|
|
20015
|
+
* Whether a config's `files` reach any file oxlint can lint.
|
|
20016
|
+
*
|
|
20017
|
+
* Hybrid mode only hands a rule to oxlint for the files oxlint actually parses.
|
|
20018
|
+
* A config scoped to YAML, JSON, CSS or GraphQL is invisible to oxlint, so its
|
|
20019
|
+
* rules must stay in ESLint or they run in neither engine — the case that
|
|
20020
|
+
* silently dropped `oxfmt/oxfmt` from every non-JS formatting config.
|
|
20021
|
+
*
|
|
20022
|
+
* @param files - The config's `files` patterns; nested arrays are AND-combined,
|
|
20023
|
+
* so they only reach JS/TS when every member does.
|
|
20024
|
+
* @returns Whether oxlint can lint something the config targets.
|
|
20025
|
+
*/
|
|
20026
|
+
function targetsJsOrTs(files) {
|
|
20027
|
+
if (files === void 0 || files.length === 0) return true;
|
|
20028
|
+
return files.some((entry) => {
|
|
20029
|
+
if (typeof entry === "string") return patternTargetsJsOrTs(entry);
|
|
20030
|
+
return entry.every((pattern) => patternTargetsJsOrTs(pattern));
|
|
20031
|
+
});
|
|
20032
|
+
}
|
|
19931
20033
|
function findDeadMappedRules(configs, mode) {
|
|
19932
20034
|
const references = [];
|
|
19933
20035
|
for (const config of configs) {
|
|
19934
|
-
if (config.rules === void 0 || isPresetConfig(config) || targetsMarkdown(config.files)) continue;
|
|
20036
|
+
if (config.rules === void 0 || isPresetConfig(config) || targetsMarkdown(config.files) || !targetsJsOrTs(config.files)) continue;
|
|
19935
20037
|
const label = describeConfig(config);
|
|
19936
20038
|
for (const [rule, value] of Object.entries(config.rules)) if (value !== void 0 && (presetHandsRuleToOxlint(rule, mode) || mode === "full" && HYBRID_FORMATTING_RULES.has(rule))) references.push({
|
|
19937
20039
|
config: label,
|
|
@@ -19992,11 +20094,17 @@ function markdownVirtualFiles(files) {
|
|
|
19992
20094
|
return [GLOB_MARKDOWN_CODE, ...[pattern].flat()];
|
|
19993
20095
|
});
|
|
19994
20096
|
}
|
|
19995
|
-
var HYBRID_FORMATTING_RULES;
|
|
20097
|
+
var HYBRID_FORMATTING_RULES, JS_TS_EXTENSIONS, GLOB_WILDCARD, GLOB_GROUP, GLOB_GROUP_SPLIT, GLOB_GROUP_DELIMITER, GLOB_ANY_CHARACTER;
|
|
19996
20098
|
var init_oxlint_drop = __esmMin((() => {
|
|
19997
20099
|
init_globs();
|
|
19998
20100
|
init_routing();
|
|
19999
20101
|
HYBRID_FORMATTING_RULES = /* @__PURE__ */ new Set(["oxfmt/oxfmt"]);
|
|
20102
|
+
JS_TS_EXTENSIONS = new Set(GLOB_SRC_EXTENSIONS);
|
|
20103
|
+
GLOB_WILDCARD = /[*?]/;
|
|
20104
|
+
GLOB_GROUP = /\{[^{}]*\}|\[[^[\]]*\]/gu;
|
|
20105
|
+
GLOB_GROUP_SPLIT = /(\{[^{}]*\}|\[[^[\]]*\])/u;
|
|
20106
|
+
GLOB_GROUP_DELIMITER = /[{}[\]]/u;
|
|
20107
|
+
GLOB_ANY_CHARACTER = /./gu;
|
|
20000
20108
|
}));
|
|
20001
20109
|
//#endregion
|
|
20002
20110
|
//#region src/eslint/factory.ts
|
package/dist/lint-cli.mjs
CHANGED
|
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
}) : target, mod));
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region package.json
|
|
41
|
-
var version = "6.0.0-beta.
|
|
41
|
+
var version = "6.0.0-beta.45";
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/lint-cli/lib/cli/types.ts
|
|
44
44
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/eslint-config",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.45",
|
|
4
4
|
"description": "iSentinel's ESLint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint-config",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"typescript": "6.0.3",
|
|
146
146
|
"unplugin-unused": "0.5.7",
|
|
147
147
|
"vitest": "4.1.10",
|
|
148
|
-
"@isentinel/eslint-config": "6.0.0-beta.
|
|
148
|
+
"@isentinel/eslint-config": "6.0.0-beta.45"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
151
|
"@vitest/eslint-plugin": "^1.6.4",
|