mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Add support for //@check directives
This commit is contained in:
1 parent
0b1fff7e66
commit
9f0c5ce141
4 files changed
+9
-1
No files matched your search
@@ -5817,6 +5817,7 @@ namespace ts {
|
||||
const typeReferenceDirectives: FileReference[] = [];
|
||||
const amdDependencies: { path: string; name: string }[] = [];
|
||||
let amdModuleName: string;
|
||||
let hasCheckDirective = false;
|
||||
|
||||
// Keep scanning all the leading trivia in the file until we get to something that
|
||||
// isn't trivia. Any single line comment will be analyzed to see if it is a
|
||||
@@ -5878,6 +5879,9 @@ namespace ts {
|
||||
amdDependencies.push(amdDependency);
|
||||
}
|
||||
}
|
||||
|
||||
const checkDirectiveRegEx = /^\/\/\s*@check\s*/gim;
|
||||
hasCheckDirective = hasCheckDirective || !!checkDirectiveRegEx.exec(comment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5885,6 +5889,7 @@ namespace ts {
|
||||
sourceFile.typeReferenceDirectives = typeReferenceDirectives;
|
||||
sourceFile.amdDependencies = amdDependencies;
|
||||
sourceFile.moduleName = amdModuleName;
|
||||
sourceFile.hasCheckDirective = hasCheckDirective;
|
||||
}
|
||||
|
||||
function setExternalModuleIndicator(sourceFile: SourceFile) {
|
||||
|
||||
Reference in new issue
Block a user