Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions packages/utils/src/eslint-utils/RuleTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ class RuleTester extends TSESLint.RuleTester {

// make sure that the parser doesn't hold onto file handles between tests
// on linux (i.e. our CI env), there can be very a limited number of watch handles available
afterAll(() => {
try {
// instead of creating a hard dependency, just use a soft require
// a bit weird, but if they're using this tooling, it'll be installed
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
require(parser).clearCaches();
} catch {
// ignored
}
});
if (typeof afterAll !== 'undefined') {
afterAll(() => {
try {
// instead of creating a hard dependency, just use a soft require
// a bit weird, but if they're using this tooling, it'll be installed
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
require(parser).clearCaches();
} catch {
// ignored
}
});
}
}
private getFilename(options?: TSESLint.ParserOptions): string {
if (options) {
Expand Down