8000 fix(typescript-estree): add support for TS3.9 extra file extensions (… · shishkin/typescript-eslint@1f0ff41 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f0ff41

Browse files
authored
fix(typescript-estree): add support for TS3.9 extra file extensions (typescript-eslint#1833)
1 parent 9d53c76 commit 1f0ff41

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface WatchCompilerHostOfConfigFile<T extends ts.BuilderProgram>
3232
onCachedDirectoryStructureHostCreate(
3333
host: CachedDirectoryStructureHost,
3434
): void;
35+
extraFileExtensions?: readonly ts.FileExtensionInfo[];
3536
}
3637

3738
export { WatchCompilerHostOfConfigFile };

packages/typescript-estree/src/create-program/createWatchProgram.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ function createWatchProgram(
314314
);
315315
oldOnDirectoryStructureHostCreate(host);
316316
};
317+
// This works only on 3.9
318+
watchCompilerHost.extraFileExtensions = extra.extraFileExtensions.map(
319+
extension => ({
320+
extension,
321+
isMixedContent: true,
322+
scriptKind: ts.ScriptKind.Deferred,
323+
}),
324+
);
317325
watchCompilerHost.trace = log;
318326

319327
// Since we don't want to asynchronously update program we want to disable timeout methods

0 commit comments

Comments
 (0)
0