diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts index 06377124..163cbc96 100644 --- a/packages/cli/src/types.ts +++ b/packages/cli/src/types.ts @@ -181,6 +181,7 @@ export function generateApplicationTypes( .map((name) => join(root, name)) .find(existsSync); const code = `// AUTO-GENERATED by \`wrnexus generate types\` - do not edit. +/* eslint-disable @typescript-eslint/no-empty-object-type */ declare namespace WRNexusGenerated { type ApiContract = T extends import("@wrnexus/core").DefinedEndpoint ? { input: I; output: O } diff --git a/packages/compiler/src/codegen.ts b/packages/compiler/src/codegen.ts index 79baef08..99d2af97 100644 --- a/packages/compiler/src/codegen.ts +++ b/packages/compiler/src/codegen.ts @@ -1566,6 +1566,13 @@ const JS_RESERVED = new Set([ "enum", "with", "debugger", + "implements", + "interface", + "package", + "private", + "protected", + "public", + "static", ]); /** A JS reference for a prop/state name (reserved words get a `__p_` prefix). */ diff --git a/packages/compiler/test/compiler.test.ts b/packages/compiler/test/compiler.test.ts index 93780911..b44d6419 100644 --- a/packages/compiler/test/compiler.test.ts +++ b/packages/compiler/test/compiler.test.ts @@ -1387,3 +1387,14 @@ test("style blocks compile with stable page/component/layout metadata", () => { expect(layout).toContain("export const __wrnexusStyles"); expect(page).toMatch(/data-wrnexus-style-id="wrn-page-[a-z0-9]+"/); }); + +test("strict-mode reserved prop names compile through safe local references", () => { + const output = compileWireFile(`component Visibility { + props { private: boolean = false } + view { {#if private}Private{/if} } + }`); + + expect(output).toContain("const __p_private: boolean"); + expect(output).toContain("(__p_private) ?"); + expect(output).not.toContain("const private:"); +});