1.3.2 • Published 2 years ago
eslint-plugin-jsx-expressions v1.3.2
eslint-plugin-jsx-expressions
Rules for safe logical expressions in JSX
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-jsx-expressions:
npm install eslint-plugin-jsx-expressions --save-devUsage
Add jsx-expressions to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": ["jsx-expressions"]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"jsx-expressions/strict-logical-expressions": "error"
}
}Supported Rules
- jsx-expressions/strict-logical-expressions: Enforces logical "&&" expressions do not use potentially falsey numbers or strings.