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
feat(eslint-plugin): [use-lifecycle-interface] add fixer for the rule #1691
base: main
Are you sure you want to change the base?
Conversation
packages/eslint-plugin/tests/rules/use-lifecycle-interface/cases.ts
Outdated
Show resolved
Hide resolved
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 891a05d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 6 targetsSent with 💌 from NxCloud. |
@@ -120,6 +138,19 @@ export const invalid = [ | |||
}, | |||
}, | |||
], | |||
annotatedOutput: ` | |||
@Injectable() | |||
class Test implements DoBootstrap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't fix all the issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understood the documentation of eslint correctly the fixes are applied again and again, as long as the lint error is still reported. I'm unsure, how I can use the plugin in a local testing repo to test that out, please advice me on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So yes I found a way to try it out. (run e2e tests and then try your changes in tmp/e2e-fixtures/ in any of the apps there. Maybe that should be documented) Indeed eslint runs again on the output of fixes until there are no changes, so it indeed results in a fix that adds all the implements clauses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing I noticed is that I do not add an import for the Interface, here I would like guidance @JamesHenry
Thank you @bulldog98! Left some comments |
I'll try to fix the issues, not sure if I have time before the weekend though |
I got the fixer to work, but could not fix one of the tests, seems to be a white space issue.