Skip to content
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

react/jsx-indent-props #2828

Closed
jarretmoses opened this issue Oct 14, 2020 · 3 comments
Closed

react/jsx-indent-props #2828

jarretmoses opened this issue Oct 14, 2020 · 3 comments

Comments

@jarretmoses
Copy link

jarretmoses commented Oct 14, 2020

I just upgraded to v 7.21.4 And it seems this rule is not properly detecting the spacing in a couple places that had worked before this version. (The @typescript-eslint/indent I also have is working fine). I attached the photo where its not correctly noticing the spacing I have as it is fine as is and I am doing very similar types of spacing in my codebase where this rul is not complaining. This kinda exposed the fact it seems like I have redundant rules and can just rely on the @typescript-eslint rule but I figured I'd put this here anyways.
Screen Shot 2020-10-14 at 4 04 32 PM

export const DKListingDetailItem = ({
  label,
  text,
  classNames = '',
  testid = '',
  children,
}: Props) => {
  const detail = typeof text === 'string'
    ? <p>{text}</p>
    // eslint-disable-next-line react/no-array-index-key
    : text.map((textDetail, i) => <p key={`textDetail${i}`}>{textDetail}</p>);

  return (
    <div
      className={`dk-listing-detail-item__section-container ${classNames}`.trim()}
      data-testid={testid}
    >
      <h4 className='dk-listing-detail-item__section-label'>{label}</h4>
      {detail}
      {children}
    </div>
  );
};
@jarretmoses
Copy link
Author

jarretmoses commented Oct 14, 2020

An interesting note. If I remove the ternary above the return JSX the error goes away.

@ljharb
Copy link
Member

ljharb commented Oct 14, 2020

I believe this is fixed by #2826.

@jarretmoses
Copy link
Author

ah thanks @ljharb Ill close this and wait for the next release to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants