Skip to content

Commit

Permalink
add "module" to reservedKeywords (#167)
Browse files Browse the repository at this point in the history
* add "module" to reservedKeywords

* Add changelog

* Update changelog

Co-authored-by: Damian Rusak <[email protected]>
  • Loading branch information
damianrusak and Damian Rusak authored Sep 15, 2021
1 parent fc1d326 commit 2a910c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-167.v2.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/commands/generate/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -66,6 +67,7 @@ const reservedKeywords = new Set([
"instanceof",
"new",
"null",
"module",
"return",
"super",
"switch",
Expand Down

0 comments on commit 2a910c3

Please sign in to comment.