@@ -67,7 +67,6 @@ module.exports = function (api) {
6767 let ignoreLib = true ;
6868 let includeRegeneratorRuntime = false ;
6969 let needsPolyfillsForOldNode = false ;
70- let dynamicESLintVersionCheck = false ;
7170
7271 let transformRuntimeOptions ;
7372
@@ -118,7 +117,6 @@ module.exports = function (api) {
118117 needsPolyfillsForOldNode = true ;
119118 break ;
120119 case "test-legacy" : // In test-legacy environment, we build babel on latest node but test on minimum supported legacy versions
121- dynamicESLintVersionCheck = true ;
122120 // fall through
123121 case "production" :
124122 // Config during builds before publish.
@@ -128,12 +126,10 @@ module.exports = function (api) {
128126 case "test" :
129127 targets = { node : "current" } ;
130128 needsPolyfillsForOldNode = true ;
131- dynamicESLintVersionCheck = true ;
132129 break ;
133130 case "development" :
134131 envOpts . debug = true ;
135132 targets = { node : "current" } ;
136- dynamicESLintVersionCheck = true ;
137133 break ;
138134 }
139135
@@ -291,10 +287,6 @@ module.exports = function (api) {
291287 exclude : / r e g e n e r a t o r - r u n t i m e / ,
292288 plugins : [ [ "@babel/transform-runtime" , transformRuntimeOptions ] ] ,
293289 } ,
294- dynamicESLintVersionCheck && {
295- test : [ "./eslint/*/src" ] . map ( normalize ) ,
296- plugins : [ pluginDynamicESLintVersionCheck ] ,
297- } ,
298290 ] . filter ( Boolean ) ,
299291 } ;
300292
@@ -815,33 +807,6 @@ function pluginBabelParserTokenType({
815807 } ;
816808}
817809
818- // Transforms
819- // ESLINT_VERSION
820- // to
821- // process.env.ESLINT_VERSION_FOR_BABEL
822- // ? parseInt(process.env.ESLINT_VERSION_FOR_BABEL, 10)
823- // : ESLINT_VERSION
824- function pluginDynamicESLintVersionCheck ( { template } ) {
825- const transformed = new WeakSet ( ) ;
826-
827- return {
828- visitor : {
829- ReferencedIdentifier ( path ) {
830- if ( path . node . name !== "ESLINT_VERSION" ) return ;
831-
832- if ( transformed . has ( path . node ) ) return ;
833- transformed . add ( path . node ) ;
834-
835- path . replaceWith ( template . expression . ast `
836- process.env.ESLINT_VERSION_FOR_BABEL
837- ? parseInt(process.env.ESLINT_VERSION_FOR_BABEL, 10)
838- : ${ path . node }
839- ` ) ;
840- } ,
841- } ,
842- } ;
843- }
844-
845810// Inject `0 && exports.foo = 0` hints for the specified exports,
846811// to help the Node.js CJS-ESM interop. This is only
847812// needed when compiling ESM re-exports to CJS in `lazy` mode.
0 commit comments