Skip to content

Commit

Permalink
chore: Replaced @ts-ignore with @ts-expect-error
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Dec 18, 2023
1 parent 3ee0dbd commit 9786498
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function analyzeClass(file: string | undefined): Set<string> {
return false;
}

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
leftHandSide.properties.forEach((property) => {
switch (property.key.type) {
case 'Identifier': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function findBlocks(templateFile: string): Signature['Blocks'] {
return key === 'to';
});

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
const blockName = normalizeBlockName(toArgument?.value.original);

const positionalArgumentTypes = node.params.map(
Expand Down
2 changes: 1 addition & 1 deletion src/steps/create-registries/create-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function createRegistry(file: string, data: Data): string {

const ast = traverse(file);

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
const nodes = ast.program.body;

const registryEntries = AST.builders.tsInterfaceBody([
Expand Down
4 changes: 2 additions & 2 deletions src/steps/create-signatures/create-signature/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function builderConvertArgsToSignature(nodes: unknown[] = []) {
return [
AST.builders.tsPropertySignature(
AST.builders.identifier('Args'),
// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
AST.builders.tsTypeAnnotation(AST.builders.tsTypeLiteral(nodes)),
false,
),
Expand All @@ -14,7 +14,7 @@ export function builderConvertArgsToSignature(nodes: unknown[] = []) {
export function builderCreateSignature(identifier: string, members: unknown[]) {
return AST.builders.tsInterfaceDeclaration(
AST.builders.identifier(identifier),
// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
AST.builders.tsInterfaceBody(members),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function passSignatureToBaseComponent(
return false;
}

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
const typeParameters = path.node.typeParameters;

// When the interface is missing
Expand All @@ -55,7 +55,7 @@ export function passSignatureToBaseComponent(
builderCreateSignature(identifier, members),
);

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
path.node.typeParameters = builderPassSignature(identifier);

break;
Expand All @@ -71,7 +71,7 @@ export function passSignatureToBaseComponent(
builderCreateSignature(identifier, members),
);

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
path.node.typeParameters = builderPassSignature(identifier);

break;
Expand Down Expand Up @@ -101,7 +101,7 @@ export function passSignatureToBaseComponent(
builderCreateSignature(identifier, members),
);

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
path.node.typeParameters = builderPassSignature(identifier);

break;
Expand All @@ -117,7 +117,7 @@ export function passSignatureToBaseComponent(
builderCreateSignature(identifier, members),
);

// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
path.node.typeParameters = builderPassSignature(identifier);

break;
Expand Down
4 changes: 2 additions & 2 deletions src/steps/update-signatures/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function builderCreateArgsNode(signature: Signature) {

return AST.builders.tsPropertySignature(
AST.builders.identifier('Args'),
// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
AST.builders.tsTypeAnnotation(AST.builders.tsTypeLiteral(members)),
false,
);
Expand Down Expand Up @@ -81,7 +81,7 @@ export function builderCreateBlocksNode(signature: Signature) {

return AST.builders.tsPropertySignature(
AST.builders.identifier('Blocks'),
// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
AST.builders.tsTypeAnnotation(AST.builders.tsTypeLiteral(members)),
false,
);
Expand Down
2 changes: 1 addition & 1 deletion src/steps/update-signatures/update-signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Data = {
};

function getBodyNode(node: unknown, key: 'Args' | 'Blocks' | 'Element') {
// @ts-ignore: Assume that types from external packages are correct
// @ts-expect-error: Assume that types from external packages are correct
return node.body.body.find((node) => {
if (node.type !== 'TSPropertySignature' || node.key.type !== 'Identifier') {
return false;
Expand Down

0 comments on commit 9786498

Please sign in to comment.