atomist-attic / rug

DEPRECATED Runtime for Rugs
GNU General Public License v3.0
53 stars 13 forks source link

Avoid TypeScript keywords when generating cortex code #664

Closed ddgenome closed 7 years ago

ddgenome commented 7 years ago

If the property of a cortex object uses a TypeScript keyword, the TypeScript code generated for the stub is invalid because it uses the parameter name as the variable argument to the withParameter function. For example, for the Label (GitHub issue labels) has a parameter named "default", which leads to this code:

    withDefault(default: string) {
        this._default = default;
        return this;
    }

which leads to this TypeScript compiler error:

target/.atomist/node_modules/@atomist/cortex/stub/Label.ts(90,17): error TS1003: Identifier expected.
ddgenome commented 7 years ago

No longer relevant.