From ecb4bfcc3b64c900d247e4d4e8a40a64f3d796c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=C3=ABl=20Gallon?= Date: Sat, 30 Jul 2022 09:28:48 +0200 Subject: [PATCH] Fix: no-unused-vars and remove eslint-disable in files (#862) * Fix eslint no-unused-vars * Remove eslint-disable in files --- .../core/src/TLShapeUtil/TLShapeUtil.spec.tsx | 3 --- packages/core/src/TLShapeUtil/TLShapeUtil.tsx | 2 -- packages/core/src/components/Bounds/Bounds.tsx | 1 - .../core/src/components/Bounds/BoundsBg.tsx | 1 - packages/core/src/components/Canvas/Canvas.tsx | 2 -- packages/core/src/components/Page/Page.tsx | 1 - .../src/components/Renderer/Renderer.test.tsx | 2 +- .../core/src/components/Renderer/Renderer.tsx | 1 - .../src/components/Shape/RenderedShape.tsx | 1 - packages/core/src/components/User/User.tsx | 2 -- .../UsersIndicators/UsersIndicators.tsx | 1 - packages/core/src/hooks/useBoundsEvents.tsx | 1 - packages/core/src/hooks/useCameraCss.tsx | 1 - packages/core/src/hooks/usePosition.ts | 1 - .../core/src/hooks/usePreventNavigationCss.tsx | 1 - packages/core/src/hooks/useShapeTree.tsx | 3 --- packages/core/src/hooks/useTLContext.tsx | 1 - packages/core/src/hooks/useZoomEvents.ts | 2 -- packages/core/src/test/ContextWrapper.tsx | 1 - packages/core/src/types.ts | 3 --- packages/core/src/utils/polyfills.ts | 3 --- packages/core/src/utils/utils.ts | 7 ------- packages/intersect/src/index.ts | 8 -------- .../tldraw/src/components/Loading/Loading.tsx | 1 - .../components/Primitives/Divider/Divider.tsx | 1 - .../src/components/ToolsPanel/ShapesMenu.tsx | 4 ---- .../TopPanel/LanguageMenu/LanguageMenu.tsx | 4 ++-- .../PreferencesMenu/PreferencesMenu.tsx | 18 +----------------- .../TopPanel/StyleMenu/StyleMenu.tsx | 9 +-------- packages/tldraw/src/components/breakpoints.tsx | 1 - packages/tldraw/src/constants.ts | 1 - packages/tldraw/src/state/TLDR.ts | 3 --- packages/tldraw/src/state/TldrawApp.spec.ts | 1 - packages/tldraw/src/state/TldrawApp.ts | 6 ------ .../state/commands/alignShapes/alignShapes.ts | 1 - .../distributeShapes/distributeShapes.ts | 1 - .../duplicateShapes/duplicateShapes.spec.ts | 1 - .../duplicateShapes/duplicateShapes.ts | 1 - .../commands/groupShapes/groupShapes.spec.ts | 1 - .../state/commands/groupShapes/groupShapes.ts | 1 - .../insertContent/insertContent.spec.ts | 1 - .../commands/insertContent/insertContent.ts | 1 - .../moveShapesToPage/moveShapesToPage.ts | 1 - .../commands/shared/removeShapesFromPage.ts | 3 +-- .../commands/stretchShapes/stretchShapes.ts | 1 - .../toggleShapesDecoration.spec.ts | 2 +- .../translateShapes/translateShapes.spec.ts | 1 - .../ungroupShapes/ungroupShapes.spec.ts | 1 - packages/tldraw/src/state/data/filesystem.ts | 1 - packages/tldraw/src/state/data/migrate.ts | 3 --- .../sessions/ArrowSession/ArrowSession.ts | 1 - .../sessions/EditSession/EditSession.spec.ts | 2 +- .../state/sessions/EditSession/EditSession.ts | 1 - .../state/sessions/GridSession/GridSession.ts | 1 - .../RotateSession/RotateSession.spec.ts | 2 +- .../sessions/RotateSession/RotateSession.ts | 2 +- .../TransformSession/TransformSession.ts | 3 +-- .../TransformSingleSession.ts | 1 - .../TranslateLabelSession.spec.ts | 3 --- .../TranslateSession/TranslateSession.ts | 4 ---- .../src/state/shapes/DrawUtil/DrawUtil.tsx | 2 -- .../src/state/shapes/StickyUtil/StickyUtil.tsx | 1 - .../tldraw/src/state/shapes/TDShapeUtil.tsx | 2 -- .../src/state/shapes/TextUtil/TextUtil.tsx | 2 -- .../src/state/shapes/shared/getTextSize.ts | 1 - packages/tldraw/src/state/tools/BaseTool.ts | 1 - packages/tldraw/src/test/badDocument.spec.ts | 1 - packages/tldraw/src/types.ts | 4 ---- 68 files changed, 11 insertions(+), 142 deletions(-) diff --git a/packages/core/src/TLShapeUtil/TLShapeUtil.spec.tsx b/packages/core/src/TLShapeUtil/TLShapeUtil.spec.tsx index a49800dc2..9d44868ea 100644 --- a/packages/core/src/TLShapeUtil/TLShapeUtil.spec.tsx +++ b/packages/core/src/TLShapeUtil/TLShapeUtil.spec.tsx @@ -1,7 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from 'react' - -/* eslint-disable @typescript-eslint/no-unused-vars */ import type { TLShape, TLBounds, TLComponentProps } from '../types' import { TLShapeUtil } from './TLShapeUtil' import { render } from '@testing-library/react' diff --git a/packages/core/src/TLShapeUtil/TLShapeUtil.tsx b/packages/core/src/TLShapeUtil/TLShapeUtil.tsx index 37695cc39..454cf6dad 100644 --- a/packages/core/src/TLShapeUtil/TLShapeUtil.tsx +++ b/packages/core/src/TLShapeUtil/TLShapeUtil.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from 'react' import Utils from '../utils' import type { TLBounds, TLComponentProps, TLForwardedRef, TLShape, TLUser } from '../types' @@ -34,7 +33,6 @@ export abstract class TLShapeUtil()) } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return this.refMap.get(shape.id)! } diff --git a/packages/core/src/components/Bounds/Bounds.tsx b/packages/core/src/components/Bounds/Bounds.tsx index 90d15f7f9..7d0e5b180 100644 --- a/packages/core/src/components/Bounds/Bounds.tsx +++ b/packages/core/src/components/Bounds/Bounds.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as React from 'react' import { TLBoundsEdge, TLBoundsCorner, TLBounds } from '~types' import { CenterHandle } from './CenterHandle' diff --git a/packages/core/src/components/Bounds/BoundsBg.tsx b/packages/core/src/components/Bounds/BoundsBg.tsx index ac4ebf593..a53f8b670 100644 --- a/packages/core/src/components/Bounds/BoundsBg.tsx +++ b/packages/core/src/components/Bounds/BoundsBg.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { observer } from 'mobx-react-lite' import * as React from 'react' import type { TLBounds } from '~types' diff --git a/packages/core/src/components/Canvas/Canvas.tsx b/packages/core/src/components/Canvas/Canvas.tsx index a2984a634..d672e7686 100644 --- a/packages/core/src/components/Canvas/Canvas.tsx +++ b/packages/core/src/components/Canvas/Canvas.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from 'react' import { observer } from 'mobx-react-lite' import { @@ -25,7 +24,6 @@ import { Brush } from '~components/Brush' import { Page } from '~components/Page' import { Users } from '~components/Users' import { useResizeObserver } from '~hooks/useResizeObserver' -import { inputs } from '~inputs' import { UsersIndicators } from '~components/UsersIndicators' import { SnapLines } from '~components/SnapLines/SnapLines' import { Grid } from '~components/Grid' diff --git a/packages/core/src/components/Page/Page.tsx b/packages/core/src/components/Page/Page.tsx index f69e4507c..6e00c4699 100644 --- a/packages/core/src/components/Page/Page.tsx +++ b/packages/core/src/components/Page/Page.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { observer } from 'mobx-react-lite' import * as React from 'react' import type { TLAssets, TLBinding, TLPage, TLPageState, TLShape } from '~types' diff --git a/packages/core/src/components/Renderer/Renderer.test.tsx b/packages/core/src/components/Renderer/Renderer.test.tsx index ce0763f81..489c18ee2 100644 --- a/packages/core/src/components/Renderer/Renderer.test.tsx +++ b/packages/core/src/components/Renderer/Renderer.test.tsx @@ -3,7 +3,7 @@ import { mockDocument, mockUtils } from '~test' import { act, render } from '@testing-library/react' import { Renderer } from './Renderer' import { action, makeAutoObservable } from 'mobx' -import type { TLBinding, TLBounds, TLPage, TLPageState } from '~types' +import type { TLBounds, TLPage, TLPageState } from '~types' import Utils from '~utils' import type { BoxShape } from '~TLShapeUtil/TLShapeUtil.spec' import Vec from '@tldraw/vec' diff --git a/packages/core/src/components/Renderer/Renderer.tsx b/packages/core/src/components/Renderer/Renderer.tsx index 3f2457cc3..8210e15ba 100644 --- a/packages/core/src/components/Renderer/Renderer.tsx +++ b/packages/core/src/components/Renderer/Renderer.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { observer } from 'mobx-react-lite' import * as React from 'react' import type { diff --git a/packages/core/src/components/Shape/RenderedShape.tsx b/packages/core/src/components/Shape/RenderedShape.tsx index 78fa8c982..7d8667edf 100644 --- a/packages/core/src/components/Shape/RenderedShape.tsx +++ b/packages/core/src/components/Shape/RenderedShape.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { observer } from 'mobx-react-lite' import * as React from 'react' import type { TLComponentProps, TLShape } from '~types' diff --git a/packages/core/src/components/User/User.tsx b/packages/core/src/components/User/User.tsx index 82737b426..1907671f9 100644 --- a/packages/core/src/components/User/User.tsx +++ b/packages/core/src/components/User/User.tsx @@ -1,5 +1,3 @@ -/* eslint-disable no-inner-declarations */ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as React from 'react' import type { TLShape, TLUser } from '~types' diff --git a/packages/core/src/components/UsersIndicators/UsersIndicators.tsx b/packages/core/src/components/UsersIndicators/UsersIndicators.tsx index 645b8e855..69ab9a23d 100644 --- a/packages/core/src/components/UsersIndicators/UsersIndicators.tsx +++ b/packages/core/src/components/UsersIndicators/UsersIndicators.tsx @@ -1,5 +1,4 @@ import * as React from 'react' -/* eslint-disable @typescript-eslint/no-explicit-any */ import { ShapeIndicator } from '~components/ShapeIndicator' import type { TLPage, TLShape, TLUsers } from '~types' import Utils from '~utils' diff --git a/packages/core/src/hooks/useBoundsEvents.tsx b/packages/core/src/hooks/useBoundsEvents.tsx index 41c5b9b32..f8e7e3bb7 100644 --- a/packages/core/src/hooks/useBoundsEvents.tsx +++ b/packages/core/src/hooks/useBoundsEvents.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from 'react' import { useTLContext } from './useTLContext' diff --git a/packages/core/src/hooks/useCameraCss.tsx b/packages/core/src/hooks/useCameraCss.tsx index b88ecb20c..b5316f379 100644 --- a/packages/core/src/hooks/useCameraCss.tsx +++ b/packages/core/src/hooks/useCameraCss.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { autorun } from 'mobx' import * as React from 'react' import type { TLPageState } from '../types' diff --git a/packages/core/src/hooks/usePosition.ts b/packages/core/src/hooks/usePosition.ts index f72a66e99..0becd5396 100644 --- a/packages/core/src/hooks/usePosition.ts +++ b/packages/core/src/hooks/usePosition.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { autorun } from 'mobx' import * as React from 'react' import type { TLBounds } from '../types' diff --git a/packages/core/src/hooks/usePreventNavigationCss.tsx b/packages/core/src/hooks/usePreventNavigationCss.tsx index 525af3981..5d8f8c509 100644 --- a/packages/core/src/hooks/usePreventNavigationCss.tsx +++ b/packages/core/src/hooks/usePreventNavigationCss.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import * as React from 'react' import { useTLContext } from './useTLContext' diff --git a/packages/core/src/hooks/useShapeTree.tsx b/packages/core/src/hooks/useShapeTree.tsx index 21e35e658..42ea9e3bd 100644 --- a/packages/core/src/hooks/useShapeTree.tsx +++ b/packages/core/src/hooks/useShapeTree.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as React from 'react' import type { IShapeTreeNode, @@ -59,7 +57,6 @@ function addToShapeTree>( .filter(Boolean) // TODO: Find cases where shapes would be missing. .sort((a, b) => a.childIndex - b.childIndex) .forEach((childShape) => - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion addToShapeTree( childShape, node.children!, diff --git a/packages/core/src/hooks/useTLContext.tsx b/packages/core/src/hooks/useTLContext.tsx index d994df04b..37f02b542 100644 --- a/packages/core/src/hooks/useTLContext.tsx +++ b/packages/core/src/hooks/useTLContext.tsx @@ -3,7 +3,6 @@ import type { Inputs } from '~inputs' import type { TLCallbacks, TLShape, TLBounds, TLPageState } from '~types' import type { TLShapeUtilsMap } from '~TLShapeUtil' -// eslint-disable-next-line @typescript-eslint/no-explicit-any export interface TLContextType { id?: string callbacks: Partial> diff --git a/packages/core/src/hooks/useZoomEvents.ts b/packages/core/src/hooks/useZoomEvents.ts index f8bb10637..39aa525bf 100644 --- a/packages/core/src/hooks/useZoomEvents.ts +++ b/packages/core/src/hooks/useZoomEvents.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import * as React from 'react' import { useTLContext } from './useTLContext' import { Handler, useGesture, WebKitGestureEvent } from '@use-gesture/react' diff --git a/packages/core/src/test/ContextWrapper.tsx b/packages/core/src/test/ContextWrapper.tsx index de1e95c2b..72443e6df 100644 --- a/packages/core/src/test/ContextWrapper.tsx +++ b/packages/core/src/test/ContextWrapper.tsx @@ -27,6 +27,5 @@ export const ContextWrapper = ({ children }: { children: any }) => { }, })) - // eslint-disable-next-line @typescript-eslint/no-explicit-any return {children} } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 48f435fdf..21391245f 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/* eslint-disable @typescript-eslint/no-explicit-any */ /* --------------------- Primary -------------------- */ import type React from 'react' @@ -353,7 +351,6 @@ export interface IShapeTreeNode { /* -------------------------------------------------- */ export type MappedByType = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [P in T['type']]: T extends any ? (P extends T['type'] ? T : never) : never } diff --git a/packages/core/src/utils/polyfills.ts b/packages/core/src/utils/polyfills.ts index c86244231..32f764419 100644 --- a/packages/core/src/utils/polyfills.ts +++ b/packages/core/src/utils/polyfills.ts @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -/* eslint-disable no-extend-native */ - /** * String.prototype.replaceAll() polyfill * https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/ diff --git a/packages/core/src/utils/utils.ts b/packages/core/src/utils/utils.ts index 61d6f53db..590bcd8a2 100644 --- a/packages/core/src/utils/utils.ts +++ b/packages/core/src/utils/utils.ts @@ -1,7 +1,4 @@ /* eslint-disable @typescript-eslint/no-extra-semi */ -/* eslint-disable @typescript-eslint/ban-types */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable no-redeclare */ import type React from 'react' import { TLBounds, TLBoundsCorner, SnapPoints, Snap, TLBoundsEdge } from '../types' import { Vec } from '@tldraw/vec' @@ -38,7 +35,6 @@ export class Utils { static lerpColor(color1: string, color2: string, factor = 0.5): string { function h2r(hex: string) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)! return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] } @@ -1291,7 +1287,6 @@ left past the initial left edge) then swap points on that axis. * getFromCache(boundsCache, shape, (cache) => cache.set(shape, "value")) *``` */ - // eslint-disable-next-line @typescript-eslint/ban-types static getFromCache(cache: WeakMap, item: I, getNext: () => V): V { let value = cache.get(item) @@ -1330,7 +1325,6 @@ left past the initial left edge) then swap points on that axis. * Debounce a function. */ static debounce void>(fn: T, ms = 0) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any let timeoutId: number | any return function (...args: Parameters) { clearTimeout(timeoutId) @@ -1448,7 +1442,6 @@ left past the initial left edge) then swap points on that axis. setTimeout(() => (inThrottle = false), limit) - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore lastResult = func(...args) } diff --git a/packages/intersect/src/index.ts b/packages/intersect/src/index.ts index 60bf48888..6a9acfca5 100644 --- a/packages/intersect/src/index.ts +++ b/packages/intersect/src/index.ts @@ -988,21 +988,13 @@ export function intersectEllipseRectangle( * @param _r2 */ export function intersectEllipseEllipse( - // eslint-disable-next-line @typescript-eslint/no-unused-vars _c1: number[], - // eslint-disable-next-line @typescript-eslint/no-unused-vars _rx1: number, - // eslint-disable-next-line @typescript-eslint/no-unused-vars _ry1: number, - // eslint-disable-next-line @typescript-eslint/no-unused-vars _r1: number, - // eslint-disable-next-line @typescript-eslint/no-unused-vars _c2: number[], - // eslint-disable-next-line @typescript-eslint/no-unused-vars _rx2: number, - // eslint-disable-next-line @typescript-eslint/no-unused-vars _ry2: number, - // eslint-disable-next-line @typescript-eslint/no-unused-vars _r2: number ): TLIntersection { // TODO diff --git a/packages/tldraw/src/components/Loading/Loading.tsx b/packages/tldraw/src/components/Loading/Loading.tsx index 468555b9f..f7fafdb04 100644 --- a/packages/tldraw/src/components/Loading/Loading.tsx +++ b/packages/tldraw/src/components/Loading/Loading.tsx @@ -1,6 +1,5 @@ import * as React from 'react' import { FormattedMessage } from 'react-intl' -import { Panel } from '~components/Primitives/Panel' import { useTldrawApp } from '~hooks' import { styled } from '~styles' import type { TDSnapshot } from '~types' diff --git a/packages/tldraw/src/components/Primitives/Divider/Divider.tsx b/packages/tldraw/src/components/Primitives/Divider/Divider.tsx index a919c4f5a..e40d75d41 100644 --- a/packages/tldraw/src/components/Primitives/Divider/Divider.tsx +++ b/packages/tldraw/src/components/Primitives/Divider/Divider.tsx @@ -1,4 +1,3 @@ -import * as React from 'react' import { styled } from '~styles' export const Divider = styled('hr', { diff --git a/packages/tldraw/src/components/ToolsPanel/ShapesMenu.tsx b/packages/tldraw/src/components/ToolsPanel/ShapesMenu.tsx index d225da116..07f335c36 100644 --- a/packages/tldraw/src/components/ToolsPanel/ShapesMenu.tsx +++ b/packages/tldraw/src/components/ToolsPanel/ShapesMenu.tsx @@ -34,10 +34,6 @@ const shapeShapeIcons = { [TDShapeType.Line]: , } -enum Status { - SpacePanning = 'spacePanning', -} - const dockPositionState = (s: TDSnapshot) => s.settings.dockPosition export const ShapesMenu = React.memo(function ShapesMenu({ diff --git a/packages/tldraw/src/components/TopPanel/LanguageMenu/LanguageMenu.tsx b/packages/tldraw/src/components/TopPanel/LanguageMenu/LanguageMenu.tsx index 76d7bc510..2f99dc3a5 100644 --- a/packages/tldraw/src/components/TopPanel/LanguageMenu/LanguageMenu.tsx +++ b/packages/tldraw/src/components/TopPanel/LanguageMenu/LanguageMenu.tsx @@ -10,7 +10,7 @@ import { Divider } from '~components/Primitives/Divider' const languageSelector = (s: TDSnapshot) => s.settings.language -export const LanguageMenu = React.forwardRef((props, ref) => { +export const LanguageMenu = () => { const app = useTldrawApp() const language = app.useStore(languageSelector) @@ -48,4 +48,4 @@ export const LanguageMenu = React.forwardRef((props, ref) => { ) -}) +} diff --git a/packages/tldraw/src/components/TopPanel/PreferencesMenu/PreferencesMenu.tsx b/packages/tldraw/src/components/TopPanel/PreferencesMenu/PreferencesMenu.tsx index ffa02daae..80dece76a 100644 --- a/packages/tldraw/src/components/TopPanel/PreferencesMenu/PreferencesMenu.tsx +++ b/packages/tldraw/src/components/TopPanel/PreferencesMenu/PreferencesMenu.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { FormattedMessage, useIntl } from 'react-intl' -import { DMCheckboxItem, DMDivider, DMSubMenu } from '~components/Primitives/DropdownMenu' +import { DMCheckboxItem, DMSubMenu } from '~components/Primitives/DropdownMenu' import { useTldrawApp } from '~hooks' import { TDDockPosition, TDExportBackground, TDSnapshot } from '~types' import { styled } from '~styles' @@ -28,30 +28,14 @@ export function PreferencesMenu() { app.setSetting('isFocusMode', (v) => !v) }, [app]) - const toggleRotateHandle = React.useCallback(() => { - app.setSetting('showRotateHandles', (v) => !v) - }, [app]) - const toggleGrid = React.useCallback(() => { app.setSetting('showGrid', (v) => !v) }, [app]) - const toggleBoundShapesHandle = React.useCallback(() => { - app.setSetting('showBindingHandles', (v) => !v) - }, [app]) - - const toggleisSnapping = React.useCallback(() => { - app.setSetting('isSnapping', (v) => !v) - }, [app]) - const toggleKeepStyleMenuOpen = React.useCallback(() => { app.setSetting('keepStyleMenuOpen', (v) => !v) }, [app]) - const toggleCloneControls = React.useCallback(() => { - app.setSetting('showCloneHandles', (v) => !v) - }, [app]) - const toggleCadSelectMode = React.useCallback(() => { app.setSetting('isCadSelectMode', (v) => !v) }, [app]) diff --git a/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx b/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx index 7022f1ddb..295893fd1 100644 --- a/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx +++ b/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx @@ -3,12 +3,7 @@ import * as DropdownMenu from '@radix-ui/react-dropdown-menu' import { strokes, fills, defaultTextStyle } from '~state/shapes/shared/shape-styles' import { FormattedMessage } from 'react-intl' import { useTldrawApp } from '~hooks' -import { - DMCheckboxItem, - DMContent, - DMDivider, - DMRadioItem, -} from '~components/Primitives/DropdownMenu' +import { DMCheckboxItem, DMContent, DMRadioItem } from '~components/Primitives/DropdownMenu' import { CircleIcon, DashDashedIcon, @@ -141,12 +136,10 @@ export const StyleMenu = React.memo(function ColorMenu() { STYLE_KEYS.forEach((key) => { if (overrides.has(key)) return if (commonStyle[key] === undefined) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore commonStyle[key] = shape.style[key] } else { if (commonStyle[key] === shape.style[key]) return - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore commonStyle[key] = shape.style[key] overrides.add(key) diff --git a/packages/tldraw/src/components/breakpoints.tsx b/packages/tldraw/src/components/breakpoints.tsx index cfac67ca1..caee8a5a2 100644 --- a/packages/tldraw/src/components/breakpoints.tsx +++ b/packages/tldraw/src/components/breakpoints.tsx @@ -2,7 +2,6 @@ /* Breakpoints */ /* -------------------------------------------------- */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export const breakpoints: any = { '@initial': 'mobile', '@micro': 'micro', diff --git a/packages/tldraw/src/constants.ts b/packages/tldraw/src/constants.ts index dd2483d84..348619435 100644 --- a/packages/tldraw/src/constants.ts +++ b/packages/tldraw/src/constants.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ export const LETTER_SPACING = '-0.03em' export const LINE_HEIGHT = 1 export const GRID_SIZE = 8 diff --git a/packages/tldraw/src/state/TLDR.ts b/packages/tldraw/src/state/TLDR.ts index 8f77cbf89..397d58791 100644 --- a/packages/tldraw/src/state/TLDR.ts +++ b/packages/tldraw/src/state/TLDR.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { TLBounds, TLTransformInfo, Utils, TLPageState } from '@tldraw/core' import { TDSnapshot, @@ -23,9 +22,7 @@ import { BINDING_DISTANCE } from '~constants' const isDev = process.env.NODE_ENV === 'development' export class TLDR { - // eslint-disable-next-line @typescript-eslint/no-explicit-any static getShapeUtil(type: T['type']): TDShapeUtil - // eslint-disable-next-line @typescript-eslint/no-explicit-any static getShapeUtil(shape: T): TDShapeUtil static getShapeUtil(shape: T | T['type']) { return getShapeUtil(shape) diff --git a/packages/tldraw/src/state/TldrawApp.spec.ts b/packages/tldraw/src/state/TldrawApp.spec.ts index 2b7ca9782..12d34e7aa 100644 --- a/packages/tldraw/src/state/TldrawApp.spec.ts +++ b/packages/tldraw/src/state/TldrawApp.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { mockDocument, TldrawTestApp } from '~test' import { ArrowShape, ColorStyle, SessionType, TDShapeType } from '~types' import { deepCopy } from './StateManager/copy' diff --git a/packages/tldraw/src/state/TldrawApp.ts b/packages/tldraw/src/state/TldrawApp.ts index 98121e338..33612cdac 100644 --- a/packages/tldraw/src/state/TldrawApp.ts +++ b/packages/tldraw/src/state/TldrawApp.ts @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Vec } from '@tldraw/vec' import { TLBoundsEventHandler, @@ -85,8 +82,6 @@ import { StateManager } from './StateManager' import { clearPrevSize } from './shapes/shared/getTextSize' import { getClipboard, setClipboard } from './IdbClipboard' import { deepCopy } from './StateManager/copy' -import { getTranslation } from '~translations' -import { TextUtil } from './shapes/TextUtil' const uuid = Utils.uniqueId() @@ -2732,7 +2727,6 @@ export class TldrawApp extends StateManager { const { session } = this if (!session) return this - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const patch = session.update() if (!patch) return this diff --git a/packages/tldraw/src/state/commands/alignShapes/alignShapes.ts b/packages/tldraw/src/state/commands/alignShapes/alignShapes.ts index 50518b775..9b9b75b94 100644 --- a/packages/tldraw/src/state/commands/alignShapes/alignShapes.ts +++ b/packages/tldraw/src/state/commands/alignShapes/alignShapes.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Vec } from '@tldraw/vec' import { Utils } from '@tldraw/core' import { AlignType, TldrawCommand, TDShapeType } from '~types' diff --git a/packages/tldraw/src/state/commands/distributeShapes/distributeShapes.ts b/packages/tldraw/src/state/commands/distributeShapes/distributeShapes.ts index 7c5d6f0d8..6eadc89a7 100644 --- a/packages/tldraw/src/state/commands/distributeShapes/distributeShapes.ts +++ b/packages/tldraw/src/state/commands/distributeShapes/distributeShapes.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Utils } from '@tldraw/core' import { DistributeType, TDShape, TldrawCommand, TDShapeType } from '~types' import { TLDR } from '~state/TLDR' diff --git a/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.spec.ts b/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.spec.ts index 7d142d299..6c050bbc2 100644 --- a/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.spec.ts +++ b/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Utils } from '@tldraw/core' import { TLDR } from '~state/TLDR' import { mockDocument, TldrawTestApp } from '~test' diff --git a/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.ts b/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.ts index bc96926f6..746662e69 100644 --- a/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.ts +++ b/packages/tldraw/src/state/commands/duplicateShapes/duplicateShapes.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Utils } from '@tldraw/core' import { Vec } from '@tldraw/vec' import { TLDR } from '~state/TLDR' diff --git a/packages/tldraw/src/state/commands/groupShapes/groupShapes.spec.ts b/packages/tldraw/src/state/commands/groupShapes/groupShapes.spec.ts index c4d0c7660..ffe3af481 100644 --- a/packages/tldraw/src/state/commands/groupShapes/groupShapes.spec.ts +++ b/packages/tldraw/src/state/commands/groupShapes/groupShapes.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { mockDocument, TldrawTestApp } from '~test' import { GroupShape, TDShape, TDShapeType } from '~types' diff --git a/packages/tldraw/src/state/commands/groupShapes/groupShapes.ts b/packages/tldraw/src/state/commands/groupShapes/groupShapes.ts index 3182c4630..dc343720f 100644 --- a/packages/tldraw/src/state/commands/groupShapes/groupShapes.ts +++ b/packages/tldraw/src/state/commands/groupShapes/groupShapes.ts @@ -116,7 +116,6 @@ export function groupShapes( const shape = otherEffectedGroups.pop() if (!shape) break - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const nextChildren = (beforeShapes[shape.id]?.children || shape.children)!.filter( (childId) => childId && !(idsToGroup.includes(childId) || deletedGroupIds.includes(childId)) ) diff --git a/packages/tldraw/src/state/commands/insertContent/insertContent.spec.ts b/packages/tldraw/src/state/commands/insertContent/insertContent.spec.ts index b5d48ae92..626a8da70 100644 --- a/packages/tldraw/src/state/commands/insertContent/insertContent.spec.ts +++ b/packages/tldraw/src/state/commands/insertContent/insertContent.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Utils } from '@tldraw/core' import { TLDR } from '~state/TLDR' import { mockDocument, TldrawTestApp } from '~test' diff --git a/packages/tldraw/src/state/commands/insertContent/insertContent.ts b/packages/tldraw/src/state/commands/insertContent/insertContent.ts index 5d16ddf6c..a38162ced 100644 --- a/packages/tldraw/src/state/commands/insertContent/insertContent.ts +++ b/packages/tldraw/src/state/commands/insertContent/insertContent.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Utils } from '@tldraw/core' import { Vec } from '@tldraw/vec' import { TLDR } from '~state/TLDR' diff --git a/packages/tldraw/src/state/commands/moveShapesToPage/moveShapesToPage.ts b/packages/tldraw/src/state/commands/moveShapesToPage/moveShapesToPage.ts index 9c081c085..c2aabce6f 100644 --- a/packages/tldraw/src/state/commands/moveShapesToPage/moveShapesToPage.ts +++ b/packages/tldraw/src/state/commands/moveShapesToPage/moveShapesToPage.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { ArrowShape, PagePartial, TldrawCommand, TDShape } from '~types' import type { TldrawApp } from '../../internal' import { TLDR } from '~state/TLDR' diff --git a/packages/tldraw/src/state/commands/shared/removeShapesFromPage.ts b/packages/tldraw/src/state/commands/shared/removeShapesFromPage.ts index 7fc7c40b5..4e6bfcc91 100644 --- a/packages/tldraw/src/state/commands/shared/removeShapesFromPage.ts +++ b/packages/tldraw/src/state/commands/shared/removeShapesFromPage.ts @@ -1,5 +1,5 @@ import { TLDR } from '~state/TLDR' -import type { ArrowShape, GroupShape, PagePartial, TDPage, TDSnapshot } from '~types' +import type { ArrowShape, GroupShape, PagePartial, TDSnapshot } from '~types' export function removeShapesFromPage(data: TDSnapshot, ids: string[], pageId: string) { const before: PagePartial = { @@ -51,7 +51,6 @@ export function removeShapesFromPage(data: TDSnapshot, ids: string[], pageId: st deletedIds.add(parent.id) before.shapes[parent.id] = { children: parent.children } after.shapes[parent.id] = { children: parent.children.filter((id) => !ids.includes(id)) } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion if (after.shapes[parent.id]?.children!.length === 0) { after.shapes[parent.id] = undefined before.shapes[parent.id] = TLDR.getShape(data, parent.id, pageId) diff --git a/packages/tldraw/src/state/commands/stretchShapes/stretchShapes.ts b/packages/tldraw/src/state/commands/stretchShapes/stretchShapes.ts index c6f8291d3..2f87a5e63 100644 --- a/packages/tldraw/src/state/commands/stretchShapes/stretchShapes.ts +++ b/packages/tldraw/src/state/commands/stretchShapes/stretchShapes.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { TLBoundsCorner, Utils } from '@tldraw/core' import { StretchType, TDShapeType } from '~types' import type { TldrawCommand } from '~types' diff --git a/packages/tldraw/src/state/commands/toggleShapesDecoration/toggleShapesDecoration.spec.ts b/packages/tldraw/src/state/commands/toggleShapesDecoration/toggleShapesDecoration.spec.ts index 201605df4..614ed51f7 100644 --- a/packages/tldraw/src/state/commands/toggleShapesDecoration/toggleShapesDecoration.spec.ts +++ b/packages/tldraw/src/state/commands/toggleShapesDecoration/toggleShapesDecoration.spec.ts @@ -1,4 +1,4 @@ -import { mockDocument, TldrawTestApp } from '~test' +import { TldrawTestApp } from '~test' import { ArrowShape, Decoration, TDShapeType } from '~types' describe('Toggle decoration command', () => { diff --git a/packages/tldraw/src/state/commands/translateShapes/translateShapes.spec.ts b/packages/tldraw/src/state/commands/translateShapes/translateShapes.spec.ts index e40825570..f104a8a30 100644 --- a/packages/tldraw/src/state/commands/translateShapes/translateShapes.spec.ts +++ b/packages/tldraw/src/state/commands/translateShapes/translateShapes.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { mockDocument, TldrawTestApp } from '~test' import { ArrowShape, SessionType, TDShapeType } from '~types' diff --git a/packages/tldraw/src/state/commands/ungroupShapes/ungroupShapes.spec.ts b/packages/tldraw/src/state/commands/ungroupShapes/ungroupShapes.spec.ts index 50e40b76c..4baa488fb 100644 --- a/packages/tldraw/src/state/commands/ungroupShapes/ungroupShapes.spec.ts +++ b/packages/tldraw/src/state/commands/ungroupShapes/ungroupShapes.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { mockDocument, TldrawTestApp } from '~test' import { GroupShape, TDShapeType } from '~types' diff --git a/packages/tldraw/src/state/data/filesystem.ts b/packages/tldraw/src/state/data/filesystem.ts index 3fb2f377f..cd9ffcd74 100644 --- a/packages/tldraw/src/state/data/filesystem.ts +++ b/packages/tldraw/src/state/data/filesystem.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { TDDocument, TDFile } from '~types' import type { FileSystemHandle } from './browser-fs-access' import { get as getFromIdb, set as setToIdb } from 'idb-keyval' diff --git a/packages/tldraw/src/state/data/migrate.ts b/packages/tldraw/src/state/data/migrate.ts index f71e7b0a8..886600e6e 100644 --- a/packages/tldraw/src/state/data/migrate.ts +++ b/packages/tldraw/src/state/data/migrate.ts @@ -1,8 +1,6 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ import { Decoration, FontStyle, - TDDocument, TDExportBackground, TDShapeType, TDSnapshot, @@ -67,7 +65,6 @@ export function migrate(state: TDSnapshot, newVersion: number): TDSnapshot { if (version <= 13) { Object.values(document.pages).forEach((page) => { Object.values(page.bindings).forEach((binding) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any Object.assign(binding, (binding as any).meta) }) diff --git a/packages/tldraw/src/state/sessions/ArrowSession/ArrowSession.ts b/packages/tldraw/src/state/sessions/ArrowSession/ArrowSession.ts index 3c6914c68..b2656baa5 100644 --- a/packages/tldraw/src/state/sessions/ArrowSession/ArrowSession.ts +++ b/packages/tldraw/src/state/sessions/ArrowSession/ArrowSession.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { ArrowBinding, ArrowShape, diff --git a/packages/tldraw/src/state/sessions/EditSession/EditSession.spec.ts b/packages/tldraw/src/state/sessions/EditSession/EditSession.spec.ts index 5c368390d..df9a470d6 100644 --- a/packages/tldraw/src/state/sessions/EditSession/EditSession.spec.ts +++ b/packages/tldraw/src/state/sessions/EditSession/EditSession.spec.ts @@ -1,4 +1,4 @@ -import { mockDocument, TldrawTestApp } from '~test' +import { TldrawTestApp } from '~test' import { ColorStyle, DashStyle, diff --git a/packages/tldraw/src/state/sessions/EditSession/EditSession.ts b/packages/tldraw/src/state/sessions/EditSession/EditSession.ts index 0d849373f..3bff0bad7 100644 --- a/packages/tldraw/src/state/sessions/EditSession/EditSession.ts +++ b/packages/tldraw/src/state/sessions/EditSession/EditSession.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { TDShape, SessionType, TldrawPatch, TldrawCommand } from '~types' import { BaseSession } from '../BaseSession' import type { TldrawApp } from '../../internal' diff --git a/packages/tldraw/src/state/sessions/GridSession/GridSession.ts b/packages/tldraw/src/state/sessions/GridSession/GridSession.ts index dd45e9e9e..0c1056cec 100644 --- a/packages/tldraw/src/state/sessions/GridSession/GridSession.ts +++ b/packages/tldraw/src/state/sessions/GridSession/GridSession.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { TLPageState, TLBounds, Utils } from '@tldraw/core' import { Vec } from '@tldraw/vec' import { diff --git a/packages/tldraw/src/state/sessions/RotateSession/RotateSession.spec.ts b/packages/tldraw/src/state/sessions/RotateSession/RotateSession.spec.ts index 6cc3a46bf..bd72f805b 100644 --- a/packages/tldraw/src/state/sessions/RotateSession/RotateSession.spec.ts +++ b/packages/tldraw/src/state/sessions/RotateSession/RotateSession.spec.ts @@ -1,7 +1,7 @@ import Vec from '@tldraw/vec' import { Utils } from '@tldraw/core' import { mockDocument, TldrawTestApp } from '~test' -import { SessionType, TDStatus } from '~types' +import { TDStatus } from '~types' describe('Rotate session', () => { const app = new TldrawTestApp() diff --git a/packages/tldraw/src/state/sessions/RotateSession/RotateSession.ts b/packages/tldraw/src/state/sessions/RotateSession/RotateSession.ts index 8810a4157..e0b53ed01 100644 --- a/packages/tldraw/src/state/sessions/RotateSession/RotateSession.ts +++ b/packages/tldraw/src/state/sessions/RotateSession/RotateSession.ts @@ -1,4 +1,4 @@ -import { TLPerformanceMode, Utils } from '@tldraw/core' +import { Utils } from '@tldraw/core' import { Vec } from '@tldraw/vec' import { SessionType, TldrawCommand, TldrawPatch, TDShape, TDStatus } from '~types' import { TLDR } from '~state/TLDR' diff --git a/packages/tldraw/src/state/sessions/TransformSession/TransformSession.ts b/packages/tldraw/src/state/sessions/TransformSession/TransformSession.ts index a177eb28c..4cf16d714 100644 --- a/packages/tldraw/src/state/sessions/TransformSession/TransformSession.ts +++ b/packages/tldraw/src/state/sessions/TransformSession/TransformSession.ts @@ -1,4 +1,4 @@ -import { TLBounds, TLBoundsCorner, TLBoundsEdge, TLPerformanceMode, Utils } from '@tldraw/core' +import { TLBounds, TLBoundsCorner, TLBoundsEdge, Utils } from '@tldraw/core' import { Vec } from '@tldraw/vec' import type { TLSnapLine, TLBoundsWithCenter } from '@tldraw/core' import { SessionType, TldrawCommand, TldrawPatch, TDShape, TDStatus } from '~types' @@ -97,7 +97,6 @@ export class TransformSession extends BaseSession { return void null } - // eslint-disable-next-line @typescript-eslint/no-unused-vars update = (): TldrawPatch | undefined => { const { transformType, diff --git a/packages/tldraw/src/state/sessions/TransformSingleSession/TransformSingleSession.ts b/packages/tldraw/src/state/sessions/TransformSingleSession/TransformSingleSession.ts index 352b057f5..e74e001af 100644 --- a/packages/tldraw/src/state/sessions/TransformSingleSession/TransformSingleSession.ts +++ b/packages/tldraw/src/state/sessions/TransformSingleSession/TransformSingleSession.ts @@ -5,7 +5,6 @@ import { Utils, TLBoundsWithCenter, TLBounds, - TLPerformanceMode, } from '@tldraw/core' import { Vec } from '@tldraw/vec' import { SessionType, TldrawCommand, TldrawPatch, TDShape, TDStatus } from '~types' diff --git a/packages/tldraw/src/state/sessions/TranslateLabelSession/TranslateLabelSession.spec.ts b/packages/tldraw/src/state/sessions/TranslateLabelSession/TranslateLabelSession.spec.ts index 6d8e0eabb..750bd466f 100644 --- a/packages/tldraw/src/state/sessions/TranslateLabelSession/TranslateLabelSession.spec.ts +++ b/packages/tldraw/src/state/sessions/TranslateLabelSession/TranslateLabelSession.spec.ts @@ -1,6 +1,3 @@ -import { mockDocument, TldrawTestApp } from '~test' -import { SessionType, TDShapeType, TDStatus } from '~types' - describe('Translate label session', () => { it.todo('begins, updateSession') it.todo('cancels session') diff --git a/packages/tldraw/src/state/sessions/TranslateSession/TranslateSession.ts b/packages/tldraw/src/state/sessions/TranslateSession/TranslateSession.ts index 0d0f946d8..ab8c1c8d0 100644 --- a/packages/tldraw/src/state/sessions/TranslateSession/TranslateSession.ts +++ b/packages/tldraw/src/state/sessions/TranslateSession/TranslateSession.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { TLPageState, Utils, TLBoundsWithCenter, TLSnapLine, TLBounds } from '@tldraw/core' import { Vec } from '@tldraw/vec' import { @@ -548,13 +547,10 @@ export class TranslateSession extends BaseSession { afterShapes[id] = { ...afterShapes[id], handles: {} } // There should be before and after shapes - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion beforeShapes[id]!.handles![handle.id as keyof ArrowShape['handles']] = { bindingId: binding.id, } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion afterShapes[id]!.handles![handle.id as keyof ArrowShape['handles']] = { bindingId: undefined, } diff --git a/packages/tldraw/src/state/shapes/DrawUtil/DrawUtil.tsx b/packages/tldraw/src/state/shapes/DrawUtil/DrawUtil.tsx index ec86df8b7..955996655 100644 --- a/packages/tldraw/src/state/shapes/DrawUtil/DrawUtil.tsx +++ b/packages/tldraw/src/state/shapes/DrawUtil/DrawUtil.tsx @@ -248,12 +248,10 @@ export class DrawUtil extends TDShapeUtil { this.pointCache[shape.id] = shape.point this.shapeBoundsCache.set( shape.id, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion Utils.translateBounds(this.pointsBoundsCache.get(shape.points)!, shape.point) ) } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return this.shapeBoundsCache.get(shape.id)! } diff --git a/packages/tldraw/src/state/shapes/StickyUtil/StickyUtil.tsx b/packages/tldraw/src/state/shapes/StickyUtil/StickyUtil.tsx index 752b8cf14..5b6a42851 100644 --- a/packages/tldraw/src/state/shapes/StickyUtil/StickyUtil.tsx +++ b/packages/tldraw/src/state/shapes/StickyUtil/StickyUtil.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as React from 'react' import { Utils, HTMLContainer, TLBounds } from '@tldraw/core' import { AlignStyle, StickyShape, TDMeta, TDShapeType, TransformInfo } from '~types' diff --git a/packages/tldraw/src/state/shapes/TDShapeUtil.tsx b/packages/tldraw/src/state/shapes/TDShapeUtil.tsx index 9a8ebd98a..c400f067a 100644 --- a/packages/tldraw/src/state/shapes/TDShapeUtil.tsx +++ b/packages/tldraw/src/state/shapes/TDShapeUtil.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/no-unused-vars */ import { Utils, TLShapeUtil } from '@tldraw/core' import type { TLPointerInfo, TLBounds } from '@tldraw/core' import { diff --git a/packages/tldraw/src/state/shapes/TextUtil/TextUtil.tsx b/packages/tldraw/src/state/shapes/TextUtil/TextUtil.tsx index caf5b53b2..8ad5befb2 100644 --- a/packages/tldraw/src/state/shapes/TextUtil/TextUtil.tsx +++ b/packages/tldraw/src/state/shapes/TextUtil/TextUtil.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import * as React from 'react' import { Utils, HTMLContainer, TLBounds } from '@tldraw/core' import { TextShape, TDMeta, TDShapeType, TransformInfo, AlignStyle } from '~types' @@ -401,7 +400,6 @@ export class TextUtil extends TDShapeUtil { /* Helpers */ /* -------------------------------------------------- */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any let melm: any function getMeasurementDiv() { diff --git a/packages/tldraw/src/state/shapes/shared/getTextSize.ts b/packages/tldraw/src/state/shapes/shared/getTextSize.ts index 5109cc3cb..57323df15 100644 --- a/packages/tldraw/src/state/shapes/shared/getTextSize.ts +++ b/packages/tldraw/src/state/shapes/shared/getTextSize.ts @@ -1,6 +1,5 @@ import { LETTER_SPACING } from '~constants' -// eslint-disable-next-line @typescript-eslint/no-explicit-any let melm: any function getMeasurementDiv() { diff --git a/packages/tldraw/src/state/tools/BaseTool.ts b/packages/tldraw/src/state/tools/BaseTool.ts index c3b0ed43e..8b990f64a 100644 --- a/packages/tldraw/src/state/tools/BaseTool.ts +++ b/packages/tldraw/src/state/tools/BaseTool.ts @@ -13,7 +13,6 @@ export enum Status { Pinching = 'pinching', } -// eslint-disable-next-line @typescript-eslint/no-explicit-any export abstract class BaseTool extends TDEventHandler { type: TDToolType = 'select' as const diff --git a/packages/tldraw/src/test/badDocument.spec.ts b/packages/tldraw/src/test/badDocument.spec.ts index 390143153..ba65fef21 100644 --- a/packages/tldraw/src/test/badDocument.spec.ts +++ b/packages/tldraw/src/test/badDocument.spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { badDocument } from './documents/badDocument' import { TldrawTestApp } from './TldrawTestApp' diff --git a/packages/tldraw/src/types.ts b/packages/tldraw/src/types.ts index 5043fc039..ce82969ff 100644 --- a/packages/tldraw/src/types.ts +++ b/packages/tldraw/src/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/ban-types */ import type { TLPage, TLUser, @@ -528,7 +526,6 @@ export enum TDExportBackground { /* Type Helpers */ /* -------------------------------------------------- */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export type ParametersExceptFirst = F extends (arg0: any, ...rest: infer R) => any ? R : never export type ExceptFirst = T extends [any, ...infer U] ? U : never @@ -536,7 +533,6 @@ export type ExceptFirst = T extends [any, ...infer U] ? U : export type ExceptFirstTwo = T extends [any, any, ...infer U] ? U : never export type PropsOfType = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [K in keyof TDShape]: TDShape[K] extends any ? (TDShape[K] extends U ? K : never) : never }[keyof TDShape]