Skip to content

Commit

Permalink
Replace @ts-ignore with @ts-expect-error (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Jul 26, 2024
1 parent 4b2d64d commit e441944
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit e441944

Please sign in to comment.