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

(cosmetic) Quote this as this in the no-this-in-sfc rule #2616

Merged
merged 1 commit into from Apr 13, 2020

Conversation

mrflip
Copy link
Contributor

@mrflip mrflip commented Apr 4, 2020

I had a "Who's on First?" moment looking at no-this-in-sfc's error message: `Stateless functional components should not use this'.

In this case this message caused this hacker to seek the referent of "this" in this rule (that is, no-this-in-sfc) which was not a this or a that in general, or this line qua this, but then saw that the "this" in this line of the no-this-in-sfc rule that the linter was telling me to not this in an sfc was in fact the this on this line of this function, because the this of this kind of component isn't used the way the this of that other kind of component is, like to sometimes set the state of its state and such, which, to state the obvious, is the sine qua non of a stateless functional component, as a stateless functional component is a functional component without state (as stated in the docs).

So...

I put quotes around the word this, and made the error documentation a little noob-friendlier, as we are the most likely to misuse this thus.

hashtag nope-not-stir-crazy-at-all...

This error's "this" references some `this` in this line, not this line or another that.
Quoting this in `no-this-in-sfc` not thus but as `this` might clear this up.
@mrflip mrflip changed the title (cosmetic) Quote this as this in the no-this-in-sfc rule (cosmetic) Quote this as this in the no-this-in-sfc rule Apr 4, 2020
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Made a few tweaks including adding an Oxford comma.

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

Successfully merging this pull request may close these issues.

None yet

2 participants