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

chore: Fix Page.emulateMedia doclint failure #5584

Merged
merged 2 commits into from Apr 6, 2020

Conversation

jackfranklin
Copy link
Collaborator

No description provided.

@@ -176,8 +183,12 @@ function compareDocumentations(actual, expected) {
const actualMethods = Array.from(actualClass.methods.keys()).sort();
const expectedMethods = Array.from(expectedClass.methods.keys()).sort();
const methodDiff = diff(actualMethods, expectedMethods);
for (const methodName of methodDiff.extra)
for (const methodName of methodDiff.extra) {
const expectedMissing = expectedMissingMethods.find(method => method.className === className && method.methodName === methodName);
Copy link
Member

Choose a reason for hiding this comment

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

Let's make expectedMissingMethods a Map<String, Set> to make this more efficient (O(2) i.e. O(1) instead of O(n)).

const expectedMissingMethods = new Map([
  ['Page', new Set('emulateMedia')],
]);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

This is expected as we now alias `emulateMedia` in `index.js` which
isn't a file checked by DocLint. We alias there to avoid having the
function overriden by the `asyncInstallHooks` code.

This commit updates doclint to know about methods that we expect it will
find are missing and in that case just skip over them. We should only do
this for methods where we plan to deprecate them or we have to define
them in an odd way to work around some problem (and if that's the case
long term we should fix that problem so we can define them as normal).
Co-Authored-By: Mathias Bynens <mathias@qiwi.be>
@mathiasbynens mathiasbynens merged commit 4ee2c43 into master Apr 6, 2020
@mathiasbynens mathiasbynens deleted the fix-missing-method-doclint branch April 6, 2020 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants