Skip to content

Commit

Permalink
Add react/js-curly-brace-presense eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Mar 15, 2023
1 parent a9fbd4f commit d63620b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions webview/src/experiments/components/table/CellRowActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const CellRowActions: React.FC<CellRowActionsProps> = ({
<CellRowAction
showSubRowStates={showSubRowStates}
subRowsAffected={selections}
testId={'row-action-checkbox'}
testId="row-action-checkbox"
tooltipContent={getTooltipContent(isRowSelected, 'select the row')}
>
<VSCodeCheckbox
Expand All @@ -114,10 +114,10 @@ export const CellRowActions: React.FC<CellRowActionsProps> = ({
<CellRowAction
showSubRowStates={showSubRowStates}
subRowsAffected={stars}
testId={'row-action-star'}
testId="row-action-star"
tooltipContent={
<ClickableTooltipContent
clickableText={'Filter experiments by starred'}
clickableText="Filter experiments by starred"
onClick={addStarredFilter}
helperText={getTooltipContent(!!starred, 'star')}
/>
Expand All @@ -144,10 +144,10 @@ export const CellRowActions: React.FC<CellRowActionsProps> = ({
<CellRowAction
showSubRowStates={showSubRowStates}
subRowsAffected={plotSelections}
testId={'row-action-plot'}
testId="row-action-plot"
tooltipContent={
<ClickableTooltipContent
clickableText={'Open the plots view'}
clickableText="Open the plots view"
helperText={getTooltipContent(!!bulletColor, 'plot')}
onClick={openPlotsWebview}
/>
Expand Down
2 changes: 1 addition & 1 deletion webview/src/experiments/components/table/Errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const ErrorTooltip: React.FC<{
{error}
</div>
}
placement={'bottom'}
placement="bottom"
disabled={!error}
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion webview/src/experiments/components/table/Indicators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const CounterBadge: React.FC<CounterBadgeProps> = ({ count }) => {
return count ? (
<span
className={styles.indicatorCount}
role={'marquee'}
role="marquee"
aria-label={`${count}`}
>
{count}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const TableHeaderCell: React.FC<{
<ContextMenu
content={menuContent}
disabled={!menuEnabled || menuSuppressed}
trigger={'contextmenu'}
trigger="contextmenu"
>
<th
{...getHeaderPropsArgs(
Expand Down
4 changes: 2 additions & 2 deletions webview/src/setup/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const App: React.FC = () => {
<>
<SetupContainer
sectionKey={Section.EXPERIMENTS}
title={'Experiments'}
title="Experiments"
sectionCollapsed={sectionCollapsed}
setSectionCollapsed={setSectionCollapsed}
>
Expand All @@ -102,7 +102,7 @@ export const App: React.FC = () => {
</SetupContainer>
<SetupContainer
sectionKey={Section.STUDIO}
title={'Studio'}
title="Studio"
sectionCollapsed={sectionCollapsed}
setSectionCollapsed={setSectionCollapsed}
>
Expand Down
10 changes: 5 additions & 5 deletions webview/src/setup/components/Studio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ const Connect: React.FC = () => {
<Button
appearance="primary"
isNested={false}
text={'Sign In'}
text="Sign In"
onClick={openStudio}
/>
<Button
appearance="secondary"
isNested={true}
text={'Get Token'}
text="Get Token"
onClick={openStudioProfile}
/>
<Button
appearance="secondary"
isNested={true}
text={'Save'}
text="Save"
onClick={saveStudioToken}
/>
<p>
Expand Down Expand Up @@ -81,13 +81,13 @@ const Settings: React.FC<{
<Button
appearance="primary"
isNested={false}
text={'Update Token'}
text="Update Token"
onClick={saveStudioToken}
/>
<Button
appearance="secondary"
isNested={true}
text={'Disconnect'}
text="Disconnect"
onClick={removeStudioToken}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion webview/src/shared/components/button/RefreshButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const RefreshButton: React.FC<RefreshButtonProps> = ({
isNested={isNested}
icon={Refresh}
onClick={onClick}
text={'Refresh'}
text="Refresh"
/>
)
}
6 changes: 3 additions & 3 deletions webview/src/shared/components/contextMenu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ContextMenu: React.FC<ContextMenuProps> = ({
<Tooltip
trigger={trigger}
delay={[100, 200]}
placement={'bottom-start'}
placement="bottom-start"
interactive
isContextMenu={true}
onTrigger={positionContextMenuAndDisableEvents}
Expand All @@ -68,8 +68,8 @@ export const ContextMenu: React.FC<ContextMenuProps> = ({
onShow={onShow}
onHide={onHide}
disabled={!content || disabled}
appendTo={'parent'}
followCursor={'initial'}
appendTo="parent"
followCursor="initial"
offset={[0, 0]}
>
{children}
Expand Down

0 comments on commit d63620b

Please sign in to comment.