Skip to content

Commit 6908674

Browse files
committed
🎨 lint
1 parent 022cc1b commit 6908674

File tree

460 files changed

+913
-893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

460 files changed

+913
-893
lines changed

‎packages/alignment/src/__tests__/setAlign/center.spec.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
/** @jsx jsx */
2-
3-
import { createPlateEditor, type PlateEditor } from '@udecode/plate-common';
1+
import { createPlateEditor } from '@udecode/plate-common';
42
import { jsx } from '@udecode/plate-test-utils';
53

64
import { createAlignPlugin } from '../../createAlignPlugin';
75
import { setAlign } from '../../transforms/index';
86

7+
import type { PlateEditor } from '@udecode/plate-common';
8+
9+
/** @jsx jsx */
10+
911
jsx;
1012

1113
const input = (

‎packages/alignment/src/__tests__/setAlign/left.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx jsx */
22

3-
import { PlateEditor, createPlateEditor } from '@udecode/plate-common';
3+
import { createPlateEditor, PlateEditor } from '@udecode/plate-common';
44
import { jsx } from '@udecode/plate-test-utils';
55

66
import { createAlignPlugin } from '../../createAlignPlugin';

‎packages/alignment/src/__tests__/setAlign/no-type.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx jsx */
22

3-
import { PlateEditor, createPlateEditor } from '@udecode/plate-common';
3+
import { createPlateEditor, PlateEditor } from '@udecode/plate-common';
44
import { jsx } from '@udecode/plate-test-utils';
55

66
import { createAlignPlugin } from '../../createAlignPlugin';

‎packages/alignment/src/createAlignPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
2-
ELEMENT_DEFAULT,
32
createPluginFactory,
3+
ELEMENT_DEFAULT,
44
getPluginType,
55
mapInjectPropsToPlugin,
66
} from '@udecode/plate-common';

‎packages/alignment/src/transforms/setAlign.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {
22
ENode,
3+
getPluginInjectProps,
4+
isBlock,
35
PlateEditor,
46
PlatePluginKey,
7+
setElements,
58
SetNodesOptions,
69
TNodeMatch,
7-
Value,
8-
getPluginInjectProps,
9-
isBlock,
10-
setElements,
1110
unsetNodes,
11+
Value,
1212
} from '@udecode/plate-common';
1313

1414
import { KEY_ALIGN } from '../createAlignPlugin';

‎packages/autoformat/src/__tests__/withAutoformat/block/blockquote.spec.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { autoformatPlugin } from '@/plate/demo/plugins/autoformatPlugin';
44
import { mockPlugin } from '@udecode/plate-common';
55
import { jsx } from '@udecode/plate-test-utils';
66
import { withReact } from 'slate-react';
7-
import { withAutoformat } from "../../../withAutoformat";
7+
8+
import { withAutoformat } from '../../../withAutoformat';
89

910
jsx;
1011

‎packages/autoformat/src/onKeyDownAutoformat.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { KeyboardEvent } from 'react';
22
import {
3-
KeyboardHandlerReturnType,
4-
PlateEditor,
5-
Value,
6-
WithPlatePlugin,
73
deleteBackward,
84
getEditorString,
95
getPointBefore,
106
insertText,
7+
KeyboardHandlerReturnType,
8+
PlateEditor,
9+
Value,
10+
WithPlatePlugin,
1111
} from '@udecode/plate-common';
1212
import isHotkey from 'is-hotkey';
1313
import { Range } from 'slate';

‎packages/autoformat/src/transforms/autoformatBlock.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import {
2-
ELEMENT_DEFAULT,
3-
PlateEditor,
4-
Value,
52
deleteText,
3+
ELEMENT_DEFAULT,
64
getEditorString,
75
getRangeBefore,
86
getRangeFromBlockStart,
97
isBlock,
108
isVoid,
9+
PlateEditor,
1110
setElements,
1211
someNode,
12+
Value,
1313
} from '@udecode/plate-common';
1414
import castArray from 'lodash/castArray';
1515
import { Range } from 'slate';

‎packages/autoformat/src/transforms/autoformatMark.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
2-
TEditor,
3-
Value,
42
collapseSelection,
53
deleteText,
64
getEditorString,
75
removeMark,
86
select,
7+
TEditor,
8+
Value,
99
} from '@udecode/plate-common';
1010
import castArray from 'lodash/castArray';
1111
import { Point, Range } from 'slate';

