question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsx-boolean-value: don't warn if the value attribute of an <option> tag

See original GitHub issue

In my opinion the plugin should not warn when the JSX is something like <option value={ true }>True</option>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
ljharbcommented, Jan 29, 2017

Why? <option value> is equivalent and more concise.

4reactions
ljharbcommented, Jan 30, 2017

<option value={true} /> should be outputting the same thing. In other words, if you want the syntaxes to match you should do <option value={String(true)} /> instead of relying on React to coerce for you.

I don’t think an option to allow this case is a good idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

don't warn if the value attribute of an <option> tag ... - GitHub
In my opinion the plugin should not warn when the JSX is something like True.
Read more >
Using boolean-value of attributes in JSX - Stack Overflow
This approach avoids the warning Value must be omitted for boolean attributes [react/jsx-boolean-value] when the code is linted via ...
Read more >
Select - Ant Design
Select component to select value from options. When To Use. A dropdown menu for displaying choices - an elegant alternative to the native...
Read more >
styled-jsx - npm
The plugin accepts a type option to configure whether the styles should be scoped , global or resolve (see above). By default its...
Read more >
DOM Elements - React
In React, all DOM properties and attributes (including event handlers) should ... If you want to mark an <option> as selected, reference the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found