From ad1ccd671bb9925f87e7e4067757a44291474e74 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 3 May 2026 15:11:57 +0100 Subject: [PATCH] chore: move oxlint tsconfigs under config --- config/tsconfig/oxlint.core.json | 5 +++++ config/tsconfig/oxlint.extensions.json | 10 ++++++++++ config/tsconfig/oxlint.json | 11 +++++++++++ config/tsconfig/oxlint.scripts.json | 5 +++++ package.json | 6 +++--- scripts/lib/local-heavy-check-runtime.mjs | 2 +- scripts/run-oxlint-shards.mjs | 6 +++--- test/scripts/local-heavy-check-runtime.test.ts | 8 ++++---- test/scripts/oxlint-config.test.ts | 10 +++++----- test/scripts/run-oxlint.test.ts | 4 ++-- 10 files changed, 49 insertions(+), 18 deletions(-) create mode 100644 config/tsconfig/oxlint.core.json create mode 100644 config/tsconfig/oxlint.extensions.json create mode 100644 config/tsconfig/oxlint.json create mode 100644 config/tsconfig/oxlint.scripts.json diff --git a/config/tsconfig/oxlint.core.json b/config/tsconfig/oxlint.core.json new file mode 100644 index 00000000000..aa2826c5a79 --- /dev/null +++ b/config/tsconfig/oxlint.core.json @@ -0,0 +1,5 @@ +{ + "extends": "../../tsconfig.json", + "include": ["../../src/**/*", "../../ui/**/*", "../../packages/**/*"], + "exclude": ["../../node_modules", "../../dist", "../../dist-runtime"] +} diff --git a/config/tsconfig/oxlint.extensions.json b/config/tsconfig/oxlint.extensions.json new file mode 100644 index 00000000000..e95536c84bb --- /dev/null +++ b/config/tsconfig/oxlint.extensions.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "include": [ + "../../src/**/*", + "../../ui/src/**/*", + "../../packages/**/*.ts", + "../../extensions/**/*" + ], + "exclude": ["../../node_modules", "../../dist", "../../dist-runtime"] +} diff --git a/config/tsconfig/oxlint.json b/config/tsconfig/oxlint.json new file mode 100644 index 00000000000..c0a1d04b737 --- /dev/null +++ b/config/tsconfig/oxlint.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "include": [ + "../../src/**/*", + "../../ui/**/*", + "../../packages/**/*", + "../../extensions/**/*", + "../../scripts/**/*" + ], + "exclude": ["../../node_modules", "../../dist", "../../dist-runtime"] +} diff --git a/config/tsconfig/oxlint.scripts.json b/config/tsconfig/oxlint.scripts.json new file mode 100644 index 00000000000..5f6f6bd8c02 --- /dev/null +++ b/config/tsconfig/oxlint.scripts.json @@ -0,0 +1,5 @@ +{ + "extends": "../../tsconfig.json", + "include": ["../../src/**/*.d.ts", "../../packages/**/*.d.ts", "../../scripts/**/*"], + "exclude": ["../../node_modules", "../../dist", "../../dist-runtime"] +} diff --git a/package.json b/package.json index 85156ff10b0..9224910fe04 100644 --- a/package.json +++ b/package.json @@ -1401,11 +1401,11 @@ "lint:apps": "pnpm lint:swift", "lint:auth:no-pairing-store-group": "node scripts/check-no-pairing-store-group-auth.mjs", "lint:auth:pairing-account-scope": "node scripts/check-pairing-account-scope.mjs", - "lint:core": "node scripts/run-oxlint.mjs --tsconfig tsconfig.oxlint.core.json src ui packages", + "lint:core": "node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src ui packages", "lint:docker-e2e": "node scripts/check-docker-e2e-boundaries.mjs", "lint:docs": "pnpm dlx --config.resolution-mode=highest markdownlint-cli2 --config config/markdownlint-cli2.jsonc", "lint:docs:fix": "pnpm dlx --config.resolution-mode=highest markdownlint-cli2 --config config/markdownlint-cli2.jsonc --fix", - "lint:extensions": "node scripts/run-oxlint.mjs --tsconfig tsconfig.oxlint.extensions.json extensions", + "lint:extensions": "node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions", "lint:extensions:bundled": "node scripts/run-bundled-extension-oxlint.mjs", "lint:extensions:channels": "node scripts/run-extension-channel-oxlint.mjs", "lint:extensions:no-guarded-wildcard-reexports": "node scripts/check-extension-wildcard-reexports.mjs", @@ -1420,7 +1420,7 @@ "lint:plugins:no-monolithic-plugin-sdk-entry-imports": "node --import tsx scripts/check-no-monolithic-plugin-sdk-entry-imports.ts", "lint:plugins:no-register-http-handler": "node scripts/check-no-register-http-handler.mjs", "lint:plugins:plugin-sdk-subpaths-exported": "node scripts/check-plugin-sdk-subpath-exports.mjs", - "lint:scripts": "pnpm lint:docker-e2e && node scripts/run-oxlint.mjs --tsconfig tsconfig.oxlint.scripts.json scripts", + "lint:scripts": "pnpm lint:docker-e2e && node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts", "lint:swift": "swiftlint lint --config config/swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", "lint:tmp:channel-agnostic-boundaries": "node scripts/check-channel-agnostic-boundaries.mjs", "lint:tmp:dynamic-import-warts": "node scripts/check-dynamic-import-warts.mjs", diff --git a/scripts/lib/local-heavy-check-runtime.mjs b/scripts/lib/local-heavy-check-runtime.mjs index ddc8f0e5ebf..b7e3c3adaa8 100644 --- a/scripts/lib/local-heavy-check-runtime.mjs +++ b/scripts/lib/local-heavy-check-runtime.mjs @@ -84,7 +84,7 @@ export function applyLocalOxlintPolicy(args, env, hostResources) { const nextArgs = [...args]; insertBeforeSeparator(nextArgs, "--type-aware"); - insertBeforeSeparator(nextArgs, "--tsconfig", "tsconfig.oxlint.json"); + insertBeforeSeparator(nextArgs, "--tsconfig", "config/tsconfig/oxlint.json"); insertBeforeSeparator(nextArgs, "--allow", "eslint/no-underscore-dangle"); if ( !hasFlag(nextArgs, "--report-unused-disable-directives") && diff --git a/scripts/run-oxlint-shards.mjs b/scripts/run-oxlint-shards.mjs index 5d1fdb1c138..3be13d89142 100644 --- a/scripts/run-oxlint-shards.mjs +++ b/scripts/run-oxlint-shards.mjs @@ -23,15 +23,15 @@ if ((prepareResult.status ?? 1) !== 0) { const shards = [ { name: "core", - args: ["--tsconfig", "tsconfig.oxlint.core.json", "src", "ui", "packages"], + args: ["--tsconfig", "config/tsconfig/oxlint.core.json", "src", "ui", "packages"], }, { name: "extensions", - args: ["--tsconfig", "tsconfig.oxlint.extensions.json", "extensions"], + args: ["--tsconfig", "config/tsconfig/oxlint.extensions.json", "extensions"], }, { name: "scripts", - args: ["--tsconfig", "tsconfig.oxlint.scripts.json", "scripts"], + args: ["--tsconfig", "config/tsconfig/oxlint.scripts.json", "scripts"], }, ]; diff --git a/test/scripts/local-heavy-check-runtime.test.ts b/test/scripts/local-heavy-check-runtime.test.ts index 01e6c1b1294..1bb4621b1bd 100644 --- a/test/scripts/local-heavy-check-runtime.test.ts +++ b/test/scripts/local-heavy-check-runtime.test.ts @@ -231,7 +231,7 @@ describe("local-heavy-check-runtime", () => { expect(args).toEqual([ "--type-aware", "--tsconfig", - "tsconfig.oxlint.json", + "config/tsconfig/oxlint.json", "--allow", "eslint/no-underscore-dangle", "--report-unused-disable-directives-severity", @@ -246,7 +246,7 @@ describe("local-heavy-check-runtime", () => { expect(args).toEqual([ "--type-aware", "--tsconfig", - "tsconfig.oxlint.json", + "config/tsconfig/oxlint.json", "--allow", "eslint/no-underscore-dangle", "--report-unused-disable-directives-severity", @@ -262,7 +262,7 @@ describe("local-heavy-check-runtime", () => { "--threads=8", "--type-aware", "--tsconfig", - "tsconfig.oxlint.json", + "config/tsconfig/oxlint.json", "--allow", "eslint/no-underscore-dangle", "--report-unused-disable-directives-severity", @@ -282,7 +282,7 @@ describe("local-heavy-check-runtime", () => { expect(args).toEqual([ "--type-aware", "--tsconfig", - "tsconfig.oxlint.json", + "config/tsconfig/oxlint.json", "--allow", "eslint/no-underscore-dangle", "--report-unused-disable-directives-severity", diff --git a/test/scripts/oxlint-config.test.ts b/test/scripts/oxlint-config.test.ts index 5560cb4d066..73e3876c792 100644 --- a/test/scripts/oxlint-config.test.ts +++ b/test/scripts/oxlint-config.test.ts @@ -80,16 +80,16 @@ function readJson(path: string): unknown { describe("oxlint config", () => { it("includes bundled extensions in type-aware lint coverage", () => { - const tsconfig = readJson("tsconfig.oxlint.json") as OxlintTsconfig; + const tsconfig = readJson("config/tsconfig/oxlint.json") as OxlintTsconfig; - expect(tsconfig.include).toContain("extensions/**/*"); - expect(tsconfig.exclude ?? []).not.toContain("extensions"); + expect(tsconfig.include).toContain("../../extensions/**/*"); + expect(tsconfig.exclude ?? []).not.toContain("../../extensions"); }); it("includes scripts in root type-aware lint coverage", () => { - const tsconfig = readJson("tsconfig.oxlint.json") as OxlintTsconfig; + const tsconfig = readJson("config/tsconfig/oxlint.json") as OxlintTsconfig; - expect(tsconfig.include).toContain("scripts/**/*"); + expect(tsconfig.include).toContain("../../scripts/**/*"); }); it("has a discoverable scripts tsconfig for type-aware linting", () => { diff --git a/test/scripts/run-oxlint.test.ts b/test/scripts/run-oxlint.test.ts index e8292f200ee..c8fe9daeb42 100644 --- a/test/scripts/run-oxlint.test.ts +++ b/test/scripts/run-oxlint.test.ts @@ -36,7 +36,7 @@ describe("run-oxlint", () => { it("filters tracked targets missing from sparse checkouts", () => { const result = filterSparseMissingOxlintTargets( - ["--tsconfig", "tsconfig.oxlint.core.json", "src", "ui", "packages", "--threads=1"], + ["--tsconfig", "config/tsconfig/oxlint.core.json", "src", "ui", "packages", "--threads=1"], { fileExists: (target: string) => target.endsWith("/src"), isSparseCheckoutEnabled: () => true, @@ -45,7 +45,7 @@ describe("run-oxlint", () => { ); expect(result).toEqual({ - args: ["--tsconfig", "tsconfig.oxlint.core.json", "src", "--threads=1"], + args: ["--tsconfig", "config/tsconfig/oxlint.core.json", "src", "--threads=1"], hadExplicitTargets: true, remainingExplicitTargets: 1, skippedTargets: ["ui", "packages"],