Skip to content
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' no longer error out in the XO VS Code extension, nor if running XO from a different folder #686

Merged
merged 6 commits into from
Oct 4, 2022

Conversation

andrewdbond
Copy link
Contributor

Relative 'extends' no longer error out in the XO VS Code extension, nor if running XO from a different folder.

Fixes #685

Addressed issue by altering the existsSync call. By default node:fs resolves paths relative to the directory returned by process.cwd. For the XO VS Code extension, process.cwd() references the VS Code program folder.

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
@sindresorhus
Copy link
Member

// @spence-s

@spence-s
Copy link
Contributor

@sindresorhus - this is not related to recent changes, I don't believe. If I am understanding right, this is about extending the configuration from a relative dir -- it's always resolved from process.cwd() which causes it to not be located correctly if the config dir does not match. It is not directly related to the extension. I think it is a valid bug.

@andrewdbond this is probably a good solution/fix but I would like to see a failing test or 2 added so this problem won't sneak back in later and we can clearly see the use case being solved.

Add a basic test for 'extends' using a relative path.

Related to xojs#685
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
Copy link
Contributor Author

Added to ./test/, thanks.
// @spence-s

@sindresorhus sindresorhus merged commit e69a192 into xojs:main Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relative 'extends' can fail; should resolve relative to config file
3 participants