Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace @ts-ignore with @ts-expect-error #911

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/transforms/v2-to-v3/ts-type/getTypeForString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getTypeForString = (
return j.tsTypeReference.from({
typeName: j.identifier("Array"),

// @ts-ignore
// @ts-expect-error Type 'TSType' is not assignable to type 'TSTypeKind'.
typeParameters: j.tsTypeParameterInstantiation([typeArgument]),
});
}
Expand All @@ -43,7 +43,7 @@ export const getTypeForString = (
return j.tsTypeReference.from({
typeName: j.identifier("Record"),

// @ts-ignore
// @ts-expect-error Type 'TSType' is not assignable to type 'TSTypeKind'.
typeParameters: j.tsTypeParameterInstantiation([j.tsStringKeyword(), typeArgument]),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getMostUsedStringLiteralQuote = (

// Check if the literal value is a string and contains single quotes
if (typeof value === "string") {
// @ts-ignore Property 'raw' does not exist on type 'Literal'.
// @ts-expect-error Property 'raw' does not exist on type 'Literal'.
const rawValue = path.node.raw || path.node.extra?.raw || "";
if (rawValue.startsWith("'")) {
quoteCount[StringLiteralQuoteType.SINGLE]++;
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/v2-to-v3/utils/isTrailingCommaUsed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Collection, JSCodeshift } from "jscodeshift";

export const isTrailingCommaUsed = (j: JSCodeshift, source: Collection<unknown>) => {
for (const node of source.find(j.ObjectExpression).nodes()) {
// @ts-ignore Property 'extra' does not exist on type 'ObjectExpression'.
// @ts-expect-error Property 'extra' does not exist on type 'ObjectExpression'.
if (node.extra?.trailingComma) {
return true;
}
Expand Down