@@ -13,8 +13,10 @@ const disableNewTS = semver.satisfies(tsParserVersion, '>= 4.1') // this rule is
13
13
14
14
function minEcmaVersion ( features , parserOptions ) {
15
15
const minEcmaVersionForFeatures = {
16
+ 'export-default-from' : 2018 ,
16
17
'class fields' : 2022 ,
17
18
'optional chaining' : 2020 ,
19
+ 'arbitrary-export-names' : 2022 ,
18
20
} ;
19
21
const result = Math . max . apply (
20
22
Math ,
@@ -102,7 +104,8 @@ const parsers = {
102
104
&& typeof testObject . errors !== 'number'
103
105
&& {
104
106
errors : testObject . errors . map (
105
- ( errorObject ) => {
107
+ ( error ) => {
108
+ const errorObject = typeof error === 'string' ? { message : error } : error ;
106
109
const nextSuggestions = errorObject . suggestions && {
107
110
suggestions : errorObject . suggestions . map ( ( suggestion ) => Object . assign ( { } , suggestion , {
108
111
output : suggestion . output + extraComment ,
@@ -125,20 +128,24 @@ const parsers = {
125
128
126
129
const skipBase = ( features . has ( 'class fields' ) && semver . satisfies ( version , '< 8' ) )
127
130
|| ( es >= 2020 && semver . satisfies ( version , '< 6' ) )
131
+ || ( features . has ( 'arbitrary-export-names' ) && semver . satisfies ( version , '< 8.7' ) )
128
132
|| features . has ( 'no-default' )
129
133
|| features . has ( 'bind operator' )
130
134
|| features . has ( 'do expressions' )
131
135
|| features . has ( 'decorators' )
132
136
|| features . has ( 'flow' )
133
137
|| features . has ( 'ts' )
134
138
|| features . has ( 'types' )
135
- || ( features . has ( 'fragment' ) && semver . satisfies ( version , '< 5' ) ) ;
139
+ //if it has fragments use version 5 and higher // create features for export from
140
+ || ( features . has ( 'fragment' ) && semver . satisfies ( version , '< 5' ) )
141
+ || features . has ( 'export-default-from' ) ;
136
142
137
143
const skipBabel = features . has ( 'no-babel' ) ;
138
144
const skipOldBabel = skipBabel || features . has ( 'no-babel-old' ) || semver . satisfies ( version , '>= 8' ) ;
139
145
const skipNewBabel = skipBabel
140
146
|| features . has ( 'no-babel-new' )
141
147
|| ! semver . satisfies ( version , '^7.5.0' ) // require('@babel/eslint-parser/package.json').peerDependencies.eslint
148
+ || features . has ( 'export-default-from' ) // TODO: figure out how to configure babel for this
142
149
|| features . has ( 'flow' )
143
150
|| features . has ( 'types' )
144
151
|| features . has ( 'ts' ) ;
@@ -147,7 +154,9 @@ const parsers = {
147
154
|| features . has ( 'flow' )
148
155
|| features . has ( 'jsx namespace' )
149
156
|| features . has ( 'bind operator' )
150
- || features . has ( 'do expressions' ) ;
157
+ || features . has ( 'do expressions' )
158
+ || features . has ( 'arbitrary-export-names' ) // TODO: figure out which TS version starts supporting this
159
+ || features . has ( 'export-default-from' ) ; // TODO: figure out which TS version starts supporting this
151
160
const tsOld = ! skipTS && ! features . has ( 'no-ts-old' ) ;
152
161
const tsNew = ! skipTS && ! features . has ( 'no-ts-new' ) ;
153
162
0 commit comments