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

Only warn about an unsupported TypeScript version once #347

Merged
merged 6 commits into from
Aug 9, 2017
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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