Closed as not planned
Closed as not planned
Description
ESLint version
9.29.0
What problem do you want to solve?
We have our custom rule that performs the linting based on tsconfig and package.json file it finds. The idea is that the lint rule automatically checks if a TS feature is enabled (or for example, if package.json has type:module) and adjusts the behavior accordingly.
In our case we run in monorepo, where eslint is configured globally but then there are 200 different package/tsconfig files - so reading the tsconfig and passing it in eslintrc as object to the rule isn't an option.
However, eslint currently caches rule result based on the file being linted only - so fixing the issue on the other side - the config file, result in IDE (or cli launch with --cache) still showing the old error.
What do you think is the correct solution?
either:
- add API to the context passed to rule function:
context.addCacheDependency("path/to/file")
- add option to configure files in eslintrc that invalidate cache - for example, by default this could have package.json/yarn.lock and similar files, but could be extended
Participation
- I am willing to submit a pull request for this change.
Additional comments
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Complete