‎packages/autoformat/src/transforms/autoformatText.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
PlateEditor,
3-
Value,
42
deleteText,
53
insertText,
4+
PlateEditor,
5+
Value,
66
} from '@udecode/plate-common';
77
import castArray from 'lodash/castArray';
88
import { Point, Range } from 'slate';

‎packages/autoformat/src/types.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface MatchRange {
99

1010
export interface AutoformatQueryOptions<
1111
V extends Value = Value,
12-
E extends PlateEditor<V> = PlateEditor<V>
12+
E extends PlateEditor<V> = PlateEditor<V>,
1313
> extends Omit<AutoformatCommonRule<V, E>, 'query'> {
1414
/**
1515
* `insertText` text.
@@ -19,7 +19,7 @@ export interface AutoformatQueryOptions<
1919

2020
export interface AutoformatCommonRule<
2121
V extends Value = Value,
22-
E extends PlateEditor<V> = PlateEditor<V>
22+
E extends PlateEditor<V> = PlateEditor<V>,
2323
> {
2424
/**
2525
* The rule applies when the trigger and the text just before the cursor matches.
@@ -50,7 +50,7 @@ export interface AutoformatCommonRule<
5050

5151
export interface AutoformatBlockRule<
5252
V extends Value = Value,
53-
E extends PlateEditor<V> = PlateEditor<V>
53+
E extends PlateEditor<V> = PlateEditor<V>,
5454
> extends AutoformatCommonRule<V, E> {
5555
/**
5656
* - text: insert text.
@@ -95,7 +95,7 @@ export interface AutoformatBlockRule<
9595

9696
export interface AutoformatMarkRule<
9797
V extends Value = Value,
98-
E extends PlateEditor<V> = PlateEditor<V>
98+
E extends PlateEditor<V> = PlateEditor<V>,
9999
> extends AutoformatCommonRule<V, E> {
100100
mode: 'mark';
101101

@@ -112,7 +112,7 @@ export interface AutoformatMarkRule<
112112

113113
export interface AutoformatTextRule<
114114
V extends Value = Value,
115-
E extends PlateEditor<V> = PlateEditor<V>
115+
E extends PlateEditor<V> = PlateEditor<V>,
116116
> extends AutoformatCommonRule<V, E> {
117117
mode: 'text';
118118

@@ -131,15 +131,15 @@ export interface AutoformatTextRule<
131131

132132
export type AutoformatRule<
133133
V extends Value = Value,
134-
E extends PlateEditor<V> = PlateEditor<V>
134+
E extends PlateEditor<V> = PlateEditor<V>,
135135
> =
136136
| AutoformatBlockRule<V, E>
137137
| AutoformatMarkRule<V, E>
138138
| AutoformatTextRule<V, E>;
139139

140140
export interface AutoformatPlugin<
141141
V extends Value = Value,
142-
E extends PlateEditor<V> = PlateEditor<V>
142+
E extends PlateEditor<V> = PlateEditor<V>,
143143
> {
144144
/**
145145
* A list of triggering rules.

‎packages/autoformat/src/utils/getMatchPoints.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TEditor, Value, getPointBeforeLocation } from '@udecode/plate-common';
1+
import { getPointBeforeLocation, TEditor, Value } from '@udecode/plate-common';
22
import { Point, Range } from 'slate';
33

44
import { MatchRange } from '../types';

‎packages/autoformat/src/utils/isPreviousCharacterEmpty.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
TEditor,
3-
Value,
42
getEditorString,
53
getRangeBefore,
4+
TEditor,
5+
Value,
66
} from '@udecode/plate-common';
77
import { Location } from 'slate';
88

‎packages/autoformat/src/withAutoformat.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2+
isCollapsed,
23
PlateEditor,
34
Value,
45
WithPlatePlugin,
5-
isCollapsed,
66
} from '@udecode/plate-common';
77

88
import { autoformatBlock } from './transforms/autoformatBlock';
@@ -16,7 +16,7 @@ import { AutoformatPlugin } from './types';
1616
*/
1717
export const withAutoformat = <
1818
V extends Value = Value,
19-
E extends PlateEditor<V> = PlateEditor<V>
19+
E extends PlateEditor<V> = PlateEditor<V>,
2020
>(
2121
editor: E,
2222
{ options: { rules } }: WithPlatePlugin<AutoformatPlugin, V, E>

‎packages/basic-marks/src/createBoldPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
onKeyDownToggleMark,
54
someHtmlElement,
5+
ToggleMarkPlugin,
66
} from '@udecode/plate-common';
77

88
export const MARK_BOLD = 'bold';

‎packages/basic-marks/src/createCodePlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
findHtmlParentElement,
54
onKeyDownToggleMark,
5+
ToggleMarkPlugin,
66
} from '@udecode/plate-common';
77

88
export const MARK_CODE = 'code';

‎packages/basic-marks/src/createItalicPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
onKeyDownToggleMark,
54
someHtmlElement,
5+
ToggleMarkPlugin,
66
} from '@udecode/plate-common';
77

