@@ -268,7 +268,8 @@ ruleTester.run('default-props-match-prop-types', rule, {
268268 'Greeting.defaultProps = {' ,
269269 ' foo: "foo"' ,
270270 '};'
271- ] . join ( '\n' )
271+ ] . join ( '\n' ) ,
272+ parser : parsers . BABEL_ESLINT
272273 } ,
273274 {
274275 code : [
@@ -530,7 +531,8 @@ ruleTester.run('default-props-match-prop-types', rule, {
530531 ' ...defaults,' ,
531532 ' bar: "bar"' ,
532533 '};'
533- ] . join ( '\n' )
534+ ] . join ( '\n' ) ,
535+ parser : parsers . BABEL_ESLINT
534536 } ,
535537
536538 //
@@ -845,6 +847,26 @@ ruleTester.run('default-props-match-prop-types', rule, {
845847 column : 3
846848 } ]
847849 } ,
850+ {
851+ code : [
852+ 'function MyStatelessComponent({ foo, bar }) {' ,
853+ ' return <div>{foo}{bar}</div>;' ,
854+ '}' ,
855+ 'MyStatelessComponent.propTypes = {' ,
856+ ' foo: React.PropTypes.string,' ,
857+ ' bar: React.PropTypes.string.isRequired' ,
858+ '};' ,
859+ 'MyStatelessComponent.defaultProps = {' ,
860+ ' baz: "baz"' ,
861+ '};'
862+ ] . join ( '\n' ) ,
863+ errors : [ {
864+ message : 'defaultProp "baz" has no corresponding propTypes declaration.' ,
865+ line : 9 ,
866+ column : 3
867+ } ] ,
868+ parser : parsers . BABEL_ESLINT
869+ } ,
848870 {
849871 code : [
850872 'function MyStatelessComponent({ foo, bar }) {' ,
@@ -1348,25 +1370,6 @@ ruleTester.run('default-props-match-prop-types', rule, {
13481370 column : 5
13491371 } ]
13501372 } ,
1351- {
1352- code : [
1353- 'function MyStatelessComponent({ foo, bar }) {' ,
1354- ' return <div>{foo}{bar}</div>;' ,
1355- '}' ,
1356- 'MyStatelessComponent.propTypes = {' ,
1357- ' foo: React.PropTypes.string,' ,
1358- ' bar: React.PropTypes.string.isRequired' ,
1359- '};' ,
1360- 'MyStatelessComponent.defaultProps = {' ,
1361- ' baz: "baz"' ,
1362- '};'
1363- ] . join ( '\n' ) ,
1364- errors : [ {
1365- message : 'defaultProp "baz" has no corresponding propTypes declaration.' ,
1366- line : 9 ,
1367- column : 3
1368- } ]
1369- } ,
13701373 {
13711374 code : [
13721375 'class Greeting extends React.Component {' ,
0 commit comments