Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 54286c3

Browse files
committed
lint fixes
1 parent 04d7611 commit 54286c3

File tree

25 files changed

+119
-70
lines changed

25 files changed

+119
-70
lines changed

src/App.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import React, { useCallback } from 'react';
2-
import { Button, Col, Dropdown, Layout, Menu, Row } from 'antd';
3-
import { useKey } from 'react-use';
4-
import { library } from '@fortawesome/fontawesome-svg-core';
5-
import { fas } from '@fortawesome/free-solid-svg-icons';
61

7-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
82
import { OcrDocument } from './reducer/types';
93
import { useAppReducer } from './reducerContext';
104
import { createChangeOptions, createDeleteNode, createRedo, createSelectDocument, createUndo } from './reducer/actions';
@@ -18,6 +12,15 @@ import 'antd/dist/antd.css';
1812
import './App.css';
1913
import { LogView } from './components/LogView';
2014

15+
import React, { useCallback } from 'react';
16+
import { Button, Col, Dropdown, Layout, Menu, Row } from 'antd';
17+
import { useKey } from 'react-use';
18+
import { library } from '@fortawesome/fontawesome-svg-core';
19+
import { fas } from '@fortawesome/free-solid-svg-icons';
20+
21+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
22+
23+
2124
library.add(fas);
2225

2326
function App() {

src/components/ExportModal/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
import { OcrDocument } from '../../reducer/types';
2+
import { PageTreeItem } from '../../types';
3+
import buildHocrDocument from '../../lib/hocrBuilder';
4+
import printHtml from '../../lib/htmlPrinter';
5+
16
import React, { useCallback, useEffect, useMemo, useState } from 'react';
27
import { Button, Modal, Space, Tooltip } from 'antd';
38
import { PrismAsync as SyntaxHighlighter } from 'react-syntax-highlighter';
49
import prism from 'react-syntax-highlighter/dist/esm/styles/prism/prism';
510
import { useCopyToClipboard } from 'react-use';
611
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
712

8-
import { OcrDocument } from '../../reducer/types';
9-
import { PageTreeItem } from '../../types';
10-
import buildHocrDocument from '../../lib/hocrBuilder';
11-
import printHtml from '../../lib/htmlPrinter';
13+
1214

1315
import './index.css';
1416

src/components/LogView/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import React from 'react';
21

32
import { RecognizeUpdate } from '../../types';
3+
import React from 'react';
4+
5+
46

57
import './index.scss';
68

src/components/PageCanvas/Block.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
import { DocumentTreeItem, ElementType, ItemId, Position } from '../../types';
2+
import { TreeItems } from '../../reducer/types';
3+
import { clamp } from '../../utils';
4+
import { calculateDragBounds } from './utils';
5+
16
import React, { useCallback, useEffect, useRef } from 'react';
27
import { Group, Rect, Transformer } from 'react-konva';
38
import Konva from 'konva';
49

510
import { IRect } from 'konva/types/types';
6-
import { DocumentTreeItem, ElementType, ItemId, Position } from '../../types';
7-
import { TreeItems } from '../../reducer/types';
8-
import { clamp } from '../../utils';
9-
import { calculateDragBounds } from './utils';
11+
1012

1113
interface Box extends IRect {
1214
rotation: number;

src/components/PageCanvas/Blocks.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import React from 'react';
1+
2+
23
import { BlockTreeItem, ItemId } from '../../types';
34
import { TreeItems } from '../../reducer/types';
45
import { getNodeOrThrow } from '../../treeUtils';
56
import Block, { ChangeCallbackParams, SetInnerRefFn } from './Block';
6-
7+
import React from 'react';
78
interface Props {
89
tree: {
910
rootId: ItemId;

src/components/PageCanvas/CanvasToolbar.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import React, { PropsWithChildren, useCallback, useMemo } from 'react';
2-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3-
import { Rectangle } from 'tesseract.js';
41

5-
import { Button, Dropdown, Menu, Space } from 'antd';
62
import { useAppReducer } from '../../reducerContext';
73
import {
84
createAddDocument,
@@ -19,6 +15,12 @@ import { loadImage } from '../../utils';
1915
import hocrParser from '../../lib/hocrParser';
2016
import { Page, PageImage } from '../../types';
2117

18+
import React, { PropsWithChildren, useCallback, useMemo } from 'react';
19+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
20+
import { Rectangle } from 'tesseract.js';
21+
import { Button, Dropdown, Menu, Space } from 'antd';
22+
23+
2224
import './CanvasToolbar.scss';
2325

2426
type Entry = [PageImage | null, Page | null];

src/components/PageCanvas/DrawLayer.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { Position } from '../../types';
2+
import { clamp } from '../../utils';
3+
4+
15
import React, { useCallback, useEffect, useRef, useState } from 'react';
26
import Konva from 'konva';
37
import { Group, Layer, Rect, Transformer } from 'react-konva';
48
import { IRect } from 'konva/types/types';
5-
import { Position } from '../../types';
6-
import { clamp } from '../../utils';
79

810
interface Box extends IRect {
911
rotation: number;

src/components/PageCanvas/PageGraphics.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import React, { Dispatch } from 'react';
2-
import Konva from 'konva';
3-
import { Image, Stage } from 'react-konva';
4-
import { IRect } from 'konva/types/types';
1+
2+
53
import { ItemId, Position } from '../../types';
64
import { createUpdateTreeNodeRect } from '../../reducer/actions';
75
import { AppReducerAction, OcrDocument } from '../../reducer/types';
86
import Blocks from './Blocks';
97
import BlocksLayer from './BlocksLayer';
108
import DrawLayer from './DrawLayer';
9+
import React, { Dispatch } from 'react';
10+
import Konva from 'konva';
11+
import { Image, Stage } from 'react-konva';
12+
import { IRect } from 'konva/types/types';
1113

1214
export interface Props {
1315
document: OcrDocument | undefined;

src/components/PageCanvas/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import React, { Dispatch, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2-
import { Stage } from 'react-konva';
3-
import { useKey, useMeasure } from 'react-use';
4-
import cx from 'classnames';
5-
import { Button, Space } from 'antd';
6-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
71

8-
import { IRect } from 'konva/types/types';
92
import { ItemId, Position } from '../../types';
103
import {
114
createChangeSelected,
@@ -24,6 +17,15 @@ import assert from '../../lib/assert';
2417
import PageGraphics from './PageGraphics';
2518
import CanvasToolbar from './CanvasToolbar';
2619

20+
import React, { Dispatch, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
21+
import { Stage } from 'react-konva';
22+
import { useKey, useMeasure } from 'react-use';
23+
import cx from 'classnames';
24+
import { Button, Space } from 'antd';
25+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
26+
import { IRect } from 'konva/types/types';
27+
28+
2729
import './index.css';
2830

2931
interface Props {

src/components/PageCanvas/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import Konva from 'konva';
2-
import { Bbox } from 'tesseract.js';
31
import { BaseTreeItem, DocumentTreeItem, ElementType, Position } from '../../types';
42
import { TreeItems } from '../../reducer/types';
3+
import Konva from 'konva';
4+
import { Bbox } from 'tesseract.js';
5+
56

67
export type BoundsTuple = [number, number, number, number];
78

0 commit comments

Comments
 (0)