88
export const MARK_ITALIC = 'italic';

‎packages/basic-marks/src/createStrikethroughPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
onKeyDownToggleMark,
54
someHtmlElement,
5+
ToggleMarkPlugin,
66
} from '@udecode/plate-common';
77

88
export const MARK_STRIKETHROUGH = 'strikethrough';

‎packages/basic-marks/src/createSubscriptPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
onKeyDownToggleMark,
4+
ToggleMarkPlugin,
55
} from '@udecode/plate-common';
66

77
export const MARK_SUBSCRIPT = 'subscript';

‎packages/basic-marks/src/createSuperscriptPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
onKeyDownToggleMark,
4+
ToggleMarkPlugin,
55
} from '@udecode/plate-common';
66

77
export const MARK_SUPERSCRIPT = 'superscript';

‎packages/basic-marks/src/createUnderlinePlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2-
ToggleMarkPlugin,
32
createPluginFactory,
43
onKeyDownToggleMark,
54
someHtmlElement,
5+
ToggleMarkPlugin,
66
} from '@udecode/plate-common';
77

88
export const MARK_UNDERLINE = 'underline';

‎packages/block-quote/src/createBlockquotePlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
2-
HotkeyPlugin,
32
createPluginFactory,
3+
HotkeyPlugin,
44
onKeyDownToggleElement,
55
} from '@udecode/plate-common';
66

‎packages/break/src/exit-break/onKeyDownExitBreak.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2+
getBlockAbove,
23
KeyboardHandlerReturnType,
34
PlateEditor,
5+
queryNode,
46
Value,
57
WithPlatePlugin,
6-
getBlockAbove,
7-
queryNode,
88
} from '@udecode/plate-common';
99
import isHotkey from 'is-hotkey';
1010

‎packages/break/src/exit-break/queries/exitBreakAtEdges.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
2-
TEditor,
3-
Value,
42
isExpanded,
53
isSelectionAtBlockEnd,
64
isSelectionAtBlockStart,
5+
TEditor,
6+
Value,
77
} from '@udecode/plate-common';
88

99
/**

‎packages/break/src/exit-break/transforms/exitBreak.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
ELEMENT_DEFAULT,
3-
PlateEditor,
4-
Value,
53
getPath,
64
getPluginType,
75
insertElements,
6+
PlateEditor,
7+
Value,
88
} from '@udecode/plate-common';
99
import { Path } from 'slate';
1010

‎packages/break/src/single-line/withSingleLine.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { PlateEditor, Value, removeNodes } from '@udecode/plate-common';
1+
import { PlateEditor, removeNodes, Value } from '@udecode/plate-common';
22

33
export const withSingleLine = <
44
V extends Value = Value,
5-
E extends PlateEditor<V> = PlateEditor<V>
5+
E extends PlateEditor<V> = PlateEditor<V>,
66
>(
77
editor: E
88
) => {

‎packages/break/src/soft-break/onKeyDownSoftBreak.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2+
getBlockAbove,
23
KeyboardHandlerReturnType,
34
PlateEditor,
5+
queryNode,
46
Value,
57
WithPlatePlugin,
6-
getBlockAbove,
7-
queryNode,
88
} from '@udecode/plate-common';
99
import isHotkey from 'is-hotkey';
1010

‎packages/cli/src/commands/diff.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { existsSync, promises as fs } from 'fs';
22
import path from 'path';
33
import chalk from 'chalk';
44
import { Command } from 'commander';
5-
import { diffLines, type Change } from 'diff';
5+
import { diffLines } from 'diff';
66
import * as z from 'zod';
77

88
import { Config, getConfig } from '../utils/get-config';
@@ -17,6 +17,8 @@ import {
1717
import { registryIndexSchema } from '../utils/registry/schema';
1818
import { transform } from '../utils/transformers';
1919

20+
import type { Change } from 'diff';
21+
2022
const updateOptionsSchema = z.object({
2123
component: z.string().optional(),
2224
yes: z.boolean(),

0 commit comments

Comments
 (0)