@@ -16,8 +16,21 @@ const SUPPORTED_TYPESCRIPT_VERSIONS = require("./package.json").devDependencies.
16
16
const ACTIVE_TYPESCRIPT_VERSION = ts . version ;
17
17
const isRunningSupportedTypeScriptVersion = semver . satisfies ( ACTIVE_TYPESCRIPT_VERSION , SUPPORTED_TYPESCRIPT_VERSIONS ) ;
18
18
19
+ if ( ! isRunningSupportedTypeScriptVersion ) {
20
+ const border = "=============" ;
21
+ const versionWarning = [
22
+ border ,
23
+ "WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-eslint-parser." ,
24
+ "You may find that it works just fine, or you may not." ,
25
+ `SUPPORTED TYPESCRIPT VERSIONS: ${ SUPPORTED_TYPESCRIPT_VERSIONS } ` ,
26
+ `YOUR TYPESCRIPT VERSION: ${ ACTIVE_TYPESCRIPT_VERSION } ` ,
27
+ "Please only submit bug reports when using the officially supported version." ,
28
+ border
29
+ ] ;
30
+ console . log ( versionWarning . join ( "\n\n" ) ) ;
31
+ }
32
+
19
33
let extra ;
20
- let warnedAboutTSVersion = false ;
21
34
22
35
/**
23
36
* Resets the extra config object
@@ -104,21 +117,6 @@ function parse(code, options) {
104
117
105
118
}
106
119
107
- if ( ! isRunningSupportedTypeScriptVersion && ! warnedAboutTSVersion ) {
108
- const border = "=============" ;
109
- const versionWarning = [
110
- border ,
111
- "WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-eslint-parser." ,
112
- "You may find that it works just fine, or you may not." ,
113
- `SUPPORTED TYPESCRIPT VERSIONS: ${ SUPPORTED_TYPESCRIPT_VERSIONS } ` ,
114
- `YOUR TYPESCRIPT VERSION: ${ ACTIVE_TYPESCRIPT_VERSION } ` ,
115
- "Please only submit bug reports when using the officially supported version." ,
116
- border
117
- ] ;
118
- extra . log ( versionWarning . join ( "\n\n" ) ) ;
119
- warnedAboutTSVersion = true ;
120
- }
121
-
122
120
// Even if jsx option is set in typescript compiler, filename still has to
123
121
// contain .tsx file extension
124
122
const FILENAME = ( extra . ecmaFeatures . jsx ) ? "eslint.tsx" : "eslint.ts" ;
0 commit comments