Skip to content

Commit

Permalink
fix: linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
akiver committed Jun 6, 2024
1 parent be8a2b7 commit bdf3131
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion linter/lingui-js-usage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ESLintUtils, ASTUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';

type Options = [];
type MessagesIds = 'useLinguiMessage' | 'transComponentMessage' | 'useI18nMessage';
type MessagesIds = 'useLinguiMessage' | 'transComponentMessage';

/**
* - Ensure we are using the internal useI18n hook instead of the useLingui hook from the @lingui/react module.
Expand Down
14 changes: 5 additions & 9 deletions src/ui/components/context-menu/context-menu-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function ContextMenuProvider({ children }: Props) {

useEffect(() => {
const wrapper = wrapperRef.current;
if (contextMenu === undefined || wrapper === null) {
if (wrapper === null) {
return;
}

Expand All @@ -77,13 +77,9 @@ export function ContextMenuProvider({ children }: Props) {
return () => {
window.removeEventListener('click', onWindowClick);
};
}, [contextMenu, hideContextMenu]);
});

useEffect(() => {
if (contextMenu === undefined) {
return;
}

const onWindowKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
hideContextMenu();
Expand All @@ -95,10 +91,10 @@ export function ContextMenuProvider({ children }: Props) {
return () => {
window.removeEventListener('keydown', onWindowKeyDown);
};
}, [contextMenu, hideContextMenu]);
});

useLayoutEffect(() => {
if (!wrapperRef.current || !contextMenu === undefined) {
if (!wrapperRef.current) {
return;
}

Expand All @@ -115,7 +111,7 @@ export function ContextMenuProvider({ children }: Props) {
}

wrapperRef.current.setAttribute('style', `left: ${x}px; top:${y}px;`);
}, [contextMenu]);
});

return (
<ContextMenuContext.Provider
Expand Down
2 changes: 1 addition & 1 deletion src/ui/demos/use-demos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function useDemos(): Demo[] {
const getDemoAnalysisStatus = useGetDemoAnalysisStatus();
const { analysisStatus } = useDemosSettings();

if (!analysisStatus === undefined || analysisStatus === AnalysisStatusFilter.All) {
if (analysisStatus === AnalysisStatusFilter.All) {
return demosState.entities;
}

Expand Down

0 comments on commit bdf3131

Please sign in to comment.