Skip to content

Remove unnecessary array parenthesis #1232

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

Merged
merged 3 commits into from
Jul 21, 2023

Conversation

tkrotoff
Copy link
Contributor

@tkrotoff tkrotoff commented Jul 21, 2023

Before:

/** A title */
fooBar: (string)[];

After:

/** A title */
fooBar: string[];

@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2023

🦋 Changeset detected

Latest commit: 4b6c7eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-typescript Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tkrotoff tkrotoff marked this pull request as draft July 21, 2023 12:24
@tkrotoff tkrotoff force-pushed the remove-unnecessary-array-parenthesis branch from cec2cb9 to 30e3654 Compare July 21, 2023 16:19
/** T[] */
export function tsArrayOf(type: string): string {
return `(${type})[]`;
return `${parenthesise(type)}[]`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gist of it

@tkrotoff tkrotoff marked this pull request as ready for review July 21, 2023 16:22
Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you for fixing this! All the generated TS seems to be valid—impressive!

@drwpow drwpow merged commit 31c030d into openapi-ts:main Jul 21, 2023
@github-actions github-actions bot mentioned this pull request Jul 21, 2023
@drwpow
Copy link
Contributor

drwpow commented Jul 21, 2023

This and #1231 will be released in 6.3.6. Thank you!

@tkrotoff
Copy link
Contributor Author

Awesome! Thank you for fixing this!

Thank you for this project, it works great ♥️

We use it in several projects at Decathlon

@tkrotoff tkrotoff deleted the remove-unnecessary-array-parenthesis branch July 21, 2023 18:26
@drwpow
Copy link
Contributor

drwpow commented Jul 25, 2023

We use it in several projects at Decathlon

Whoa, what a cool site! Happy to have helped with a small bit of it 🙂

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

Successfully merging this pull request may close these issues.

2 participants