-
Notifications
You must be signed in to change notification settings - Fork 14
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
Exception for readonly-array
rule with rest parameters
#73
Comments
It would be interesting to know the typescript team's opinion on this. Is this something they will fix or not. Do you know if there exist an issue about this in the typescript repo? I cannot see a reason why rest params should need to be mutable so IMO it should be fixed in typescript. If it is going to be fixed, then we should probably add it as an option to the |
This fixes jonaskello#73 while we wait for TypeScript to implement a proper fix. Rather than repeating all the test cases from default that this should not break it creates a new test either way for functions and symlinks the others.
This fixes jonaskello#73 while we wait for TypeScript to implement a proper fix. Rather than repeating all the test cases from default that this should not break it creates a new test either way for functions and symlinks the others.
This fixes #73 while we wait for TypeScript to implement a proper fix. Rather than repeating all the test cases from default that this should not break it creates a new test either way for functions and symlinks the others.
I have the
readonly-array
rule enabled as follows:For the following piece of code, the rule throws an error:
However, if I do fix this error and replace
string[]
withReadonlyArray<string>
, the code becomes invalid:As you can see, the TypeScript compiler requires that rest arguments are typed as plain arrays.
Proposal
Add an exception to the
readonly-array
rule for this specific case.Environment
tslint --version
tsc --version
node --version
The text was updated successfully, but these errors were encountered: