diff --git a/changelog/@unreleased/pr-167.v2.yml b/changelog/@unreleased/pr-167.v2.yml new file mode 100644 index 00000000..fe8e4820 --- /dev/null +++ b/changelog/@unreleased/pr-167.v2.yml @@ -0,0 +1,5 @@ +type: break +break: + description: Add `module` to reserved keywords. This can break generated types with fields called `module` which get renamed to `module_`. + links: + - https://github.com/palantir/conjure-typescript/pull/167 diff --git a/src/commands/generate/utils.ts b/src/commands/generate/utils.ts index 783eb0fa..8967a68f 100644 --- a/src/commands/generate/utils.ts +++ b/src/commands/generate/utils.ts @@ -41,6 +41,7 @@ export function isValidFunctionName(value: string) { } // Keywords taken from https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words +// with the addition of some build tools' specific keywords like "module" const reservedKeywords = new Set([ "break", "case", @@ -66,6 +67,7 @@ const reservedKeywords = new Set([ "instanceof", "new", "null", + "module", "return", "super", "switch",