Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add react/jsx-curly-brace-presence eslint rule #3471

Merged
merged 2 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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={SetupSection.EXPERIMENTS}
title={'Experiments'}
title="Experiments"
sectionCollapsed={sectionCollapsed}
setSectionCollapsed={setSectionCollapsed}
>
Expand All @@ -102,7 +102,7 @@ export const App: React.FC = () => {
</SetupContainer>
<SetupContainer
sectionKey={SetupSection.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