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

Commit

Permalink
Only warn about an unsupported TypeScript version once
Browse files Browse the repository at this point in the history
It gets annoying when you’re trying to lint a project with lots of files.
  • Loading branch information
j-f1 authored Aug 8, 2017
1 parent 5e22fac commit 8402e18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const ACTIVE_TYPESCRIPT_VERSION = ts.version;
const isRunningSupportedTypeScriptVersion = semver.satisfies(ACTIVE_TYPESCRIPT_VERSION, SUPPORTED_TYPESCRIPT_VERSIONS);

let extra;
let warnedAboutTSVersion = false;

/**
* Resets the extra config object
Expand Down Expand Up @@ -103,7 +104,7 @@ function parse(code, options) {

}

if (!isRunningSupportedTypeScriptVersion) {
if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) {
const border = "=============";
const versionWarning = [
border,
Expand All @@ -115,6 +116,7 @@ function parse(code, options) {
border
];
extra.log(versionWarning.join("\n\n"));
warnedAboutTSVersion = true;
}

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

0 comments on commit 8402e18

Please sign in to comment.