Skip to content

Commit 0743c41

Browse files
committed
[Tests] improve babel parser options
1 parent 9fd9856 commit 0743c41

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/helpers/parsers.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const parsers = {
3030
'@babel/plugin-syntax-function-bind',
3131
['@babel/plugin-syntax-decorators', { legacy: true }],
3232
],
33+
parserOpts: {
34+
allowSuperOutsideMethod: false,
35+
allowReturnOutsideFunction: false,
36+
},
3337
},
3438
ecmaFeatures: Object.assign(
3539
{},
@@ -95,7 +99,10 @@ const parsers = {
9599

96100
return [].concat(
97101
skipBase ? [] : addComment(test, 'default'),
98-
skipOldBabel ? [] : addComment(Object.assign({}, test, { parser: parsers.BABEL_ESLINT }), 'babel-eslint'),
102+
skipOldBabel ? [] : addComment(Object.assign({}, test, {
103+
parser: parsers.BABEL_ESLINT,
104+
parserOptions: parsers.babelParserOptions(test, features),
105+
}), 'babel-eslint'),
99106
skipNewBabel ? [] : addComment(Object.assign({}, test, {
100107
parser: parsers['@BABEL_ESLINT'],
101108
parserOptions: parsers.babelParserOptions(test, features),

0 commit comments

Comments
 (0)