From 95fb62a3a38f7f2e67aa53b22854823c8842344b Mon Sep 17 00:00:00 2001 From: hlomzik Date: Sat, 30 Sep 2023 18:35:49 +0100 Subject: [PATCH] chore: Update eslint config from our other repo (#1456) * chore: Update eslint config from our other repo Outdated commit was set in yarn.lock, preventing linting rules from being updated. * Apply new linting rules: fix whitespaces --------- Co-authored-by: hlomzik --- src/assets/icons/outliner/index.ts | 2 +- src/common/Dropdown/DropdownTrigger.tsx | 4 +- src/common/Range/Range.tsx | 18 ++++----- src/common/Select/Select.tsx | 2 +- src/common/TextArea/TextArea.tsx | 2 +- src/common/TimeAgo/TimeAgo.tsx | 2 +- src/common/Userpic/Userpic.tsx | 2 +- .../AnnotationsCarousel/AnnotationButton.tsx | 4 +- .../AnnotationsCarousel.tsx | 2 +- .../__tests__/sampleData.js | 4 +- src/components/App/Annotation.js | 2 +- src/components/App/Grid.js | 4 +- src/components/BottomBar/Controls.js | 16 ++++---- src/components/Comments/CommentForm.tsx | 4 +- src/components/Comments/Comments.tsx | 2 +- .../CurrentEntity/AnnotationHistory.tsx | 4 +- src/components/Entities/LabelList.js | 26 ++++++------- src/components/Entities/RegionItem.js | 10 ++--- src/components/Entities/RegionTree.js | 4 +- src/components/Filter/Filter.tsx | 6 +-- src/components/Filter/FilterRow.tsx | 10 ++--- .../Filter/__tests__/Filter.test.tsx | 2 +- .../Filter/__tests__/FilterRow.test.tsx | 2 +- .../Filter/__tests__/filter-utils.test.tsx | 6 +-- src/components/Filter/filter-util.ts | 12 +++--- src/components/Filter/types/Number.js | 4 +- src/components/Filter/types/String.js | 2 +- src/components/HtxTextBox/HtxTextBox.js | 2 +- .../ImageTransformer/LSTransformer.js | 2 +- .../ImageView/SuggestionControls.js | 2 +- src/components/RelationsOverlay/Geometry.js | 2 +- .../RelationsOverlay/RelationsOverlay.js | 2 +- .../Settings/TagSettings/SettingsRenderer.tsx | 2 +- .../SidePanels/DetailsPanel/DetailsPanel.tsx | 2 +- .../SidePanels/DetailsPanel/Relations.tsx | 8 ++-- .../SidePanels/OutlinerPanel/OutlinerTree.tsx | 38 +++++++++---------- src/components/SidePanels/PanelBase.tsx | 4 +- src/components/SidePanels/SidePanels.tsx | 10 ++--- .../SidePanels/TabPanels/PanelTabsBase.tsx | 8 ++-- .../SidePanels/TabPanels/SideTabsPanels.tsx | 16 ++++---- src/components/SidePanels/TabPanels/Tabs.tsx | 4 +- .../TabPanels/__tests__/utils.test.tsx | 10 ++--- src/components/SidePanels/TabPanels/types.ts | 6 +-- src/components/SidePanels/TabPanels/utils.ts | 10 ++--- .../SidePanels/__tests__/PanelBase.test.tsx | 2 +- src/components/Taxonomy/Taxonomy.tsx | 2 +- .../TimeDurationControl/TimeBox.tsx | 6 +-- src/components/Timeline/Controls/Slider.tsx | 4 +- src/components/Timeline/Plugins/Timeline.tsx | 8 ++-- src/components/Timeline/SideControls/index.ts | 2 +- src/components/Timeline/Views/Frames/Utils.ts | 4 +- src/components/Timeline/Views/Wave/Wave.tsx | 2 +- src/components/Toolbar/FlyoutMenu.js | 2 +- src/components/Toolbar/Tool.js | 10 ++--- src/components/TopBar/Actions.js | 2 +- src/components/TopBar/Annotations.js | 2 +- src/components/TopBar/Controls.js | 12 +++--- src/components/TopBar/TopBar.js | 2 +- src/components/VideoCanvas/VideoCanvas.tsx | 8 ++-- src/core/External.js | 4 +- src/core/__tests__/repeater.test.js | 10 ++--- src/hooks/useRegionColor.ts | 2 +- src/lib/AudioUltra/Common/Color.ts | 2 +- src/lib/AudioUltra/Common/Utils.ts | 6 +-- src/lib/AudioUltra/Cursor/Cursor.ts | 4 +- src/lib/AudioUltra/Timeline/Timeline.ts | 24 ++++++------ src/lib/AudioUltra/Visual/Loader.ts | 2 +- src/lib/AudioUltra/Visual/PlayHead.ts | 22 +++++------ src/mixins/IsReadyMixin.js | 2 +- src/mixins/PerItem.js | 2 +- src/mixins/Regions.js | 2 +- src/mixins/Required.js | 2 +- src/mixins/TagParentMixin.js | 2 +- src/regions/AliveRegion.tsx | 2 +- src/regions/AudioRegion/AudioRegionModel.js | 6 +-- .../AudioRegion/AudioUltraRegionModel.js | 2 +- src/stores/Comment/Comment.js | 10 ++--- src/stores/Comment/CommentStore.js | 18 ++++----- src/stores/SettingsStore.js | 4 +- src/tags/control/DateTime.js | 2 +- src/tags/control/Pairwise.js | 2 +- src/tags/control/Polygon.js | 2 +- src/tags/control/Rating.js | 2 +- src/tags/object/MultiItemObjectBase.js | 2 +- src/tags/object/Paragraphs/AuthorFilter.js | 2 +- src/tags/object/Paragraphs/HtxParagraphs.js | 6 +-- src/tags/object/Paragraphs/Phrases.js | 6 +-- src/tags/object/Paragraphs/index.js | 2 +- src/tags/object/TimeSeries/Channel.js | 10 ++--- src/tags/object/TimeSeries/helpers.js | 2 +- src/tags/object/TimeSeries/symbols.js | 2 +- src/tags/object/Video/Rectangle.tsx | 2 +- src/tags/object/Video/TransformTools.ts | 6 +-- src/tags/object/Video/VideoRegions.js | 4 +- src/tools/Base.js | 2 +- src/tools/MagicWand.js | 2 +- src/tools/Rect.js | 2 +- src/utils/InputMask.ts | 4 +- src/utils/bboxCoords.js | 2 +- src/utils/data.js | 2 +- src/utils/dom.ts | 2 +- src/utils/html.js | 8 ++-- src/utils/image.js | 4 +- src/utils/resize-observer.ts | 4 +- src/utils/utilities.ts | 4 +- yarn.lock | 2 +- 106 files changed, 286 insertions(+), 286 deletions(-) diff --git a/src/assets/icons/outliner/index.ts b/src/assets/icons/outliner/index.ts index 47d1f935a2..ac66b3762c 100644 --- a/src/assets/icons/outliner/index.ts +++ b/src/assets/icons/outliner/index.ts @@ -3,4 +3,4 @@ export { ReactComponent as IconOutlinerExpand } from './expand.svg'; export { ReactComponent as IconOutlinerDrag } from './drag.svg'; export { ReactComponent as IconInfo } from './info.svg'; export { ReactComponent as IconOutlinerEyeOpened } from './eye_opened.svg'; -export { ReactComponent as IconOutlinerEyeClosed } from './eye_closed.svg'; \ No newline at end of file +export { ReactComponent as IconOutlinerEyeClosed } from './eye_closed.svg'; diff --git a/src/common/Dropdown/DropdownTrigger.tsx b/src/common/Dropdown/DropdownTrigger.tsx index addf09e883..f245ed44e6 100644 --- a/src/common/Dropdown/DropdownTrigger.tsx +++ b/src/common/Dropdown/DropdownTrigger.tsx @@ -10,7 +10,7 @@ const getMinIndex = (element?: HTMLElement) => { if (element) { let parent = element.parentElement; - while(parent) { + while (parent) { const parentIndex = parseInt(getComputedStyle(parent).zIndex); if (!isNaN(parentIndex)) { @@ -43,7 +43,7 @@ export const DropdownTrigger = forwardRef(({ closeOnClickOutside = true, disabled = false, ...props -}, ref ) => { +}, ref) => { const dropdownRef = (ref ?? useRef()) as RefObject; const triggerEL = Children.only(children); const childset = useRef(new Set()); diff --git a/src/common/Range/Range.tsx b/src/common/Range/Range.tsx index 35dd34337f..a7454ca9b8 100644 --- a/src/common/Range/Range.tsx +++ b/src/common/Range/Range.tsx @@ -27,21 +27,21 @@ export interface RangeProps { onMaxIconClick?: (value: RangeValueType) => void; } -const arrayReverse = (array: T, reverse=false) => { +const arrayReverse = (array: T, reverse = false) => { return reverse ? [...array].reverse() : array; }; export const Range: FC = ({ value, defaultValue, - multi=false, - reverse=false, - continuous=false, - min=0, - max=100, - step=1, - size=120, - align='horizontal', + multi = false, + reverse = false, + continuous = false, + min = 0, + max = 100, + step = 1, + size = 120, + align = 'horizontal', resetValue, minIcon, maxIcon, diff --git a/src/common/Select/Select.tsx b/src/common/Select/Select.tsx index 118ea13395..868ee14adb 100644 --- a/src/common/Select/Select.tsx +++ b/src/common/Select/Select.tsx @@ -124,7 +124,7 @@ export const Select: SelectComponent = ({ const selected = useMemo(() => { if (isFF(FF_DEV_2669) && multiple && renderMultipleSelected) { - return renderMultipleSelected(Array.isArray(currentValue) ? currentValue : [currentValue||'']); + return renderMultipleSelected(Array.isArray(currentValue) ? currentValue : [currentValue || '']); } if (multiple && Array.isArray(currentValue) && currentValue?.length > 1) { return <>Multiple values selected; diff --git a/src/common/TextArea/TextArea.tsx b/src/common/TextArea/TextArea.tsx index aa3343a2f3..759c937305 100644 --- a/src/common/TextArea/TextArea.tsx +++ b/src/common/TextArea/TextArea.tsx @@ -72,7 +72,7 @@ export const TextArea: FC = ({ let newHeight: number; - if(textarea.scrollHeight > autoGrowRef.current.maxHeight){ + if (textarea.scrollHeight > autoGrowRef.current.maxHeight) { textarea.style.overflowY = 'scroll'; newHeight = autoGrowRef.current.maxHeight; } else { diff --git a/src/common/TimeAgo/TimeAgo.tsx b/src/common/TimeAgo/TimeAgo.tsx index df03ab50e3..6eb577b222 100644 --- a/src/common/TimeAgo/TimeAgo.tsx +++ b/src/common/TimeAgo/TimeAgo.tsx @@ -65,4 +65,4 @@ export const TimeAgo = ({ date, ...rest }: TimeAgoProps) => { {text} ); -}; \ No newline at end of file +}; diff --git a/src/common/Userpic/Userpic.tsx b/src/common/Userpic/Userpic.tsx index 89bc6b68fa..fbaf2da957 100644 --- a/src/common/Userpic/Userpic.tsx +++ b/src/common/Userpic/Userpic.tsx @@ -43,7 +43,7 @@ export const Userpic = forwardRef(({ const [nameVisible, setNameVisible] = useState(true); if (isFF(FF_DEV_1507)) { - useEffect(()=>{ + useEffect(() => { if (propsSrc !== finalSrc) { setFinalSrc(propsSrc); setImgVisible(false); diff --git a/src/components/AnnotationsCarousel/AnnotationButton.tsx b/src/components/AnnotationsCarousel/AnnotationButton.tsx index c2a13ded8e..a66290b6ab 100644 --- a/src/components/AnnotationsCarousel/AnnotationButton.tsx +++ b/src/components/AnnotationsCarousel/AnnotationButton.tsx @@ -2,7 +2,7 @@ import { Block, Elem } from '../../utils/bem'; import { Userpic } from '../../common/Userpic/Userpic'; import { IconAnnotationGroundTruth, IconAnnotationSkipped2, IconDraftCreated2, IconDuplicate, IconEllipsis, IconTrashRect, LsCommentResolved, LsCommentUnresolved, LsSparks, LsStar, LsStarOutline } from '../../assets/icons'; import { userDisplayName } from '../../utils/utilities'; -import { TimeAgo } from '../../common/TimeAgo/TimeAgo'; +import { TimeAgo } from '../../common/TimeAgo/TimeAgo'; import './AnnotationButton.styl'; import { useCallback, useEffect, useState } from 'react'; import { Dropdown } from '../../common/Dropdown/Dropdown'; @@ -214,7 +214,7 @@ export const AnnotationButton = observer(({ entity, capabilities, annotationStor } - onToggle={(isVisible)=> setIsContextMenuOpen(isVisible)} + onToggle={(isVisible) => setIsContextMenuOpen(isVisible)} > diff --git a/src/components/AnnotationsCarousel/AnnotationsCarousel.tsx b/src/components/AnnotationsCarousel/AnnotationsCarousel.tsx index f7d7a870c3..2783edd528 100644 --- a/src/components/AnnotationsCarousel/AnnotationsCarousel.tsx +++ b/src/components/AnnotationsCarousel/AnnotationsCarousel.tsx @@ -81,5 +81,5 @@ export const AnnotationsCarousel = observer(({ store, annotationStore }: Annotat )} - ): null; + ) : null; }); diff --git a/src/components/AnnotationsCarousel/__tests__/sampleData.js b/src/components/AnnotationsCarousel/__tests__/sampleData.js index fc696e1b8f..1ee62fa510 100644 --- a/src/components/AnnotationsCarousel/__tests__/sampleData.js +++ b/src/components/AnnotationsCarousel/__tests__/sampleData.js @@ -2800,7 +2800,7 @@ const annotationStore = { 'validation': null, 'sharedStores': {}, }; -const commentStore = { 'loading':'list','comments':[] }; +const commentStore = { 'loading': 'list','comments': [] }; const store = { 'config': '\\n ', 'task': { @@ -6031,4 +6031,4 @@ const store = { 'hasInterface': () => true, }; -export { annotationStore, commentStore, store }; \ No newline at end of file +export { annotationStore, commentStore, store }; diff --git a/src/components/App/Annotation.js b/src/components/App/Annotation.js index 057769d072..2226f6ad2c 100644 --- a/src/components/App/Annotation.js +++ b/src/components/App/Annotation.js @@ -11,4 +11,4 @@ export function Annotation({ annotation, root }) { }; }, [annotation.pk, annotation.id]); return root ? Tree.renderItem(root, annotation) : null; -} \ No newline at end of file +} diff --git a/src/components/App/Grid.js b/src/components/App/Grid.js index af4c8d094e..1fea7bbef9 100644 --- a/src/components/App/Grid.js +++ b/src/components/App/Grid.js @@ -24,12 +24,12 @@ class Item extends Component { return o.isReady ? Promise.resolve(o.isReady) : new Promise(resolve => { - const dispose = observe(o, 'isReady', ()=>{ + const dispose = observe(o, 'isReady', () => { dispose(); resolve(); }); }); - })).then(()=>{ + })).then(() => { // ~2 ticks for canvas to be rendered and resized completely setTimeout(this.props.onFinish, 32); }); diff --git a/src/components/BottomBar/Controls.js b/src/components/BottomBar/Controls.js index 323683f0b9..0104de6d04 100644 --- a/src/components/BottomBar/Controls.js +++ b/src/components/BottomBar/Controls.js @@ -51,10 +51,10 @@ export const Controls = controlsInjector(observer(({ store, history, annotation const selected = store.annotationStore?.selected; - if(addedCommentThisSession){ + if (addedCommentThisSession) { selected?.submissionInProgress(); callback(); - } else if((currentComment ?? '').trim()) { + } else if ((currentComment ?? '').trim()) { e.preventDefault(); selected?.submissionInProgress(); await commentFormSubmit(); @@ -75,8 +75,8 @@ export const Controls = controlsInjector(observer(({ store, history, annotation const RejectButton = useMemo(() => { return ( -