Skip to content

Update prettier and other dependencies #1014

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

Merged
merged 1 commit into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@
},
"dependencies": {
"@mdn/browser-compat-data": "2.0.7",
"@types/jsdom": "^16.2.4",
"@types/node": "^14.6.4",
"@types/node-fetch": "^2.5.7",
"@types/webidl2": "^23.13.2",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"cpx2": "^2.0.0",
"danger": "^10.5.4",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"jsdom": "^16.4.0",
"@types/jsdom": "^16.2.10",
"@types/node": "^15.6.1",
"@types/node-fetch": "^2.5.10",
"@types/webidl2": "^23.13.5",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"cpx2": "^3.0.0",
"danger": "^10.6.4",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"jsdom": "^16.6.0",
"node-fetch": "^2.6.1",
"parse-diff": "^0.7.0",
"prettier": "^2.2.1",
"parse-diff": "^0.8.1",
"prettier": "^2.3.0",
"print-diff": "^1.0.0",
"styleless-innertext": "^1.1.2",
"styleless-innertext": "^1.1.3",
"typescript": "^4.3.0-dev.20210327",
"webidl2": "^23.13.1"
"webidl2": "^24.1.1"
}
}
7 changes: 4 additions & 3 deletions src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ export function emitWebIdl(
return type;
}

function convertDomTypeToTsTypeWorker(
obj: Browser.Typed
): { name: string; nullable: boolean } {
function convertDomTypeToTsTypeWorker(obj: Browser.Typed): {
name: string;
nullable: boolean;
} {
let type;
if (typeof obj.type === "string") {
type = {
Expand Down
2 changes: 1 addition & 1 deletion src/expose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function deepClone<T>(o: T, custom: (o: any) => any): T {
return o;
}
if (Array.isArray(o)) {
return (o.map((v) => deepClone(v, custom)) as any) as T;
return o.map((v) => deepClone(v, custom)) as any as T;
}
const mapped = custom(o);
if (mapped !== undefined) {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export function filter<T>(
): T {
if (typeof obj === "object") {
if (Array.isArray(obj)) {
return (mapDefined(obj, (e) =>
return mapDefined(obj, (e) =>
fn(e, undefined) ? filter(e, fn) : undefined
) as any) as T;
) as any as T;
} else {
const result: any = {};
for (const e in obj) {
Expand Down
12 changes: 6 additions & 6 deletions src/idlfetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const cssPropSelector = [
].join(",");

async function fetchIDLs(filter: string[]) {
const idlSources = (require("../inputfiles/idlSources.json") as IDLSource[]).filter(
(source) => !filter.length || filter.includes(source.title)
);
const idlSources = (
require("../inputfiles/idlSources.json") as IDLSource[]
).filter((source) => !filter.length || filter.includes(source.title));
await Promise.all(
idlSources.map(async (source) => {
const { idl, comments } = await fetchIDL(source);
Expand Down Expand Up @@ -92,9 +92,9 @@ function extractIDL(dom: DocumentFragment) {
}

function extractCSSDefinitions(dom: DocumentFragment) {
const properties = Array.from(
dom.querySelectorAll(cssPropSelector)
).map((element) => element.textContent!.trim());
const properties = Array.from(dom.querySelectorAll(cssPropSelector)).map(
(element) => element.textContent!.trim()
);

if (!properties.length) {
return "";
Expand Down
17 changes: 7 additions & 10 deletions src/widlprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ export function convert(text: string, commentMap: Record<string, string>) {
} else if (rootType.type === "namespace") {
browser.namespaces!.push(convertNamespace(rootType, commentMap));
} else if (rootType.type === "callback interface") {
browser["callback-interfaces"]!.interface[
rootType.name
] = convertInterfaceCommon(rootType, commentMap);
browser["callback-interfaces"]!.interface[rootType.name] =
convertInterfaceCommon(rootType, commentMap);
} else if (rootType.type === "callback") {
browser["callback-functions"]!["callback-function"][
rootType.name
] = convertCallbackFunctions(rootType);
browser["callback-functions"]!["callback-function"][rootType.name] =
convertCallbackFunctions(rootType);
addComments(
browser["callback-functions"]!["callback-function"][rootType.name],
commentMap,
Expand Down Expand Up @@ -79,10 +77,9 @@ function getExtAttr(extAttrs: webidl2.ExtendedAttribute[], name: string) {
attr.rhs.type === "string-list" ||
attr.rhs.type === "decimal-list" ||
attr.rhs.type === "integer-list"
? (attr.rhs
.value as webidl2.ExtendedAttributeRightHandSideIdentifier[]).map(
(item) => item.value
)
? (
attr.rhs.value as webidl2.ExtendedAttributeRightHandSideIdentifier[]
).map((item) => item.value)
: [attr.rhs.value];
}

Expand Down