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

fix: change working directory prior to loading the engine #494

Merged
merged 2 commits into from
Nov 6, 2022

Conversation

pedro-w
Copy link
Contributor

@pedro-w pedro-w commented Nov 6, 2022

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[X] Bug fix
[ ] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)
The typescript linter (ts-standard) needs to find the configuration file (tsconfig.json or tsconfig.eslint.json) in order to work. It searches, starting from the current working directory. When running the e2e test script and, I suspect, starting VSCode from a Linux shell, the CWD is set correctly and everything works. However this is not guaranteed - for example running from the Windows start menu has the CWD set to the installation directory.

The commit c4d3763 temporarily changes to the workspace folder before loading the typescript engine and restores the previous value afterwards. The workspace folder seems to be the correct one, at least for single workspace projects.

As mentioned the test code coincidentally sets the CWD correctly so this error never appears when running npm test. Commit 663b6fb changes to a different directory (actually the temporary directory) prior to starting each test run which causes the ts-standard test to fail without the fix also being applied.

Which issue (if any) does this pull request address?
#483

Is there anything you'd like reviewers to focus on?

@welcome
Copy link

welcome bot commented Nov 6, 2022

🙌 Thanks for opening this pull request! You're awesome.

Copy link
Contributor

@theoludwig theoludwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I just tested it locally, and it works!

@theoludwig theoludwig changed the title Issue 483 - Change working directory to workspace directory prior to loading the engine fix: change working directory prior to loading the engine Nov 6, 2022
@theoludwig theoludwig merged commit 6e5bf38 into standard:master Nov 6, 2022
@welcome
Copy link

welcome bot commented Nov 6, 2022

🎉 Congrats on getting your first pull request landed!

@pedro-w pedro-w deleted the issue-483 branch November 7, 2022 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

server reports "Unable to locate the project file" after upgrading ts-standard to 12.0.1
2 participants