@@ -16,13 +16,12 @@ const cases = [
1616 'switch (foo) {case bar: {/* */}}' ,
1717 'switch (foo) {default: {/* */}}' ,
1818 'try {/* */} catch(foo){}' ,
19- 'try {} catch(foo ){/* */}' ,
19+ 'try {} catch(bar ){/* */}' ,
2020 'try {} catch(foo){} finally {/* */}' ,
2121 'do {/* */} while (foo)' ,
2222 'while (foo){/* */}' ,
2323 'foo = () => {/* */}' ,
2424 'foo = function (){/* */}' ,
25- 'function foo(){/* */}' ,
2625 'foo = {/* */}' ,
2726 'class Foo {bar() {/* */}}' ,
2827 'foo = class {bar() {/* */}}' ,
@@ -49,11 +48,11 @@ test({
4948 ] . flatMap ( body => allCases . map ( code => code . replace ( SPACES_PLACEHOLDER , body ) ) ) ,
5049 // Not empty
5150 ...cases . map ( code => code . replace ( SPACES_PLACEHOLDER , 'unicorn' ) ) ,
52- ...classBodyCases . map ( code => code . replace ( SPACES_PLACEHOLDER , 'bar () {}' ) ) ,
51+ ...classBodyCases . map ( code => code . replace ( SPACES_PLACEHOLDER , 'baz () {}' ) ) ,
5352 // `with`
5453 {
5554 code : 'with (foo) {}' ,
56- parserOptions : { ecmaVersion : 5 , sourceType : 'script' } ,
55+ languageOptions : { ecmaVersion : 5 , sourceType : 'script' } ,
5756 } ,
5857 // We don't check these cases
5958 ...ignoredCases . map ( code => code . replace ( SPACES_PLACEHOLDER , ' ' ) ) ,
7574 code : 'with (foo) { }' ,
7675 output : 'with (foo) {}' ,
7776 errors : 1 ,
78- parserOptions : { ecmaVersion : 5 , sourceType : 'script' } ,
77+ languageOptions : { ecmaVersion : 5 , sourceType : 'script' } ,
7978 } ,
8079 ] ,
8180} ) ;
@@ -94,9 +93,11 @@ test.snapshot({
9493} ) ;
9594
9695const enableBabelPlugins = plugins => ( {
97- babelOptions : {
98- parserOpts : {
99- plugins,
96+ parserOptions : {
97+ babelOptions : {
98+ parserOpts : {
99+ plugins,
100+ } ,
100101 } ,
101102 } ,
102103} ) ;
@@ -110,19 +111,19 @@ test.babel({
110111 };
111112 ` ,
112113 output : 'const foo = do {};' ,
113- parserOptions : enableBabelPlugin ( 'doExpressions' ) ,
114+ languageOptions : enableBabelPlugin ( 'doExpressions' ) ,
114115 errors : 1 ,
115116 } ,
116117 {
117118 code : 'const record = #{ };' ,
118119 output : 'const record = #{};' ,
119- parserOptions : enableBabelPlugin ( [ 'recordAndTuple' , { syntaxType : 'hash' } ] ) ,
120+ languageOptions : enableBabelPlugin ( [ 'recordAndTuple' , { syntaxType : 'hash' } ] ) ,
120121 errors : 1 ,
121122 } ,
122123 {
123124 code : 'const record = {| |};' ,
124125 output : 'const record = {||};' ,
125- parserOptions : enableBabelPlugin ( [ 'recordAndTuple' , { syntaxType : 'bar' } ] ) ,
126+ languageOptions : enableBabelPlugin ( [ 'recordAndTuple' , { syntaxType : 'bar' } ] ) ,
126127 errors : 1 ,
127128 } ,
128129 {
@@ -137,14 +138,14 @@ test.babel({
137138 static {}
138139 }
139140 ` ,
140- parserOptions : enableBabelPlugin ( 'classStaticBlock' ) ,
141+ languageOptions : enableBabelPlugin ( 'classStaticBlock' ) ,
141142 errors : 1 ,
142143 } ,
143144 // ESLint can't parse this now
144145 // {
145146 // code: 'const foo = module { };',
146147 // output: 'const foo = module {};',
147- // parserOptions : enableBabelPlugin('moduleBlocks'),
148+ // languageOptions : enableBabelPlugin('moduleBlocks'),
148149 // errors: 1
149150 // },
150151 {
@@ -153,7 +154,7 @@ test.babel({
153154 };
154155 ` ,
155156 output : 'const foo = async do {};' ,
156- parserOptions : enableBabelPlugins ( [ 'doExpressions' , 'asyncDoExpressions' ] ) ,
157+ languageOptions : enableBabelPlugins ( [ 'doExpressions' , 'asyncDoExpressions' ] ) ,
157158 errors : 1 ,
158159 } ,
159160 ] ,
0 commit comments