build: enable consistent type imports eslint rule (#7992)

* build: enable consistent type imports eslint rule

* change to warn

* fix the warning in example and excalidraw-app

* fix packages

* enable type annotations and throw error for the rule
This commit is contained in:
Aakansha Doshi 2024-05-08 14:21:50 +05:30 committed by GitHub
parent c1926f33bb
commit 1ed53b153c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
240 changed files with 635 additions and 611 deletions

View file

@ -1,5 +1,5 @@
import { Bounds } from "../excalidraw/element/bounds";
import { Point } from "../excalidraw/types";
import type { Bounds } from "../excalidraw/element/bounds";
import type { Point } from "../excalidraw/types";
export type LineSegment = [Point, Point];

View file

@ -1,4 +1,4 @@
import { Point, Polygon, GeometricShape } from "./geometry/shape";
import type { Point, Polygon, GeometricShape } from "./geometry/shape";
import {
pointInEllipse,
pointInPolygon,

View file

@ -3,8 +3,8 @@ import {
exportToSvg as _exportToSvg,
} from "../excalidraw/scene/export";
import { getDefaultAppState } from "../excalidraw/appState";
import { AppState, BinaryFiles } from "../excalidraw/types";
import {
import type { AppState, BinaryFiles } from "../excalidraw/types";
import type {
ExcalidrawElement,
ExcalidrawFrameLikeElement,
NonDeleted,

View file

@ -12,7 +12,7 @@ import {
pointRightofLine,
pointRotate,
} from "./geometry";
import { Curve, Ellipse, Line, Point, Polygon, Polyline } from "./shape";
import type { Curve, Ellipse, Line, Point, Polygon, Polyline } from "./shape";
describe("point and line", () => {
const line: Line = [

View file

@ -1,5 +1,5 @@
import { distance2d } from "../../excalidraw/math";
import {
import type {
Point,
Line,
Polygon,

View file

@ -13,7 +13,7 @@
*/
import { getElementAbsoluteCoords } from "../../excalidraw/element";
import {
import type {
ElementsMap,
ExcalidrawDiamondElement,
ExcalidrawElement,

View file

@ -1,5 +1,5 @@
import { decodePngMetadata, decodeSvgMetadata } from "../excalidraw/data/image";
import { ImportedDataState } from "../excalidraw/data/types";
import type { ImportedDataState } from "../excalidraw/data/types";
import * as utils from "../utils";
import { API } from "../excalidraw/tests/helpers/api";

View file

@ -1,4 +1,4 @@
import { Bounds } from "../excalidraw/element/bounds";
import type { Bounds } from "../excalidraw/element/bounds";
import { API } from "../excalidraw/tests/helpers/api";
import {
elementPartiallyOverlapsWithOrContainsBBox,

View file

@ -13,7 +13,8 @@ import {
} from "../excalidraw/element/typeChecks";
import { isValueInRange, rotatePoint } from "../excalidraw/math";
import type { Point } from "../excalidraw/types";
import { Bounds, getElementBounds } from "../excalidraw/element/bounds";
import type { Bounds } from "../excalidraw/element/bounds";
import { getElementBounds } from "../excalidraw/element/bounds";
import { arrayToMap } from "../excalidraw/utils";
type Element = NonDeletedExcalidrawElement;