-
-
Notifications
You must be signed in to change notification settings - Fork 244
[prefer-signals] Convert suggestion fix to full autofix for readonly requirement #2170
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
Comments
|
Would you like to submit a PR? |
Wait this was already added as a suggestion, rather than an auto fix. So it is already available to apply via your IDE tooling |
@reduckted the author, can maybe speak more to why suggestion vs autofix here |
🤔 That is a very good question. I think I copied the |
Cool yeah it's definitely a very blurry line... But given the rule is opt in, and you can even control this "sub-violation", maybe it makes sense to just promote it to a full fix. I'll mark it as PRs Welcome, please comment if either of you wants to take it |
I'll take it. |
Description and reproduction of the issue
When linting a project that uses the new
prefer-signals
with the--fix
option provided, the plugin reports that signals should be readonly.It seems that it should be a trivial auto-fix, to add
readonly
to the signal definition. It would be nice if this were added.REPRO: https://stackblitz.com/edit/angular-eslint-repros-2qja2h9n?file=package.json
Just run
ng lint --fix
.Versions
@angular-eslint/eslint-plugin
19.0.1
ng version
output per the instructions given here.The text was updated successfully, but these errors were encountered: