Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit e687d36

Browse files
committed
New: Only warn about an unsupported TypeScript version once (fixes #348)
It gets annoying when you’re trying to lint a project with lots of files.
1 parent 5e22fac commit e687d36

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

parser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const ACTIVE_TYPESCRIPT_VERSION = ts.version;
1717
const isRunningSupportedTypeScriptVersion = semver.satisfies(ACTIVE_TYPESCRIPT_VERSION, SUPPORTED_TYPESCRIPT_VERSIONS);
1818

1919
let extra;
20+
let warnedAboutTSVersion = false;
2021

2122
/**
2223
* Resets the extra config object
@@ -103,7 +104,7 @@ function parse(code, options) {
103104

104105
}
105106

106-
if (!isRunningSupportedTypeScriptVersion) {
107+
if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) {
107108
const border = "=============";
108109
const versionWarning = [
109110
border,
@@ -115,6 +116,7 @@ function parse(code, options) {
115116
border
116117
];
117118
extra.log(versionWarning.join("\n\n"));
119+
warnedAboutTSVersion = true;
118120
}
119121

120122
// Even if jsx option is set in typescript compiler, filename still has to

0 commit comments

Comments
 (0)