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

Portable cache files #914

Open
mdjermanovic opened this issue Dec 2, 2024 · 2 comments
Open

Portable cache files #914

mdjermanovic opened this issue Dec 2, 2024 · 2 comments

Comments

@mdjermanovic
Copy link

Is your feature request related to a problem? Please describe.

We would like to make ESLint cache files portable.

Use case 1: The cache file is created/updated in CI. The goal is to make the cache file reusable for CI runs, but different CI runs may have different directory structures.
Use case 2: The cache file is checked in the source control and shared among developers who can update it and commit the changes. Developers typically have different directory structures on local machines.

By "directory structures" I mean the location where the project is stored locally. For example, on one machine it can be /projects/my-app, on another one /work/my-app, /projects/work-my-app or C:\projects\my-app.

References:

Describe the solution you'd like

I think the best solution would be to store file paths relative to the location of the cache file. I see the latest file-entry-cache v10.0.4 can store relative paths in the cache file, but not sure if and how it would be possible to make them relative to the location of the cache file.

@mdjermanovic
Copy link
Author

Regarding the solution with renameAbsolutePathKeys suggested by @jaredwray in eslint/rfcs#114 (comment), I think it isn't applicable for these use cases because we don't know oldPath, and in the Use case 2 there can be multiple old paths.

@jaredwray
Copy link
Owner

@mdjermanovic - thanks. relative pathing should work and I will add in more tests around it but you can use it no problem and it should just work. Is there a scenario where the new version doesnt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants