Skip to content

Commit dbb235c

Browse files
committed
ts-ignore comments added
1 parent 27b90fd commit dbb235c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"no-shadow": "warn",
1313
"jsx-a11y/anchor-is-valid": "off",
1414
"space-before-function-paren": "off",
15+
"@typescript-eslint/ban-ts-comment": "off",
1516
"react/jsx-boolean-value": "off",
1617
"semi": "off",
1718
"react/prop-types": "off"

src/components/TypeAnimation/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const TypeAnimation = forwardRef<
2525
style,
2626
...rest
2727
},
28-
ref: React.ForwardedRef<HTMLElementTagNameMap[Wrapper]>,
28+
ref: React.ForwardedRef<HTMLElementTagNameMap[Wrapper]>
2929
) => {
3030
const { 'aria-label': ariaLabel, 'aria-hidden': ariaHidden } = rest;
3131

@@ -91,10 +91,11 @@ const TypeAnimation = forwardRef<
9191
keyStrokeDelayTyping,
9292
keyStrokeDelayDeleting,
9393
omitDeletionAnimation,
94-
...restArgs,
94+
...restArgs
9595
);
9696

9797
return () => {
98+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
9899
typeRef.current;
99100
};
100101
});
@@ -123,6 +124,7 @@ const TypeAnimation = forwardRef<
123124
preRenderedChildren
124125
)
125126
}
127+
// @ts-ignore
126128
ref={ariaLabel ? undefined : typeRef}
127129
/>
128130
);

src/typical.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function type(
1515
for (const arg of args) {
1616
switch (typeof arg) {
1717
case 'string':
18-
await nodeEditor(node, splitter, arg, speed, deletionSpeed, omitDeletionAnimation);
18+
await edit(node, splitter, arg, speed, deletionSpeed, omitDeletionAnimation);
1919
break;
2020
case 'number':
2121
await wait(arg);
@@ -30,7 +30,7 @@ export async function type(
3030
}
3131
}
3232

33-
async function nodeEditor(
33+
async function edit(
3434
node: HTMLElementTagNameMap[Wrapper],
3535
splitter: StringSplitter,
3636
text: string,
@@ -85,14 +85,14 @@ async function perform(
8585
}
8686

8787
function* editor(edits: ReadonlyArray<string>) {
88-
for (const edit of edits) {
88+
for (const snippet of edits) {
8989
yield {
90-
op: (node: HTMLElementTagNameMap[Wrapper]) => requestAnimationFrame(() => (node.textContent = edit)),
90+
op: (node: HTMLElementTagNameMap[Wrapper]) => requestAnimationFrame(() => (node.textContent = snippet)),
9191

9292
opCode: (node: HTMLElementTagNameMap[Wrapper]) => {
9393
const nodeContent = node.textContent || '';
9494

95-
return edit === '' || nodeContent.length > edit.length
95+
return snippet === '' || nodeContent.length > snippet.length
9696
? OP_CODE_DELETION
9797
: OP_CODE_WRITING;
9898
}

0 commit comments

Comments
 (0)