Skip to content

Commit 3a6fa3b

Browse files
author
Orta Therox
authored
Merge pull request #1014 from saschanaz/ms-prettier-update
Update prettier and other dependencies
2 parents a75338e + a7a161e commit 3a6fa3b

File tree

6 files changed

+36
-38
lines changed

6 files changed

+36
-38
lines changed

package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@
1717
},
1818
"dependencies": {
1919
"@mdn/browser-compat-data": "2.0.7",
20-
"@types/jsdom": "^16.2.4",
21-
"@types/node": "^14.6.4",
22-
"@types/node-fetch": "^2.5.7",
23-
"@types/webidl2": "^23.13.2",
24-
"@typescript-eslint/eslint-plugin": "^4.16.1",
25-
"@typescript-eslint/parser": "^4.16.1",
26-
"cpx2": "^2.0.0",
27-
"danger": "^10.5.4",
28-
"eslint": "^7.21.0",
29-
"eslint-config-prettier": "^8.1.0",
30-
"eslint-plugin-prettier": "^3.3.1",
31-
"jsdom": "^16.4.0",
20+
"@types/jsdom": "^16.2.10",
21+
"@types/node": "^15.6.1",
22+
"@types/node-fetch": "^2.5.10",
23+
"@types/webidl2": "^23.13.5",
24+
"@typescript-eslint/eslint-plugin": "^4.25.0",
25+
"@typescript-eslint/parser": "^4.25.0",
26+
"cpx2": "^3.0.0",
27+
"danger": "^10.6.4",
28+
"eslint": "^7.27.0",
29+
"eslint-config-prettier": "^8.3.0",
30+
"eslint-plugin-prettier": "^3.4.0",
31+
"jsdom": "^16.6.0",
3232
"node-fetch": "^2.6.1",
33-
"parse-diff": "^0.7.0",
34-
"prettier": "^2.2.1",
33+
"parse-diff": "^0.8.1",
34+
"prettier": "^2.3.0",
3535
"print-diff": "^1.0.0",
36-
"styleless-innertext": "^1.1.2",
36+
"styleless-innertext": "^1.1.3",
3737
"typescript": "^4.3.0-dev.20210327",
38-
"webidl2": "^23.13.1"
38+
"webidl2": "^24.1.1"
3939
}
4040
}

src/emitter.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,10 @@ export function emitWebIdl(
413413
return type;
414414
}
415415

416-
function convertDomTypeToTsTypeWorker(
417-
obj: Browser.Typed
418-
): { name: string; nullable: boolean } {
416+
function convertDomTypeToTsTypeWorker(obj: Browser.Typed): {
417+
name: string;
418+
nullable: boolean;
419+
} {
419420
let type;
420421
if (typeof obj.type === "string") {
421422
type = {

src/expose.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function deepClone<T>(o: T, custom: (o: any) => any): T {
194194
return o;
195195
}
196196
if (Array.isArray(o)) {
197-
return (o.map((v) => deepClone(v, custom)) as any) as T;
197+
return o.map((v) => deepClone(v, custom)) as any as T;
198198
}
199199
const mapped = custom(o);
200200
if (mapped !== undefined) {

src/helpers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export function filter<T>(
6565
): T {
6666
if (typeof obj === "object") {
6767
if (Array.isArray(obj)) {
68-
return (mapDefined(obj, (e) =>
68+
return mapDefined(obj, (e) =>
6969
fn(e, undefined) ? filter(e, fn) : undefined
70-
) as any) as T;
70+
) as any as T;
7171
} else {
7272
const result: any = {};
7373
for (const e in obj) {

src/idlfetcher.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ const cssPropSelector = [
2626
].join(",");
2727

2828
async function fetchIDLs(filter: string[]) {
29-
const idlSources = (require("../inputfiles/idlSources.json") as IDLSource[]).filter(
30-
(source) => !filter.length || filter.includes(source.title)
31-
);
29+
const idlSources = (
30+
require("../inputfiles/idlSources.json") as IDLSource[]
31+
).filter((source) => !filter.length || filter.includes(source.title));
3232
await Promise.all(
3333
idlSources.map(async (source) => {
3434
const { idl, comments } = await fetchIDL(source);
@@ -92,9 +92,9 @@ function extractIDL(dom: DocumentFragment) {
9292
}
9393

9494
function extractCSSDefinitions(dom: DocumentFragment) {
95-
const properties = Array.from(
96-
dom.querySelectorAll(cssPropSelector)
97-
).map((element) => element.textContent!.trim());
95+
const properties = Array.from(dom.querySelectorAll(cssPropSelector)).map(
96+
(element) => element.textContent!.trim()
97+
);
9898

9999
if (!properties.length) {
100100
return "";

src/widlprocess.ts

+7-10
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ export function convert(text: string, commentMap: Record<string, string>) {
2929
} else if (rootType.type === "namespace") {
3030
browser.namespaces!.push(convertNamespace(rootType, commentMap));
3131
} else if (rootType.type === "callback interface") {
32-
browser["callback-interfaces"]!.interface[
33-
rootType.name
34-
] = convertInterfaceCommon(rootType, commentMap);
32+
browser["callback-interfaces"]!.interface[rootType.name] =
33+
convertInterfaceCommon(rootType, commentMap);
3534
} else if (rootType.type === "callback") {
36-
browser["callback-functions"]!["callback-function"][
37-
rootType.name
38-
] = convertCallbackFunctions(rootType);
35+
browser["callback-functions"]!["callback-function"][rootType.name] =
36+
convertCallbackFunctions(rootType);
3937
addComments(
4038
browser["callback-functions"]!["callback-function"][rootType.name],
4139
commentMap,
@@ -79,10 +77,9 @@ function getExtAttr(extAttrs: webidl2.ExtendedAttribute[], name: string) {
7977
attr.rhs.type === "string-list" ||
8078
attr.rhs.type === "decimal-list" ||
8179
attr.rhs.type === "integer-list"
82-
? (attr.rhs
83-
.value as webidl2.ExtendedAttributeRightHandSideIdentifier[]).map(
84-
(item) => item.value
85-
)
80+
? (
81+
attr.rhs.value as webidl2.ExtendedAttributeRightHandSideIdentifier[]
82+
).map((item) => item.value)
8683
: [attr.rhs.value];
8784
}
8885

0 commit comments

Comments
 (0)