-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix(plugin-eslint): eslint startline can be zero #563
fix(plugin-eslint): eslint startline can be zero #563
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2db0d1d. 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 7 targetsSent with 💌 from NxCloud. |
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.
We don't want to consume source file links for line 0, they don't represent an actual file location so we can't create file snippets from them in the portal.
Instead, I suggest we either:
- omit the
position
altogether ifline
is 0 - similar to how we handlecolumn
0 in fix(plugin-eslint): handle rules which emit column 0 #522 - since it's more of a configuration error than an actual problem in the source code, don't create an issue at all, instead just print a warning or throw an error
@matejchalk I changed PR to implement first solution. While I like the second solution to throw an error, it is against the idea of "monitoring" the progress for transformation as one has e.g., to fix some projects in monorepos to have the rules in place. |
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.
Thanks for the fix 🙂
In case tsconfig does not contain correct setup, e.g., "strictNullChecks": true, eslint throws warnings for line "zero". The current schema does not show the warning, it just throws an internal error. This fix allows for warning on line zero to be collected for the report.
Fixes issues such as:
for issues like
0:1 warning This rule requires the
strictNullCheckscompiler option to be turned on to function correctly @typescript-eslint/prefer-nullish-coalescing