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: pass cwd to formatters (refs eslint/rfcs#57) #13392
Conversation
any news on this? would like to write a custom formatter that outputs relative paths for ci/cd purposes and this is a requirement to do that and it's over a year old another issue was raised in the past about this: |
Looks like we lost track of this and there are now conflicts that need to be addressed. We will take another look after v8.0.0. |
This implements an approved RFC, so re-labeling as accepted. We just need someone to resolve the merge conflicts so this is reviewable. I'm happy to pick it up unless someone else gets to it first. |
3743998
to
e8f2b20
Compare
This comment has been minimized.
This comment has been minimized.
e8f2b20
to
fae8f6b
Compare
This is ready for review. The rebase turned out to be a little more complicated than expected because this was previously using the in-memory filesystem that we've since stopped using. I created a fixture instead. There were a few tests that use the formatter fixtures directory as a target, and I had to update those with the new file. mysticatea's commits are covered by the old CLA, so I've hidden the comment from the CLA bot. |
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 for finishing this up.
I need to add another formatter to this directory that will shift all of these results, so I'm making these assertions more explicit so it's obvious why a seemingly-unrelated change will cause these to fail.
fae8f6b
to
f94612e
Compare
Merge conflicts resolved! |
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.
Just a couple of suggestions about the docs.
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Thanks for those improvements. I committed those and fixed a merge conflict caused by the markdownlint update that was merged a few hours ago. |
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!
This replicates a new feature in ESLint 8.4: eslint/eslint#13392
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[X] Add something to the core: eslint/rfcs#57
What changes did you make? (Give an overview)
This is the implementation of eslint/rfcs#57. It updates the adapter of
ESLint.prototype.loadFormatter
method to passcwd
to formatters. Thecwd
is useful to make relative paths from absolute paths for readability.Is there anything you'd like reviewers to focus on?
Is this direction right?