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
Relative 'extends' can fail; should resolve relative to config file #685
Labels
Comments
andrewdbond
added a commit
to andrewdbond/xo
that referenced
this issue
Aug 28, 2022
Allow relative 'extends' when starting XO from a folder different than the config file. This can also occur when using the XO VS Code extension. Fixes xojs#685
@andrewdbond - the extension latest update has changed the logic and I believe the cwd will always be where it finds a package.json with xo as a dependency, so as a hack if you make the extends relative to that directory it will probably work as expected until this issue is fully resolved. |
andrewdbond
added a commit
to andrewdbond/xo
that referenced
this issue
Aug 31, 2022
Add a basic test for 'extends' using a relative path. Related to xojs#685
andrewdbond
added a commit
to andrewdbond/xo
that referenced
this issue
Aug 31, 2022
Improve previous extends test to use a relative path instead of a test-created absolute path. The config in issue 71 was initially described as relative, and is likely the more normal case. Related to xojs#685
andrewdbond
added a commit
to andrewdbond/xo
that referenced
this issue
Aug 31, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
'extends' using relative paths aren't always resolved relative to the configuration file.
To Reproduce
Steps to reproduce the behavior:
xo.config.js
:Alternatively, in place of step 2 above, run XO from a different folder with the
cwd
option set to the config folder:Expected behavior
XO loads the extended config file.
Additional context
For comparison, "ESLint resolves a relative path to a base configuration file relative to the configuration file that uses it."
Tested on Node.js v16.
The text was updated successfully, but these errors were encountered: