-
Notifications
You must be signed in to change notification settings - Fork 26.7k
newline-per-chained-call
and PropTypes
#748
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
Comments
If I understand the rule correctly, and the configuration we have here, I would expect your In which case, you should be able to resolve this by first destructuring /* @flow */
import React from 'react';
const { PropTypes } = React;
class Baz extends React.Component {
static propTypes = {
foo: PropTypes.oneOf(['nice', 'bad']),
bar: PropTypes.instanceOf(Date).isRequired,
};
// ...
} |
Ho you right! I've build this example from actual code, and only the If the only solution is to play with the import { default as React, PropTypes } from 'react'; |
@Spy-Seth What does
? |
I believe that this syntax might happen work: import React, { PropTypes } from 'react'; However, since I'd like to throw in a plug for import-js, an editor plugin I've been working on that helps you add imports to your files. Check it out! :) |
I'm starting to think this particular rule might be a bit odd - it's called "newline per chained call" but it's counting property access (which is not a "call"). imo none of those examples should be throwing. @yannickcr, what do you think? |
There is an issue opened on eslint for that rule. It appears to be a bug. eslint/eslint#5289 IMO, this rule should be turned off until that issue is resolved. |
Agreed. |
Published as v6.0.1. We'll re-enable this rule once |
That's solution resolve my issue 😄 👍 |
This got fixed in 2.3.0, BTW. |
Hi everyone,
I'm facing a some trouble with one rule: how do you define
PropTypes
with thenewline-per-chained-call
rule activated?The text was updated successfully, but these errors were encountered: