Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
feat(react): enforce using ternary for conditional rendering
Browse files Browse the repository at this point in the history
BREAKING CHANGE: conditional rendering must be done via a ternary operator
  • Loading branch information
vuki656 committed Jul 7, 2022
1 parent f6afc5a commit 3c79f96
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -44,10 +44,10 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-jest-formatting": "^3.1.0",
"eslint-plugin-mobx": "^0.0.8",
"eslint-plugin-mobx": "^0.0.9",
"eslint-plugin-more": "^1.0.5",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-sonarjs": "^0.12.0",
"eslint-plugin-sort-class-members": "^1.14.1",
Expand Down
4 changes: 4 additions & 0 deletions react.js
Expand Up @@ -74,6 +74,10 @@ module.exports = {
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-useless-fragment': ['error', { 'allowExpressions': true }],
"react/jsx-no-leaked-render": [
"error",
{ "validStrategies": ["ternary"] }
],
'react/jsx-one-expression-per-line': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-props-no-multi-spaces': 'error',
Expand Down

0 comments on commit 3c79f96

Please sign in to comment.