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.

`react/jsx-boolean-value` rule has invalid options

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

2reactions
milotoorcommented, Oct 17, 2017

@llamaluvr no, I have no idea what fixed it. A good night’s rest?

2reactions
keith-kurakcommented, Oct 17, 2017

@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).

"devDependencies": {
    "babel-eslint": "^7.2.3",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-stage-2": "^6.24.1",
    "eslint": "^4.9.0",
    "eslint-config-airbnb": "^16.0.1",
    "eslint-config-universe": "^1.0.6",
    "eslint-import-resolver-react-native": "^0.0.1",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-jsx-a11y": "^6.0.2",
    "eslint-plugin-react": "^7.0.1",
    "jest-expo": "~21.0.0",
    "prettier": "1.7.4",
    "react-test-renderer": "16.0.0-alpha.12"
  },

EDIT: actually, I get the same error from the eslint command-line.

Read more comments on GitHub >

github_iconTop 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 >

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