Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error from code generation #136

Open
holdenmad opened this issue Feb 20, 2023 · 0 comments
Open

Syntax error from code generation #136

holdenmad opened this issue Feb 20, 2023 · 0 comments

Comments

@holdenmad
Copy link

I'm having a problem with various apps that are using the cf-content-types-generator, specifically this app which I'm using in Contentful. The same thing is happening from contentful-typescript-codegen.

What is happening is when I try to generate types, a clear syntax error is happening which comes from an extra semicolon and backslash at the end of the colorPalette line:

export interface TypeComponentTextBlockFields {
    internalName?: Contentful.EntryFields.Symbol;
    headline?: Contentful.EntryFields.Symbol;
    subline?: Contentful.EntryFields.Symbol;
    body?: CFRichTextTypes.Block | CFRichTextTypes.Inline;
    colorPalette?: "1. White (#FFFFFF)" | "2. White Smoke (#FCFCFC)" | "3. Light Gray (#F4F4F4)" | "4. Gray (#EAEAEA)" | "5. Steel Gray (#BBBBBB)" | "6. Dark Gray (#797979)" | "7. Black (#000000)\";;
}

I don't know why this is happening, but it means that I can't usefully use the package/script as a single command or as part of CI/CD, since linting stops it. Currently I have to use the Contentful app and then manually edit the file to allow the project to use the types correctly.

What could be causing this error? Let me know if I can provide more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant