Skip to content

Commit 9208578

Browse files
committed
More updates
1 parent a97eb6d commit 9208578

File tree

16 files changed

+41
-30
lines changed

16 files changed

+41
-30
lines changed

.github/linters/.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ globals:
1515
$WPT_REQUESTS: readonly
1616
$WPT_TEST_URL: readonly
1717
httparchive_enable_observations: writable
18+
CSSUnparsedValue: readonly
1819
LaunchParams: readonly
1920

2021
ignorePatterns:
@@ -25,6 +26,9 @@ plugins:
2526
- n
2627
- prettier
2728

29+
rules:
30+
no-inner-declarations: off
31+
2832
overrides:
2933
# JSON files
3034
- files:

bin/create-fugu-apis.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const checkURLConditions = (where, url, mimeType, responseBody) => {
1616
// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#textjavascript).
1717
if (
1818
where === "JavaScript" &&
19-
/\.m?js/.test(url) &&
19+
/\\.m?js/.test(url) &&
2020
mimeType.toLowerCase().endsWith("script")
2121
) {
2222
return true;

dist/Images.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ var wptImages = function (win) {
3333
if (im && im.length) {
3434
images = images.concat(im);
3535
}
36-
} catch (e) {}
36+
} catch (e) {
37+
// continue regardless of error
38+
}
3739
}
3840
if (images.length > 10000) break;
3941
}

dist/a11y.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ return JSON.stringify({
8383
// HEIF
8484
'heif', 'heic',
8585
];
86-
const extension_regex = new RegExp(`\.(${image_file_extensions.join('|')})$`, 'i');
86+
const extension_regex = new RegExp(`\\.(${image_file_extensions.join('|')})$`, 'i');
8787

8888
let total_elements_with_non_empty_alt = 0;
8989
let total_with_file_extension = 0;

dist/ads.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//[ads]
22

3-
const ACCOUNT_TYPES = ['direct', 'reseller'];
43
const SELLER_TYPES = ['publisher', 'intermediary', 'both'];
54

65
const isPresent = (response, endings) => response.ok && endings.some(ending => response.url.endsWith(ending));
@@ -86,7 +85,7 @@ const parseAdsTxt = async (response) => {
8685
}
8786
result.account_count += 1;
8887
}
89-
};
88+
}
9089

9190
// Count unique and remove domain Sets for now
9291
for (let accountType of Object.values(result.account_types)) {
@@ -173,7 +172,7 @@ const parseSellersJSON = async (response) => {
173172
seller_type.domain_count = seller_type.domains.size;
174173
seller_type.domains = Array.from(seller_type.domains); // delete seller_type.domains;
175174
}
176-
};
175+
}
177176

178177
return result;
179178
}

dist/almanac.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,13 @@ return JSON.stringify({
268268
// json+ld
269269
try {
270270
var content = JSON.parse(node.textContent);
271-
var contentLoop = [];
272271
if (content instanceof Object || content instanceof Array) {
273272
// nested lookup
274273
nestedLookup(content, 0);
275274
}
276-
} catch (e) {}
275+
} catch (e) {
276+
// continue regardless of error
277+
}
277278
}
278279
}
279280
}
@@ -313,7 +314,9 @@ return JSON.stringify({
313314
} else {
314315
navigateHash++;
315316
}
316-
} catch (e) {}
317+
} catch (e) {
318+
// continue regardless of error
319+
}
317320
}
318321
} else if (document.location.hostname !== link.hostname) {
319322
external++;
@@ -373,7 +376,6 @@ return JSON.stringify({
373376
wordsCount = 0;
374377
wordElements = 0;
375378
var n,
376-
nodes = [],
377379
walk = document.createTreeWalker(
378380
body,
379381
NodeFilter.SHOW_ALL,
@@ -471,7 +473,7 @@ return JSON.stringify({
471473
};
472474
})(),
473475
'09.27': (() => {
474-
// Returns a JSON array of nodes with a tabindex and their key/value attributes.
476+
// Returns a JSON array of nodes with a tabindex and their key/value attributes.
475477
// We acknowledge that attribute selectors are expensive to query.
476478
var nodes = document.querySelectorAll('body [tabindex]');
477479
return parseNodes(nodes, {
@@ -569,10 +571,6 @@ return JSON.stringify({
569571
max_prop_length: 255,
570572
};
571573

572-
const parsed_pictures = parseNodes(pictures, filter_options);
573-
const parsed_imgs = parseNodes(imgs, filter_options);
574-
const parsed_sources = parseNodes(sources, filter_options);
575-
576574
return {
577575
pictures: parseNodes(pictures, filter_options),
578576
imgs: parseNodes(imgs, filter_options),

dist/avg_dom_depth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ function avgDomDepth() {
1212
function numParents(elem) {
1313
var n = 0;
1414
if ( elem.parentNode ) {
15-
while ( elem = elem.parentNode) {
15+
/* eslint-disable-next-line no-cond-assign */
16+
while (elem = elem.parentNode) {
1617
n++;
1718
}
1819
}

dist/cms.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function getWordPressTheme() {
3232
theme.child_theme = childTheme.replace( 'wp-child-theme-', '' );
3333
}
3434

35-
} catch ( e ) {}
35+
} catch ( e ) {
36+
// continue regardless of error
37+
}
3638
return theme;
3739
}
3840

@@ -179,7 +181,9 @@ function getWordPressContentType() {
179181
}
180182
}
181183
}
182-
} catch ( e ) {}
184+
} catch ( e ) {
185+
// continue regardless of error
186+
}
183187
return content;
184188
}
185189

dist/crawl_links.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const sameOrigin = function(uri1, uri2){
1515
uri2 = new URL(uri2);
1616
return uri1.origin == uri2.origin;
1717
} catch(e) {
18+
// continue regardless of error
1819
}
1920
return false;
2021
}
@@ -56,6 +57,7 @@ const getLinks = function(visibleOnly){
5657
}
5758
}
5859
} catch (e) {
60+
// continue regardless of error
5961
}
6062
}
6163
}

dist/css-variables.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ function analyzeVariables() {
214214
try {
215215
var rules = stylesheet.cssRules;
216216
}
217-
catch (e) { }
217+
catch (e) {
218+
// continue regardless of error
219+
}}
218220

219221
if (rules) {
220222
for (let rule of rules) {
@@ -286,7 +288,7 @@ function analyzeVariables() {
286288

287289
return { summary, computed };
288290

289-
};
291+
}
290292

291293
function serialize(data, separator) {
292294
return JSON.stringify(data, (key, value) => {

0 commit comments

Comments
 (0)