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

Support relative paths in .eslintcache cache file #16741

Closed
aaronabf opened this issue Jan 3, 2023 · 2 comments
Closed

Support relative paths in .eslintcache cache file #16741

aaronabf opened this issue Jan 3, 2023 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon
Projects

Comments

@aaronabf
Copy link

aaronabf commented Jan 3, 2023

ESLint version

v8.31.0

What problem do you want to solve?

Currently, the eslint cache stores the absolute path to each file as opposed to the relative project path. The problem with this approach is it makes the file not portable. Why does this matter? Consider the common use-case of running eslint in a testing pipeline. In such a case, you only need to run eslint on modified files. I have seen techniques where a git diff determines which files eslint runs on. However, such a solution goes against best testing principles in which if the mainline branch has failing tests then so should a branch based on top. This would not be upheld if only modified files were considered. The cleanest way to support this is by uploading the eslint cache file on each merge to mainline and referencing this mainline cache file in each PR. Unfortunately, this is not possible if the paths are absolute.

What do you think is the correct solution?

The cache file should support project-relative files.

Participation

I am not familiar with the code-base.

@aaronabf aaronabf added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Jan 3, 2023
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Jan 3, 2023
@aaronabf
Copy link
Author

aaronabf commented Jan 3, 2023

Related to #14565.

@mdjermanovic
Copy link
Member

Duplicate of #16493. I'm closing this so that we don't have two open issues for the same functionality. An RFC with details about this change is welcome.

@sam3k sam3k moved this from Needs Triage to Complete in Triage Apr 2, 2023
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jul 4, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon
Projects
No open projects
Triage
Complete
Development

No branches or pull requests

2 participants