@stll/oxlint-config 0.15.0 → 1.0.1

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.
@@ -1,4 +1,4 @@
1
- import { d as isKubernetesDefinitionPath, f as workspaceContains, i as isMiseConfigPath, l as containerDocumentImages, r as isDockerDefinitionPath, t as githubAutomationFileKind, u as isComposeDefinitionPath } from "./toolchain-inputs.mjs";
1
+ import { d as isComposeDefinitionPath, f as isKubernetesDefinitionPath, i as isMiseConfigPath, p as workspaceContains, r as isDockerDefinitionPath, t as githubAutomationFileKind, u as containerDocumentImages } from "./toolchain-inputs.mjs";
2
2
  import { n as isCompilerPackage } from "./compiler-packages.mjs";
3
3
  import { execFile, spawn } from "node:child_process";
4
4
  import path from "node:path";
@@ -914,14 +914,9 @@ const stableVersion = (value) => {
914
914
  if (!/^\d+\.\d+\.\d+$/.test(version) || valid(version) !== version) throw new Error("Runtime selector is not an exact stable version");
915
915
  return version;
916
916
  };
917
- const setupRuntimeVersion = ({ value, runtime }) => {
917
+ const setupRuntimeVersion = (value) => {
918
918
  if (typeof value !== "string" && typeof value !== "number") throw new Error("Unclassifiable setup runtime selector");
919
919
  const selector = String(value).trim();
920
- if (runtime === "rust" && /^nightly-\d{4}-\d{2}-\d{2}$/.test(selector)) {
921
- const date = selector.slice(8);
922
- if (new Date(date).toISOString().slice(0, 10) !== date) throw new Error("Invalid dated Rust toolchain");
923
- return selector;
924
- }
925
920
  return stableVersion(selector);
926
921
  };
927
922
  const setupRuntimeFileVersion = ({ snapshot, file, runtime }) => {
@@ -950,20 +945,11 @@ const setupRuntimeFileVersion = ({ snapshot, file, runtime }) => {
950
945
  if (file.endsWith(".toml")) {
951
946
  const value = parse$2(text);
952
947
  if (!changedRecord(value)) throw new Error("Unclassifiable setup runtime TOML");
953
- if (runtime === "rust" && changedRecord(value["toolchain"])) return setupRuntimeVersion({
954
- value: value["toolchain"]["channel"],
955
- runtime
956
- });
957
- if (runtime === "python") return setupRuntimeVersion({
958
- value: value["python-version"],
959
- runtime
960
- });
948
+ if (runtime === "rust" && changedRecord(value["toolchain"])) return setupRuntimeVersion(value["toolchain"]["channel"]);
949
+ if (runtime === "python") return setupRuntimeVersion(value["python-version"]);
961
950
  throw new Error("Unclassifiable setup runtime TOML");
962
951
  }
963
- return setupRuntimeVersion({
964
- value: text,
965
- runtime
966
- });
952
+ return setupRuntimeVersion(text);
967
953
  };
968
954
  const setupRuntimeVersions = (snapshot) => {
969
955
  const versions = [];
@@ -1021,10 +1007,7 @@ const setupRuntimeVersions = (snapshot) => {
1021
1007
  file: path.posix.normalize(input),
1022
1008
  runtime: inputRuntime
1023
1009
  });
1024
- } else version = setupRuntimeVersion({
1025
- value: input,
1026
- runtime: inputRuntime
1027
- });
1010
+ } else version = setupRuntimeVersion(input);
1028
1011
  versions.push({
1029
1012
  file,
1030
1013
  runtime: inputRuntime,