From d63620b8ec1af2c4aee0ad3546bdab60231595e4 Mon Sep 17 00:00:00 2001 From: Matt Seddon Date: Wed, 15 Mar 2023 12:53:42 +1100 Subject: [PATCH] Add react/js-curly-brace-presense eslint rule --- .eslintrc.js | 4 ++++ .../experiments/components/table/CellRowActions.tsx | 10 +++++----- webview/src/experiments/components/table/Errors.tsx | 2 +- .../src/experiments/components/table/Indicators.tsx | 2 +- .../components/table/header/TableHeaderCell.tsx | 2 +- webview/src/setup/components/App.tsx | 4 ++-- webview/src/setup/components/Studio.tsx | 10 +++++----- webview/src/shared/components/button/RefreshButton.tsx | 2 +- .../src/shared/components/contextMenu/ContextMenu.tsx | 6 +++--- 9 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 251a6a0ff0..25dcf10bb1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -150,6 +150,10 @@ module.exports = { 'no-void': ['error', { allowAsStatement: true }], 'no-warning-comments': 'error', quotes: ['error', 'single', { avoidEscape: true }], + 'react/jsx-curly-brace-presence': [ + 'error', + { props: 'never', children: 'never' } + ], 'react-hooks/exhaustive-deps': 'error', 'react-hooks/rules-of-hooks': 'error', // This project doesn't use prop types diff --git a/webview/src/experiments/components/table/CellRowActions.tsx b/webview/src/experiments/components/table/CellRowActions.tsx index 9eb4c9936f..9293b5be23 100644 --- a/webview/src/experiments/components/table/CellRowActions.tsx +++ b/webview/src/experiments/components/table/CellRowActions.tsx @@ -103,7 +103,7 @@ export const CellRowActions: React.FC = ({ = ({ @@ -144,10 +144,10 @@ export const CellRowActions: React.FC = ({ diff --git a/webview/src/experiments/components/table/Errors.tsx b/webview/src/experiments/components/table/Errors.tsx index 281f239403..8eff065d73 100644 --- a/webview/src/experiments/components/table/Errors.tsx +++ b/webview/src/experiments/components/table/Errors.tsx @@ -14,7 +14,7 @@ export const ErrorTooltip: React.FC<{ {error} } - placement={'bottom'} + placement="bottom" disabled={!error} > {children} diff --git a/webview/src/experiments/components/table/Indicators.tsx b/webview/src/experiments/components/table/Indicators.tsx index 9e0f41d838..cfb9ba17c9 100644 --- a/webview/src/experiments/components/table/Indicators.tsx +++ b/webview/src/experiments/components/table/Indicators.tsx @@ -22,7 +22,7 @@ export const CounterBadge: React.FC = ({ count }) => { return count ? ( {count} diff --git a/webview/src/experiments/components/table/header/TableHeaderCell.tsx b/webview/src/experiments/components/table/header/TableHeaderCell.tsx index 8bb81e405e..26eac1b0f8 100644 --- a/webview/src/experiments/components/table/header/TableHeaderCell.tsx +++ b/webview/src/experiments/components/table/header/TableHeaderCell.tsx @@ -158,7 +158,7 @@ export const TableHeaderCell: React.FC<{ { <> @@ -102,7 +102,7 @@ export const App: React.FC = () => { diff --git a/webview/src/setup/components/Studio.tsx b/webview/src/setup/components/Studio.tsx index d9a745c584..c9789194ae 100644 --- a/webview/src/setup/components/Studio.tsx +++ b/webview/src/setup/components/Studio.tsx @@ -30,19 +30,19 @@ const Connect: React.FC = () => {