Skip to content

[jsx-pascal-case] label variable fail #343

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

Closed
yordis opened this issue Dec 1, 2015 · 4 comments
Closed

[jsx-pascal-case] label variable fail #343

yordis opened this issue Dec 1, 2015 · 4 comments

Comments

@yordis
Copy link

yordis commented Dec 1, 2015

The label tag is failing on this rule

Imported JSX component label must be in PascalCase react/jsx-pascal-case

@yordis yordis changed the title component label must be in PascalCase label tag fail in pascal case rule Dec 1, 2015
@yannickcr
Copy link
Member

Can you give me a code sample that trigger that invalid lint errors ?

@playpauseandstop
Copy link

I ran into same problem today with this code,

  render() {
    const {label} = this.props;
    return <label className="...">{label}</label>;
  }

From my perspective it happens, cause ESLint seeing defined label var in current scope and considers warning for pascal-case in <label> JSX tag.

ps. I fixed the error with const {label: labelText} = this.props;

@yordis
Copy link
Author

yordis commented Dec 2, 2015

@yannickcr yep the same here
<label htmlFor={name}>{label}</label>

@yordis yordis changed the title label tag fail in pascal case rule [jsx-pascal-case] label variable fail Dec 3, 2015
@yannickcr
Copy link
Member

Seems to be a duplicate of #329

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

3 participants