-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix eslint7 ruletester improvements #10
Fix eslint7 ruletester improvements #10
Conversation
code: [ | ||
'var First = createReactClass({', | ||
' propTypes: {', | ||
' s: PropTypes.shape({,', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test code was throwing parse error :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? what parse error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, That was my misunderstanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change must revert.. 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, Now, I checked with ESLint v7.
The test is throwing error...
1) forbid-prop-types
invalid
var First = createReactClass({
propTypes: {
s: PropTypes.shape({,
o: PropTypes.object
})
},
render: function() {
return <div />;
}
});:
AssertionError [ERR_ASSERTION]: A fatal parsing error occurred: Parsing error: Unexpected token ,
+ expected - actual
-false
+true
at runRuleForItem (node_modules/eslint/lib/rule-tester/rule-tester.js:559:13)
at testInvalidTemplate (node_modules/eslint/lib/rule-tester/rule-tester.js:650:28)
at Context.RuleTester.it (node_modules/eslint/lib/rule-tester/rule-tester.js:874:25)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comma
may have been the cause ...??
{,
o: PropTypes.object
}
options: [2], | ||
errors: [{message: 'Expected indentation of 4 space characters but found 0.'}] | ||
}, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test can't pass because jsx-indent
is applying mistakenly indent.
I ignored the test. I could not understand How to fix it 😭
084ef41
to
72aeab3
Compare
code: [ | ||
'var First = createReactClass({', | ||
' propTypes: {', | ||
' s: PropTypes.shape({,', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? what parse error?
72aeab3
to
b2f1f14
Compare
https://github.com/eslint/rfcs/blob/master/designs/2019-rule-tester-improvements/README.md