Skip to content

Isssue generating declaration files with object containing keywords as property #50483

Closed
@Mister-Hope

Description

@Mister-Hope

TS playground does not have 4.8.2 yet, but this issue can happends in 4.8 beta:

https://www.typescriptlang.org/play?moduleResolution=99&target=99&jsx=0&module=199&ts=4.8.0-beta#code/C4TwDgpgBAMg9gYwIYBsIBEnCVAvFAJQgTgCcATAHgGdhSBLAOwHMAaKRiANwlID4AUKEhQAwnEY9SweMjTjGAM3rNKAFSgQAHsAiNy1WIlQYsOfLJOZsfPIWJkqAqFFoMWrZ1DUC+AbiFwaEt5CWVVDW1dfUMQ02w7OOskW3wiEgoaOiY2KAAFJGl6VHU+fwEBbTAyYCgmXVJFJARoAHEIGWM0agB5MGB6CWp1TR09AyM5eJSoAG8vFyQwMAAuKABXRgBrRjgAd0YAlxdyCCb1lGA1hSlOqYVw0qPjkiUVAH41uIeVUqgAHw2+jOTAg5GeLkYSAAthBPq5siwAgBfCpVGpQV60KDMDpxQz4EZRcaxLrTPgACnmxygSzAnhpUNhDOOp3OlzWbKQFzuJmoPzYC0xYRUa3W1F4+IFdlmyM8yLW7V53T6AyGpQAlNcJLdviKIqlbNTjqQOutSIwoFyeVL9SiAkA

The DTS result is wrong because default is a keyword:

export declare const getLocales: <T extends LocaleData>({ app, name, default, config, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>;

Meanwhile older ts versions work well:

https://www.typescriptlang.org/play?moduleResolution=99&target=99&jsx=0&module=199&ts=4.7.4#code/C4TwDgpgBAMg9gYwIYBsIBEnCVAvFAJQgTgCcATAHgGdhSBLAOwHMAaKRiANwlID4AUKEhQAwnEY9SweMjTjGAM3rNKAFSgQAHsAiNy1WIlQYsOfLJOZsfPIWJkqAqFFoMWrZ1DUC+AbiFwaEt5CWVVDW1dfUMQ02w7OOskW3wiEgoaOiY2KAAFJGl6VHU+fwEBbTAyYCgmXVJFJARoAHEIGWM0agB5MGB6CWp1TR09AyM5eJSoAG8vFyQwMAAuKABXRgBrRjgAd0YAlxdyCCb1lGA1hSlOqYVw0qPjkiUVAH41uIeVUqgAHw2+jOTAg5GeLkYSAAthBPq5siwAgBfCpVGpQV60KDMDpxQz4EZRcaxLrTPgACnmxygSzAnhpUNhDOOp3OlzWbKQFzuJmoPzYC0xYRUa3W1F4+IFdlmyM8yLW7V53T6AyGpQAlNcJLdviKIqlbNTjqQOutSIwoFyeVL9SiAkA

export declare const getLocales: <T extends LocaleData>({ app, name, default: defaultLocalesConfig, config: userLocalesConfig, }: GetLocalesOptions<T>) => ConvertLocaleConfig<T>;

I think this is a critial bug and should be fixed in 4.8.3 asap


Also I was curious:

  1. why could this happends? Is related test cases missing? Maybe the team should check test cases and add some releated test into it.
  2. When will you update your website? Hours passes after releasing 4.8 to stable, maybe the team can update ts playground faster, and that DOES help developers.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions