`react/jsx-boolean-value` rule has invalid options
See original GitHub issueThe rule is configured like this:
'react/jsx-boolean-value': ['error', 'never', { always: [] }]
However, an inspection of the rule’s schema shows that its “exception schema” (that is, the third element of the array that specifies exceptions to the the second element) expects the array provided to have at least one element in it:
const exceptionsSchema = {
type: 'array',
items: {type: 'string', minLength: 1},
uniqueItems: true
};
What was the rationale for changing the rule’s options? It seems like
'react/jsx-boolean-value': ['error', 'never']
would achieve the same thing and be compliant with the rule’s schema.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12
Top Results From Across the Web
Using boolean-value of attributes in JSX - Stack Overflow
You can just omit the value assignment; the attribute will be assigned a value of true by default. Instead of doing any of:...
Read more >Boolean - JavaScript - MDN Web Docs
Any object, including a Boolean object whose value is false , evaluates to true when passed to a conditional statement.
Read more >eslint/eslint - Gitter
If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin- ......
Read more >https://unpkg.com/pretty-interaction-icons@1.1.5/....
root: true, parser: 'babel-eslint', plugins: [/*'import', */'jsx-a11y', 'react'], env: { browser: true, commonjs: true, es6: true, jest: true, ...
Read more >Props · Styleguide JavaScript
Omit the value of the prop when it is explicitly true . ESLint: react/jsx-boolean-value. Examples. ⇣ Incorrect code for this rule: <Snow falling={ ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@llamaluvr no, I have no idea what fixed it. A good night’s rest?
@milotoor any idea what cleared things up for your IDE? I get this error in VSCode after upgrading to the latest airbnb eslint rules and now none of the rules flag in there. Seems like I’m up-to-date on everything (see below).
EDIT: actually, I get the same error from the eslint command-line.