-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use array shorthand syntax #33135
Comments
For adding rules , you can add this feature request in https://github.com/mgechev/codelyzer |
@santoshyadav198613 this issue is for Angular's internal source code, not external consumers' ones |
Hi @dannyskoog , To unifying these, please consider to raise a feature request in TypeScript. @mhevery, Please consider closing the issue, if the above answer sounds relevant. Disclaimer : in my perspectives, it is good to have multiple ways to declare an array |
@MrJithil thanks. And I鈥檓 very well aware of everything you鈥檙e saying. The purpose of this issue is to discuss whether we are interested in unifying the array syntax throughout the Angular codebase or not. And the Given that, I still think it brings value to keep this one open a little longer in order for people to get the chance to chip in. |
@mhevery Given the low activity of this issue I believe it's reasonable to close it. What do you think? |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package. You can find more details about the feature request process in our documentation. |
Closing as this request is just to change the typings of the internal code base for Angular - it has no impact on external application developers - and there is not much value in constraining this way of defining arrays. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
馃殌 feature request
Relevant Package
All
Description
Typescript offers 2 array syntax:
Shorthand:
T[]
(read only variantreadonly T[]
)Generic:
Array<T>
(read only variantReadonlyArray<T>
)Currently we're using both, although the
shorthand
has a HUGE majority in the code-base. And since I'm a big fan of unification it would be preferable to settle for just one of them - specifically for theshorthand
one IMHO.Shorthand
pros:Describe the solution you'd like
Add TS lint rules that enforce usage of the
shorthand
:Describe alternatives you've considered
Keep using both
The text was updated successfully, but these errors were encountered: