-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(tsc): add type checking for seo audits #5103
Conversation
all of lighthouse-core/**/*.js!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -34,17 +39,17 @@ function getUniqueFailingRules(fontSizeArtifact) { | |||
} | |||
}); | |||
|
|||
return failingRules.valuesArray(); | |||
return [...failingRules.values()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have an extraordinarily small preference for Array.from
, mostly commenting out of curiosity if this is your preference? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I used to prefer Array.from
since it felt more deliberate and less like an action in place or something, but now I have spread blindness and see them as the same thing, so I don't think I care anymore...
@@ -89,14 +90,14 @@ class IsCrawlable extends Audit { | |||
if (isBlocking) { | |||
blockingDirectives.push({ | |||
source: { | |||
type: 'node', | |||
type: /** @type {'node'} */ ('node'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
"lighthouse-core/lib/emulation.js", | ||
"lighthouse-core/gather/**/*.js", | ||
"lighthouse-core/scripts/*.js", | ||
"lighthouse-core/**/*.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
with this, all of
lighthouse-core/**/*.js
is type checked :) (with carve outs for tests and the html renderer, for now).The only remaining files this adds are these seo audits and the all-important
empty-stub.js
(which turns out was already type safe! Good jobempty-stub
).