@antelopejs/tooling-configs 0.7.1 → 0.7.3

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,3 +1,3 @@
1
1
  import { n as TEST_FILE_GLOBS, t as ASSERTION_FUNCTION_NAMES } from "../../shared-WC0z3y9F.mjs";
2
- import { t as guardrailsPlugin } from "../../guardrails-6i82vsUi.mjs";
2
+ import { t as guardrailsPlugin } from "../../guardrails-nj7NTglr.mjs";
3
3
  export { ASSERTION_FUNCTION_NAMES, TEST_FILE_GLOBS, guardrailsPlugin as default };
@@ -144,6 +144,7 @@ declare function antelopePreset(options?: AntelopePresetOptions): {
144
144
  rules: {
145
145
  [k: string]: "error" | ["error", {
146
146
  checkUnknown: boolean;
147
+ ignoredTypeNames: string[];
147
148
  }];
148
149
  };
149
150
  } | {
package/dist/oxc/lint.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { i as findGitRoot } from "../ceilings-B7KayYIG.mjs";
2
2
  import { t as readCarriedCeilings } from "../renames-L2owF5GD.mjs";
3
3
  import { t as PRESET_CONFIGS } from "../templates-HG0fel2S.mjs";
4
- import { n as typeAwareRuleSetting, t as TYPE_AWARE_RULES } from "../type-aware-rules-Da3769fI.mjs";
4
+ import { n as typeAwareRuleSetting, t as TYPE_AWARE_RULES } from "../type-aware-rules-BxhHbizU.mjs";
5
5
  import { n as TEST_FILE_GLOBS, t as ASSERTION_FUNCTION_NAMES } from "../shared-WC0z3y9F.mjs";
6
6
  import { n as IGNORE_PATTERNS, r as SYNCED_AGENT_PATTERNS } from "../shared-BCFFyp3l.mjs";
7
7
  import { defineConfig } from "oxlint";
@@ -0,0 +1,40 @@
1
+ import { t as runCommand } from "./run-command-BlFRPORx.mjs";
2
+ //#region src/guardrails/pack-tarball.ts
3
+ /** The flag that stops `pack` from running lifecycle scripts, by package manager. */
4
+ const IGNORE_SCRIPTS = {
5
+ pnpm: "--config.ignore-scripts=true",
6
+ npm: "--ignore-scripts"
7
+ };
8
+ /**
9
+ * The arguments to `manager` that pack the package in the working directory into `destination`, in order: its `prepack`
10
+ * through `<manager> run`, which uses the configured script shell, then `<manager> pack` with lifecycle scripts off,
11
+ * since `pnpm pack` runs them through cmd.exe on Windows whatever the script shell, so a POSIX `prepare` fails there.
12
+ * Stop at the first that fails.
13
+ */
14
+ function packSteps(manager, destination) {
15
+ return [[
16
+ "run",
17
+ "--if-present",
18
+ "prepack"
19
+ ], [
20
+ "pack",
21
+ IGNORE_SCRIPTS[manager],
22
+ "--pack-destination",
23
+ destination
24
+ ]];
25
+ }
26
+ /** Packs the package in `cwd` into `destination` through {@link packSteps}. Returns the first failed command, else the pack. */
27
+ async function packTarball(manager, cwd, destination, signal) {
28
+ const [prepackArgs, packArgs] = packSteps(manager, destination);
29
+ const prepack = await runCommand(manager, prepackArgs, {
30
+ cwd,
31
+ signal
32
+ });
33
+ if (prepack.status !== 0) return prepack;
34
+ return runCommand(manager, packArgs, {
35
+ cwd,
36
+ signal
37
+ });
38
+ }
39
+ //#endregion
40
+ export { packTarball as n, packSteps as t };
@@ -29,10 +29,23 @@ const TYPE_AWARE_RULES = [
29
29
  /**
30
30
  * The setting a type-aware rule runs at. `no-base-to-string` pins
31
31
  * `checkUnknown: false`, typescript-eslint's default, so `String(value)` on an
32
- * `unknown` stays allowed if a release changes that default.
32
+ * `unknown` stays allowed if a release changes that default. It adds `{}` to
33
+ * the default `ignoredTypeNames`, so the same call stays allowed once `null`
34
+ * and `undefined` checks narrow the `unknown` to `{}`. Every other value typed
35
+ * `{}` is skipped too: one declared `{}`, the empty literal, a `T extends {}`,
36
+ * a union holding `{}`, and a `NonNullable<T>` or `T & {}` over a generic.
33
37
  */
34
38
  function typeAwareRuleSetting(rule) {
35
- return rule === "no-base-to-string" ? ["error", { checkUnknown: false }] : "error";
39
+ return rule === "no-base-to-string" ? ["error", {
40
+ checkUnknown: false,
41
+ ignoredTypeNames: [
42
+ "Error",
43
+ "RegExp",
44
+ "URL",
45
+ "URLSearchParams",
46
+ "{}"
47
+ ]
48
+ }] : "error";
36
49
  }
37
50
  //#endregion
38
51
  export { typeAwareRuleSetting as n, TYPE_AWARE_RULES as t };
@@ -1,7 +1,7 @@
1
1
  import { s as parseManifest } from "./package-DDG3YH7W.mjs";
2
2
  import { n as installedCompilerDefaults, r as installedTypeScriptMajor } from "./installed-typescript-6MtIWlE4.mjs";
3
3
  import { u as trackedManifests } from "./files-C-JJhExM.mjs";
4
- import { n as workspaceDirectories, r as workspacePatterns } from "./docs-compat-CSljVi3O.mjs";
4
+ import { n as workspaceDirectories, r as workspacePatterns } from "./docs-compat-BAZiPLZt.mjs";
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
6
  import { dirname, join, matchesGlob, relative, resolve, sep } from "node:path";
7
7
  import ts from "@typescript/typescript6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/tooling-configs",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Shared tooling presets for AntelopeJS repositories: oxlint (with the vendored anti-slop rules), oxfmt, ESLint for Nuxt layers, Knip, and a dependency range check",
5
5
  "keywords": [
6
6
  "antelopejs",