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
Feature request: no-unnecessary-curly #1310
Comments
I feel convinced this already exists, but can't find it anywhere. This is an essential thing to cover; it definitely should be a rule. It would need to be separately configurable for props and children (curlies are often needed for children for explicit whitespace) to require, forbid, or ignore. |
Hello @ljharb, I would like to give this one a shot. Hopefully, I won't run into a lot of difficulties. I would appreciate any pointer though especially regarding the last thing you mentioned in your comment. Thank you! |
@jackyho112 essentially what I mean is that the rule configuration must allow an option like |
Hello @ljharb, I am working on this right now and I have one question. By If it is the latter, it doesn't seem like we need both |
I mean the former - "always require", "always prohibit", and "ignore the rule" |
Thanks for replying! I will make the changes. |
Thanks! (It'd be great if you reused #1349 instead of opening up a new PR) |
Will do! |
Very cool rule! 😄 Just out of interest, is there a technical reason that the fixer only works for one of the options (only for |
@jseminck |
I think this can be closed (via #1349) |
Yes, thanks - closed by #1349. |
I'd like to suggest a new rule which disallows this:
<MyComponent someProp={'foo'} />
where it should be:
<MyComponent someProp="foo" />
And the same for children/nodes:
<MyComponent>{'Foo'}</MyComponent>
Where it should be:
<MyComponent>Foo</MyComponent>
The text was updated successfully, but these errors were encountered: