Support relative paths in .eslintcache cache file #16741
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
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.
The text was updated successfully, but these errors were encountered: