Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript-estree): expose a wrapper cache clearing function for…
… advanced usecases (#6476)
- Loading branch information
1 parent
e8cebce
commit d816496
Showing
5 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,7 @@ jspm_packages/ | |
.idea | ||
dist | ||
_ts3.4 | ||
_ts4.2 | ||
*.tsbuildinfo | ||
.watchmanconfig | ||
.rollup.cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { clearWatchCaches } from './create-program/getWatchProgramsForProjects'; | ||
import { clearProgramCache as clearProgramCacheOriginal } from './parser'; | ||
import { clearTSConfigMatchCache } from './parseSettings/createParseSettings'; | ||
import { clearGlobCache } from './parseSettings/resolveProjectList'; | ||
|
||
/** | ||
* Clears all of the internal caches. | ||
* Generally you shouldn't need or want to use this. | ||
* Examples of intended uses: | ||
* - In tests to reset parser state to keep tests isolated. | ||
* - In custom lint tooling that iteratively lints one project at a time to prevent OOMs. | ||
*/ | ||
export function clearCaches(): void { | ||
clearProgramCacheOriginal(); | ||
clearWatchCaches(); | ||
clearTSConfigMatchCache(); | ||
clearGlobCache(); | ||
} | ||
|
||
// TODO - delete this in next major | ||
export const clearProgramCache = clearCaches(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters