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: Do not output undefined
as line and column when it's unavailable in checkstyle format
#13519
Conversation
undefined
as line and column when it's unavailableundefined
as line and column when it's unavailable in checkstyle format
Hi @haya14busa, thanks for the PR!
I think it's safe to output |
@haya14busa is there a specification for this format? It seems that On the other hand, |
I don't know, unfortunately. I just found this issue because parsing XML itself failed because line and column value was string "undefined". As far as I know, there are no formal spec of checkstyle XML format (although many tools use it). I'm fine to omit column if you prefer or omit both. |
Agreed, it definitely shouldn't be Since there is no formal spec, and since it seems that checkstyle itself can produce |
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.
LGTM, thanks!
…gnore-default-values * upstream/master: (66 commits) Sponsors: Sync README with website Sponsors: Sync README with website Sponsors: Sync README with website Sponsors: Sync README with website Sponsors: Sync README with website Chore: remove leche (fixes eslint#13287) (eslint#13533) Sponsors: Sync README with website Sponsors: Sync README with website 7.6.0 Build: changelog update for 7.6.0 Update: require `meta` for fixable rules in RuleTester (refs eslint#13349) (eslint#13489) Docs: fix broken links in developer guide (eslint#13518) Fix: Do not output `undefined` as line and column when it's unavailable (eslint#13519) Sponsors: Sync README with website Sponsors: Sync README with website Fix: Update the chatroom link to go directly to help channel (eslint#13536) Sponsors: Sync README with website Update: Change no-duplicate-case to comparing tokens (fixes eslint#13485) (eslint#13494) Docs: add ECMAScript 2020 to README (eslint#13510) 7.5.0 ...
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What did you do? Please include the actual source code causing the issue.
Run eslint with checkstyle format and .eslintignore.
What did you expect to happen?
eslintignore warning should output line and column as 0 or do not output line and column fields.
What actually happened? Please include the actual, raw output from ESLint.
eslintignore warning output
undefined
as line and column fields of checkstyle XML.What changes did you make? (Give an overview)
Use 0 if line and column are undefined. It's consistent with other formatters.
Is there anything you'd like reviewers to focus on?
N/A