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

Add linter check for preloading web fonts #904

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

tharders
Copy link
Collaborator

Please especially have a look at the link and the message.

Copy link
Collaborator

@sebastianbenz sebastianbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

export class FontsArePreloaded extends Rule {
run({ $ }: Context) {
const css = $("style[amp-custom]").html();
if (css) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: early exit to avoid too deep indendation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, clicked merge to early. Will change it with the next check.

@tharders tharders merged commit d1e9b84 into main Aug 21, 2020
@sebastianbenz sebastianbenz deleted the feature/linter-font-preload branch August 21, 2020 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants