Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1125 from Yoast/P2-809-fix-eslint-warnings
Browse files Browse the repository at this point in the history
Declare the window object as a type with the specific links
  • Loading branch information
increddibelly authored Mar 30, 2021
2 parents 5f32614 + 012a011 commit e91c061
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ enum WarningType {
BLOCK_RECOMMENDED
}

type yoastLinks = {
yoastSchemaBlocks: {
requiredLink: string;
recommendedLink: string;
};
}

/**
* Gets the inner blocks instruction of the block definition with the given name.
*
Expand Down Expand Up @@ -55,7 +62,7 @@ function getDefaultWarningMessage( blockTitle: string, warningType: WarningType
"yoast-schema-blocks",
),
blockTitle,
'<a href="' + ( window as any ).yoastSchemaBlocks.requiredLink + '" target="_blank">',
'<a href="' + ( window as unknown as yoastLinks ).yoastSchemaBlocks.requiredLink + '" target="_blank">',
"</a>",
);
}
Expand All @@ -68,7 +75,7 @@ function getDefaultWarningMessage( blockTitle: string, warningType: WarningType
"yoast-schema-blocks",
),
blockTitle,
'<a href="' + ( window as any ).yoastSchemaBlocks.recommendedLink + '" target="_blank">',
'<a href="' + ( window as unknown as yoastLinks ).yoastSchemaBlocks.recommendedLink + '" target="_blank">',
"</a>",
);
}
Expand Down

0 comments on commit e91c061

Please sign in to comment.