-
-
Notifications
You must be signed in to change notification settings - Fork 73
Relocate config file to temp directory #338
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
base: main
Are you sure you want to change the base?
Conversation
The config file was previously stored in the project eslint directory, which could lead to write error in sandbox environments (like Bazel). This commit relocates the config file to the OS's temporary directory, namespaced by a hash of the project eslint directory.
Thank you for the PR 🙏. I'll find time to test this tomorrow. |
Can you have a look at the failing build please? |
The configFile function in the daemon tests was being called with a base object instead of the resolver mock object. This commit fixes this issue by using the resolverMock object in all calls to the configFile function in the daemon tests.
Use path.join to construct the config file path, ensuring compatibility across different operating systems by handling path separators correctly.
The windows_fix branch might fix the Windows issue. |
I don't have a windows machine to test this either. Sorry. You can simply update this PR or open another one and I'll trigger the builds. |
The file name generated for the config was invalid for some OS's. It contained a leading ".", which is valid on *nix, but not on Windows. Also, replaced backslashes with forward slashes in the config SHA256 hash to maintain consistency.
The config file path generation was not platform independent causing cache misses on Windows. By using absolute paths, the cache invalidation works correctly.
On Windows, `path.resolve` returns backslash as path separator. This commit replaces backslash to slash for consistent file name.
Tested in a virtual machine with Cygwin. https://github.com/azzurro/eslint_d.js/actions/runs/14859174014 |
The config file was previously stored in the project eslint directory,
which could lead to write error in sandbox environments (like Bazel).
This pull request relocates the config file to the OS's temporary directory,
namespaced by a hash of the project eslint directory.