chore: enable no-unused vars (#2181)

This commit is contained in:
Himself65
2023-04-28 00:41:06 -05:00
committed by GitHub
parent b6ca2aa063
commit 70fbbb39c1
70 changed files with 206 additions and 225 deletions

View File

@@ -14,7 +14,7 @@ export default {
const Footer = () => <div>Add Page</div>;
export const Default: StoryFn = props => {
export const Default: StoryFn = () => {
const [open, setOpen] = useAtom(appSidebarOpenAtom);
const ref = useRef<HTMLElement>(null);
return (

View File

@@ -1,6 +1,6 @@
import { absoluteCenter, displayFlex, styled } from '@affine/component';
export const StyledBigLink = styled('a')(({ theme }) => {
export const StyledBigLink = styled('a')(() => {
return {
width: '268px',
height: '76px',
@@ -57,7 +57,7 @@ export const StyledBigLink = styled('a')(({ theme }) => {
},
};
});
export const StyledSmallLink = styled('a')(({ theme }) => {
export const StyledSmallLink = styled('a')(() => {
return {
width: '124px',
height: '76px',
@@ -86,7 +86,7 @@ export const StyledSmallLink = styled('a')(({ theme }) => {
},
};
});
export const StyledSubTitle = styled('div')(({ theme }) => {
export const StyledSubTitle = styled('div')(() => {
return {
fontSize: '18px',
fontWeight: '600',
@@ -111,7 +111,7 @@ export const StyledModalHeader = styled('div')(() => {
};
});
export const StyledModalFooter = styled('div')(({ theme }) => {
export const StyledModalFooter = styled('div')(() => {
return {
fontSize: '14px',
lineHeight: '20px',
@@ -121,7 +121,7 @@ export const StyledModalFooter = styled('div')(({ theme }) => {
};
});
export const StyledPrivacyContainer = styled('div')(({ theme }) => {
export const StyledPrivacyContainer = styled('div')(() => {
return {
marginTop: '4px',
position: 'relative',

View File

@@ -1,6 +1,6 @@
import { styled, TextButton } from '@affine/component';
export const StyledModalWrapper = styled('div')(({ theme }) => {
export const StyledModalWrapper = styled('div')(() => {
return {
position: 'relative',
padding: '0px',
@@ -11,7 +11,7 @@ export const StyledModalWrapper = styled('div')(({ theme }) => {
};
});
export const StyledModalHeader = styled('div')(({ theme }) => {
export const StyledModalHeader = styled('div')(() => {
return {
margin: '44px 0px 12px 0px',
width: '560px',
@@ -21,7 +21,7 @@ export const StyledModalHeader = styled('div')(({ theme }) => {
};
});
export const StyledTextContent = styled('div')(({ theme }) => {
export const StyledTextContent = styled('div')(() => {
return {
margin: 'auto',
width: '560px',
@@ -40,7 +40,7 @@ export const StyledButtonContent = styled('div')(() => {
justifyContent: 'center',
};
});
export const StyledButton = styled(TextButton)(({ theme }) => {
export const StyledButton = styled(TextButton)(() => {
return {
color: 'var(--affine-primary-color)',
height: '32px',
@@ -50,7 +50,7 @@ export const StyledButton = styled(TextButton)(({ theme }) => {
padding: '4px 20px',
};
});
export const StyledDangerButton = styled(TextButton)(({ theme }) => {
export const StyledDangerButton = styled(TextButton)(() => {
return {
color: '#FF631F',
height: '32px',

View File

@@ -2,7 +2,7 @@ import { Button, displayFlex, styled, TextButton } from '../..';
export const StyledShareButton = styled(TextButton, {
shouldForwardProp: (prop: string) => prop !== 'isShared',
})<{ isShared?: boolean }>(({ theme, isShared }) => {
})<{ isShared?: boolean }>(({ isShared }) => {
return {
padding: '4px 8px',
marginLeft: '4px',
@@ -30,55 +30,53 @@ export const StyledTabsWrapper = styled('div')(() => {
};
});
export const TabItem = styled('li')<{ isActive?: boolean }>(
({ theme, isActive }) => {
{
return {
...displayFlex('center', 'center'),
flex: '1',
height: '30px',
color: 'var(--affine-text-primary-color)',
opacity: isActive ? 1 : 0.2,
fontWeight: '500',
fontSize: 'var(--affine-font-base)',
lineHeight: 'var(--affine-line-height)',
cursor: 'pointer',
transition: 'all 0.15s ease',
padding: '0 10px',
marginBottom: '4px',
borderRadius: '4px',
position: 'relative',
':hover': {
background: 'var(--affine-hover-color)',
opacity: 1,
color: isActive
export const TabItem = styled('li')<{ isActive?: boolean }>(({ isActive }) => {
{
return {
...displayFlex('center', 'center'),
flex: '1',
height: '30px',
color: 'var(--affine-text-primary-color)',
opacity: isActive ? 1 : 0.2,
fontWeight: '500',
fontSize: 'var(--affine-font-base)',
lineHeight: 'var(--affine-line-height)',
cursor: 'pointer',
transition: 'all 0.15s ease',
padding: '0 10px',
marginBottom: '4px',
borderRadius: '4px',
position: 'relative',
':hover': {
background: 'var(--affine-hover-color)',
opacity: 1,
color: isActive
? 'var(--affine-text-primary-color)'
: 'var(--affine-text-secondary-color)',
svg: {
fill: isActive
? 'var(--affine-text-primary-color)'
: 'var(--affine-text-secondary-color)',
svg: {
fill: isActive
? 'var(--affine-text-primary-color)'
: 'var(--affine-text-secondary-color)',
},
},
svg: {
fontSize: '20px',
marginRight: '12px',
},
':after': {
content: '""',
position: 'absolute',
bottom: '-6px',
left: '0',
width: '100%',
height: '2px',
background: 'var(--affine-text-primary-color)',
opacity: 0.2,
},
};
}
},
svg: {
fontSize: '20px',
marginRight: '12px',
},
':after': {
content: '""',
position: 'absolute',
bottom: '-6px',
left: '0',
width: '100%',
height: '2px',
background: 'var(--affine-text-primary-color)',
opacity: 0.2,
},
};
}
);
export const StyledIndicator = styled('div')(({ theme }) => {
});
export const StyledIndicator = styled('div')(() => {
return {
height: '2px',
background: 'var(--affine-text-primary-color)',
@@ -87,7 +85,7 @@ export const StyledIndicator = styled('div')(({ theme }) => {
transition: 'left .3s, width .3s',
};
});
export const StyledInput = styled('input')(({ theme }) => {
export const StyledInput = styled('input')(() => {
return {
padding: '4px 8px',
height: '28px',
@@ -101,7 +99,7 @@ export const StyledInput = styled('input')(({ theme }) => {
marginRight: '10px',
};
});
export const StyledButton = styled(TextButton)(({ theme }) => {
export const StyledButton = styled(TextButton)(() => {
return {
color: 'var(--affine-primary-color)',
height: '32px',
@@ -121,7 +119,7 @@ export const StyledDisableButton = styled(Button)(() => {
padding: '0',
};
});
export const StyledLinkSpan = styled('span')(({ theme }) => {
export const StyledLinkSpan = styled('span')(() => {
return {
marginLeft: '4px',
color: 'var(--affine-primary-color)',

View File

@@ -4,7 +4,7 @@ import type { AffineWorkspace, LocalWorkspace } from '@affine/workspace/type';
import { WorkspaceFlavour } from '@affine/workspace/type';
import { SettingsIcon } from '@blocksuite/icons';
import { useBlockSuiteWorkspaceName } from '@toeverything/hooks/use-block-suite-workspace-name';
import type { FC, MouseEvent } from 'react';
import type { FC } from 'react';
import { useCallback } from 'react';
import { WorkspaceAvatar } from '../workspace-avatar';
@@ -95,12 +95,9 @@ export const WorkspaceCard: FC<WorkspaceCardProps> = ({
return (
<StyledCard
data-testid="workspace-card"
onClick={useCallback(
(event: MouseEvent) => {
onClick(workspace);
},
[onClick, workspace]
)}
onClick={useCallback(() => {
onClick(workspace);
}, [onClick, workspace])}
active={workspace.id === currentWorkspaceId}
>
<WorkspaceAvatar size={58} workspace={workspace} />

View File

@@ -1,7 +1,7 @@
import { displayFlex, styled, textEllipsis } from '../..';
import { IconButton } from '../..';
export const StyleWorkspaceInfo = styled('div')(({ theme }) => {
export const StyleWorkspaceInfo = styled('div')(() => {
return {
marginLeft: '15px',
width: '202px',
@@ -22,7 +22,7 @@ export const StyleWorkspaceInfo = styled('div')(({ theme }) => {
};
});
export const StyleWorkspaceTitle = styled('div')(({ theme }) => {
export const StyleWorkspaceTitle = styled('div')(() => {
return {
fontSize: 'var(--affine-font-base)',
fontWeight: 600,
@@ -35,7 +35,7 @@ export const StyleWorkspaceTitle = styled('div')(({ theme }) => {
export const StyledCard = styled('div')<{
active?: boolean;
}>(({ theme, active }) => {
}>(({ active }) => {
const borderColor = active ? 'var(--affine-primary-color)' : 'transparent';
return {
width: '310px',