Skip to content

Commit

Permalink
fix(typescript-estree): add support for TS3.9 extra file extensions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed Apr 1, 2020
1 parent 9d53c76 commit 1f0ff41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -32,6 +32,7 @@ interface WatchCompilerHostOfConfigFile<T extends ts.BuilderProgram>
onCachedDirectoryStructureHostCreate(
host: CachedDirectoryStructureHost,
): void;
extraFileExtensions?: readonly ts.FileExtensionInfo[];
}

export { WatchCompilerHostOfConfigFile };
Expand Up @@ -314,6 +314,14 @@ function createWatchProgram(
);
oldOnDirectoryStructureHostCreate(host);
};
// This works only on 3.9
watchCompilerHost.extraFileExtensions = extra.extraFileExtensions.map(
extension => ({
extension,
isMixedContent: true,
scriptKind: ts.ScriptKind.Deferred,
}),
);
watchCompilerHost.trace = log;

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

0 comments on commit 1f0ff41

Please sign in to comment.