Skip to content

Commit 57c5259

Browse files
authored
Merge branch 'HTTPArchive:main' into update-rws-apple
2 parents 1c5ca06 + 49df8e7 commit 57c5259

38 files changed

+269
-190
lines changed

.github/linters/.eslintrc.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
env:
3+
browser: true
4+
es6: true
5+
jest: true
6+
node: true
7+
8+
extends:
9+
- "eslint:recommended"
10+
11+
globals:
12+
$WPT_ACCESSIBILITY_TREE: readonly
13+
$WPT_BODIES: readonly
14+
$WPT_COOKIES: readonly
15+
$WPT_DNS: readonly
16+
$WPT_REQUESTS: readonly
17+
$WPT_TEST_URL: readonly
18+
httparchive_enable_observations: writable
19+
__REACT_DEVTOOLS_GLOBAL_HOOK__: writable
20+
CSSUnparsedValue: readonly
21+
LaunchParams: readonly
22+
23+
ignorePatterns:
24+
- "!.*"
25+
- "**/node_modules/.*"
26+
- "/dist/third-parties.js"
27+
28+
plugins:
29+
- n
30+
- prettier
31+
32+
rules:
33+
no-inner-declarations: off
34+
35+
overrides:
36+
# JSON files
37+
- files:
38+
- "*.json"
39+
extends:
40+
- plugin:jsonc/recommended-with-json
41+
parser: jsonc-eslint-parser
42+
parserOptions:
43+
jsonSyntax: JSON
44+
45+
# JSONC files
46+
- files:
47+
- "*.jsonc"
48+
extends:
49+
- plugin:jsonc/recommended-with-jsonc
50+
parser: jsonc-eslint-parser
51+
parserOptions:
52+
jsonSyntax: JSONC
53+
54+
# JSON5 files
55+
- files:
56+
- "*.json5"
57+
extends:
58+
- plugin:jsonc/recommended-with-json5
59+
parser: jsonc-eslint-parser
60+
parserOptions:
61+
jsonSyntax: JSON5
62+
63+
# Javascript files
64+
- files:
65+
- "**/*.js"
66+
extends:
67+
- "plugin:react/recommended"
68+
parserOptions:
69+
ecmaVersion: latest
70+
71+
- files:
72+
- "**/*.mjs"
73+
- "**/*.cjs"
74+
- "**/*.jsx"
75+
extends:
76+
- "plugin:react/recommended"
77+
parserOptions:
78+
sourceType: module
79+
ecmaVersion: latest
80+
ecmaFeatures:
81+
jsx: true
82+
modules: true
83+
84+
# TypeScript files
85+
- files:
86+
- "**/*.ts"
87+
- "**/*.cts"
88+
- "**/*.mts"
89+
- "**/*.tsx"
90+
extends:
91+
- "plugin:@typescript-eslint/recommended"
92+
- plugin:n/recommended
93+
- plugin:react/recommended
94+
- prettier
95+
parser: "@typescript-eslint/parser"
96+
plugins:
97+
- "@typescript-eslint"
98+
parserOptions:
99+
ecmaVersion: latest
100+
sourceType: module

.github/linters/.markdown-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
# <!-- markdownlint-restore -->
1616
#
1717

18+
ignore:
19+
- ".github/pull_request_template.md"
20+
1821
###############
1922
# Rules by id #
2023
###############

.markdownlintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# ignore github markdown files (like pull request templates)
2-
**/.github/**/*.md"
2+
.github/*.md
3+
.github/**/*.md
4+

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function avgDomDepth() {
1212
function numParents(elem) {
1313
var n = 0;
1414
if ( elem.parentNode ) {
15-
while ( elem = elem.parentNode) {
15+
while ((elem = elem.parentNode)) {
1616
n++;
1717
}
1818
}

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

0 commit comments

Comments
 (0)