-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: normalize cwd
passed to ESLint
/FlatESLint
constructor
#17277
Conversation
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. Would like someone else to review before merging.
After this change, a custom formatter will be passed a normalized |
I think it's acceptable for a non-breaking fix. We don't guarantee that the data passed to formatters will remain exactly the same, and that looks more like an integration test than a unit test. |
Agreed. |
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 PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.42.0` -> `8.43.0`](https://renovatebot.com/diffs/npm/eslint/8.42.0/8.43.0) | --- ### Release Notes <details> <summary>eslint/eslint (eslint)</summary> ### [`v8.43.0`](https://github.com/eslint/eslint/releases/tag/v8.43.0) [Compare Source](eslint/eslint@v8.42.0...v8.43.0) #### Features - [`14581ff`](eslint/eslint@14581ff) feat: directive prologue detection and autofix condition in `quotes` ([#​17284](eslint/eslint#17284)) (Francesco Trotta) - [`e50fac3`](eslint/eslint@e50fac3) feat: add declaration loc to message in block-scoped-var ([#​17252](eslint/eslint#17252)) (Milos Djermanovic) - [`1b7faf0`](eslint/eslint@1b7faf0) feat: add `skipJSXText` option to `no-irregular-whitespace` rule ([#​17182](eslint/eslint#17182)) (Azat S) #### Bug Fixes - [`5338b56`](eslint/eslint@5338b56) fix: normalize `cwd` passed to `ESLint`/`FlatESLint` constructor ([#​17277](eslint/eslint#17277)) (Milos Djermanovic) - [`54383e6`](eslint/eslint@54383e6) fix: Remove `no-extra-parens` autofix for potential directives ([#​17022](eslint/eslint#17022)) (Francesco Trotta) #### Documentation - [`8b855ea`](eslint/eslint@8b855ea) docs: resubmit pr17061 doc changes ([#​17292](eslint/eslint#17292)) (唯然) - [`372722e`](eslint/eslint@372722e) docs: resubmit pr17012 doc changes ([#​17293](eslint/eslint#17293)) (唯然) - [`67e7af3`](eslint/eslint@67e7af3) docs: resubmit custom-rules doc changes ([#​17294](eslint/eslint#17294)) (唯然) - [`9e3d77c`](eslint/eslint@9e3d77c) docs: Resubmit Fix formatting in Custom Rules docs ([#​17281](eslint/eslint#17281)) (Milos Djermanovic) - [`503647a`](eslint/eslint@503647a) docs: Resubmit markVariableAsUsed docs ([#​17280](eslint/eslint#17280)) (Nicholas C. Zakas) - [`e0cf0d8`](eslint/eslint@e0cf0d8) docs: Custom rule & plugin tutorial ([#​170...
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 autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
Fixes #17042
What changes did you make? (Give an overview)
Updated
ESLint
andFlatESLint
constructors topath.normalize()
givencwd
right away when processing options.This fixes bug #17042 for the
ESLint
class (the same bug did not exist for theFLatESLint
class) and also ensures that rules and formatters always get normalizedcwd
.Is there anything you'd like reviewers to focus on?