We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
readonly parameters, readonly arguments, read only, function
Allow specifying a readonly modifier to function and method arguments
readonly
function foo(mutableString: string, readonly immutableString: string) { mutableString = 'bar' // ok immutableString = 'bar' // not ok }
With #29435 we can do this for rest arguments too:
function foo(readonly ...immutableStrings: string[]) {} // the same as function foo(...immutableStrings: readonly string[]) {}
There is a ESLint rule for not allowing overriding incoming function argument no-param-reassign
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered:
Duplicate #18497
Sorry, something went wrong.
No branches or pull requests
Search Terms
readonly parameters, readonly arguments, read only, function
Suggestion
Allow specifying a
readonly
modifier to function and method argumentsWith #29435 we can do this for rest arguments too:
Use Cases
There is a ESLint rule for not allowing overriding incoming function argument no-param-reassign
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: