-
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
Lint improvements #23
Comments
Also next issue is available with react and redux, if you don't use destructuring assignment, lint doesn't see usage of some variables, or is it correct? function Component(/*...*/) {
/*...*/
}
Component.propTypes = {
/* ... */
// linst says `PropTypes is defined but prop is never used
autoClose: PropTypes.bool,
// linst says `PropTypes is defined but prop is never used
onAccept: PropTypes.func,
};
// uasge of autoClose and onAccept
const mapDispatchToProps = (dispatch, ownProps) => ({
accept() {
const { autoClose, onAccept } = ownProps;
onAccept();
if (autoClose) {
dispatch(hideModal());
}
},
// ...
}
export default connect(null, mapDispatchToProps)(Component); |
prop isn't used within component but in the There are a bunch of related issues are filled in eslint-plugin-react repo: https://github.com/yannickcr/eslint-plugin-react/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+unused+prop There is also this ticket airbnb/javascript#1089 about overriding default rules and So I think this rule should be turned off in the base config for now. |
refs: https://github.com/airbnb/javascript#functions--signature-invocation-indentation
As Is
Allow To Do
The same issue with react and redux with
mapDispatchToProps
.chai
. (take a look this plugin: https://www.npmjs.com/package/eslint-plugin-chai-friendly)The text was updated successfully, but these errors were encountered: