Skip to content

Commit

Permalink
[Tests] improve babel parser options
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 3, 2021
1 parent 9fd9856 commit 0743c41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/helpers/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const parsers = {
'@babel/plugin-syntax-function-bind',
['@babel/plugin-syntax-decorators', { legacy: true }],
],
parserOpts: {
allowSuperOutsideMethod: false,
allowReturnOutsideFunction: false,
},
},
ecmaFeatures: Object.assign(
{},
Expand Down Expand Up @@ -95,7 +99,10 @@ const parsers = {

return [].concat(
skipBase ? [] : addComment(test, 'default'),
skipOldBabel ? [] : addComment(Object.assign({}, test, { parser: parsers.BABEL_ESLINT }), 'babel-eslint'),
skipOldBabel ? [] : addComment(Object.assign({}, test, {
parser: parsers.BABEL_ESLINT,
parserOptions: parsers.babelParserOptions(test, features),
}), 'babel-eslint'),
skipNewBabel ? [] : addComment(Object.assign({}, test, {
parser: parsers['@BABEL_ESLINT'],
parserOptions: parsers.babelParserOptions(test, features),
Expand Down

0 comments on commit 0743c41

Please sign in to comment.