Skip to content

Commit b27f460

Browse files
chore(deps): bump prettier to ^3.0.0 (#967)
* chore(deps): bump prettier to ^3.0.0 * Format files --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: eps1lon <[email protected]>
1 parent 31a77f5 commit b27f460

22 files changed

+96
-91
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"minimatch": "^9.0.0",
6767
"mocha": "^10.0.0",
6868
"mocha-sugar-free": "^1.4.0",
69-
"prettier": "^2.3.0",
69+
"prettier": "^3.0.0",
7070
"q": "^1.5.1",
7171
"request": "^2.88",
7272
"request-promise-native": "^1.0.9",

scripts/jest/jest-environment-jsdom-mock-edge14.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class JestEnvironmentJsdomMockEdge16 extends JestEnvironmentJsdom {
3131
get() {
3232
return undefined;
3333
},
34-
}
34+
},
3535
);
3636
});
3737
}

scripts/jest/jest-environment-jsdom-mock-ie11.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class JestEnvironmentJsdomMockIE11 extends JestEnvironmentJsdom {
2929
get() {
3030
return undefined;
3131
},
32-
}
32+
},
3333
);
3434
});
3535
}

sources/__tests__/accessible-description.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ function toHaveAccessibleDescription(received, expected) {
1616
return {
1717
message: () =>
1818
`expected ${prettyDOM(
19-
received
19+
received,
2020
)} to have accessible description '${expected}' but got '${actual}'\n${diff(
2121
expected,
22-
actual
22+
actual,
2323
)}`,
2424
pass: false,
2525
};
@@ -28,10 +28,10 @@ function toHaveAccessibleDescription(received, expected) {
2828
return {
2929
message: () =>
3030
`expected ${prettyDOM(
31-
received
31+
received,
3232
)} not to have accessible description '${expected}'\n${diff(
3333
expected,
34-
actual
34+
actual,
3535
)}`,
3636
pass: true,
3737
};
@@ -73,7 +73,7 @@ describe("wpt copies", () => {
7373
],
7474
])(`#%#`, (markup, expectedAccessibleDescription) => {
7575
expect(markup).toRenderIntoDocumentAccessibleDescription(
76-
expectedAccessibleDescription
76+
expectedAccessibleDescription,
7777
);
7878
});
7979
});

sources/__tests__/accessible-name.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ function toHaveAccessibleName(received, expected) {
1616
return {
1717
message: () =>
1818
`expected ${prettyDOM(
19-
received
19+
received,
2020
)} to have accessible name '${expected}' but got '${actual}'\n${diff(
2121
expected,
22-
actual
22+
actual,
2323
)}`,
2424
pass: false,
2525
};
@@ -28,7 +28,7 @@ function toHaveAccessibleName(received, expected) {
2828
return {
2929
message: () =>
3030
`expected ${prettyDOM(
31-
received
31+
received,
3232
)} not to have accessible name '${expected}'\n${diff(expected, actual)}`,
3333
pass: true,
3434
};
@@ -244,7 +244,7 @@ describe("slots", () => {
244244
const shadowRoot = this.attachShadow({ mode: "open" });
245245
shadowRoot.innerHTML = `<button data-test><slot></slot></button>`;
246246
}
247-
}
247+
},
248248
);
249249

250250
customElements.define(
@@ -255,7 +255,7 @@ describe("slots", () => {
255255
const shadowRoot = this.attachShadow({ mode: "open" });
256256
shadowRoot.innerHTML = `<button data-test><slot>Default name</slot></button>`;
257257
}
258-
}
258+
},
259259
);
260260
});
261261

@@ -551,7 +551,7 @@ describe("prohibited naming", () => {
551551
"role '%s'can be part of the accessible name of another element",
552552
(_, markup, name) => {
553553
expect(markup).toRenderIntoDocumentAccessibleName(name);
554-
}
554+
},
555555
);
556556
});
557557

@@ -624,10 +624,10 @@ describe("options.computedStyleSupportsPseudoElements", () => {
624624
// one for ::before, one for ::after
625625
expect(console.error).toHaveBeenCalledTimes(2);
626626
expect(console.error.mock.calls[0][0]).toMatchInlineSnapshot(
627-
`[Error: Not implemented: window.computedStyle(elt, pseudoElt)]`
627+
`[Error: Not implemented: window.computedStyle(elt, pseudoElt)]`,
628628
);
629629
expect(console.error.mock.calls[1][0]).toMatchInlineSnapshot(
630-
`[Error: Not implemented: window.computedStyle(elt, pseudoElt)]`
630+
`[Error: Not implemented: window.computedStyle(elt, pseudoElt)]`,
631631
);
632632
});
633633
});
@@ -641,7 +641,7 @@ describe("options.hidden", () => {
641641

642642
const testNode = container.querySelector("[data-test]");
643643
expect(computeAccessibleName(testNode, { hidden: true })).toEqual(
644-
accessibleName
644+
accessibleName,
645645
);
646646
});
647647
});

sources/__tests__/is-inaccessible.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("isInaccessible", () => {
2828

2929
test("isSubtreeInaccessible implementation can be injected", () => {
3030
const container = renderIntoDocument(
31-
`<div style="display: none;"><button data-test /></div>`
31+
`<div style="display: none;"><button data-test /></div>`,
3232
);
3333
const testNode = container.querySelector("[data-test]");
3434

@@ -38,14 +38,14 @@ describe("isInaccessible", () => {
3838
// ignore subtree accessibility
3939
// A more useful usecase would be caching these results for repeated calls of `isInaccessible`
4040
isSubtreeInaccessible: () => false,
41-
})
41+
}),
4242
).toBe(false);
4343
});
4444

4545
test("window.getComputedStyle implementation can be injected", () => {
4646
jest.spyOn(window, "getComputedStyle");
4747
const container = renderIntoDocument(
48-
`<button data-test style="display: none;" />`
48+
`<button data-test style="display: none;" />`,
4949
);
5050
const testNode = container.querySelector("[data-test]");
5151

@@ -58,7 +58,7 @@ describe("isInaccessible", () => {
5858

5959
return styles;
6060
},
61-
})
61+
}),
6262
).toBe(false);
6363
expect(window.getComputedStyle).toHaveBeenCalledTimes(0);
6464
});
@@ -69,9 +69,9 @@ describe("isInaccessible", () => {
6969
// mocking no available window
7070
// https://developer.mozilla.org/en-US/docs/Web/API/Document/defaultView
7171
getComputedStyle: null,
72-
})
72+
}),
7373
).toThrowErrorMatchingInlineSnapshot(
74-
`"Owner document of the element needs to have an associated window."`
74+
`"Owner document of the element needs to have an associated window."`,
7575
);
7676
});
7777
});
@@ -99,7 +99,7 @@ describe("isSubtreeInaccessible", () => {
9999
test("window.getComputedStyle implementation can be injected", () => {
100100
jest.spyOn(window, "getComputedStyle");
101101
const container = renderIntoDocument(
102-
`<button data-test style="display: none;" />`
102+
`<button data-test style="display: none;" />`,
103103
);
104104
const testNode = container.querySelector("[data-test]");
105105

@@ -112,7 +112,7 @@ describe("isSubtreeInaccessible", () => {
112112

113113
return styles;
114114
},
115-
})
115+
}),
116116
).toBe(false);
117117
expect(window.getComputedStyle).toHaveBeenCalledTimes(0);
118118
});
@@ -123,9 +123,9 @@ describe("isSubtreeInaccessible", () => {
123123
// mocking no available window
124124
// https://developer.mozilla.org/en-US/docs/Web/API/Document/defaultView
125125
getComputedStyle: null,
126-
})
126+
}),
127127
).toThrowErrorMatchingInlineSnapshot(
128-
`"Owner document of the element needs to have an associated window."`
128+
`"Owner document of the element needs to have an associated window."`,
129129
);
130130
});
131131
});

sources/accessible-description.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { queryIdRefs } from "./util";
1111
*/
1212
export function computeAccessibleDescription(
1313
root: Element,
14-
options: ComputeTextAlternativeOptions = {}
14+
options: ComputeTextAlternativeOptions = {},
1515
): string {
1616
let description = queryIdRefs(root, "aria-describedby")
1717
.map((element) => {

sources/accessible-name-and-description.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function asFlatString(s: string): FlatString {
6969
*/
7070
function isHidden(
7171
node: Node,
72-
getComputedStyleImplementation: typeof window.getComputedStyle
72+
getComputedStyleImplementation: typeof window.getComputedStyle,
7373
): node is Element {
7474
if (!isElement(node)) {
7575
return false;
@@ -116,7 +116,7 @@ function hasAbstractRole(node: Node, role: string): node is Element {
116116
]);
117117
default:
118118
throw new TypeError(
119-
`No knowledge about abstract role '${role}'. This is likely a bug :(`
119+
`No knowledge about abstract role '${role}'. This is likely a bug :(`,
120120
);
121121
}
122122
}
@@ -128,7 +128,7 @@ function hasAbstractRole(node: Node, role: string): node is Element {
128128
*/
129129
function querySelectorAllSubtree(
130130
element: Element,
131-
selectors: string
131+
selectors: string,
132132
): Element[] {
133133
const elements = ArrayFrom(element.querySelectorAll(selectors));
134134

@@ -165,7 +165,7 @@ function isMarkedPresentational(node: Node): node is Element {
165165
* - https://w3c.github.io/html-aam/#table-element
166166
*/
167167
function isNativeHostLanguageTextAlternativeElement(
168-
node: Node
168+
node: Node,
169169
): node is Element {
170170
return isHTMLTableCaptionElement(node);
171171
}
@@ -203,7 +203,7 @@ function allowsNameFromContent(node: Node): boolean {
203203
*/
204204
function isDescendantOfNativeHostLanguageTextAlternativeElement(
205205
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- not implemented yet
206-
node: Node
206+
node: Node,
207207
): boolean {
208208
return false;
209209
}
@@ -335,7 +335,7 @@ function getSlotContents(slot: HTMLSlotElement): Node[] {
335335
*/
336336
export function computeTextAlternative(
337337
root: Element,
338-
options: ComputeTextAlternativeOptions = {}
338+
options: ComputeTextAlternativeOptions = {},
339339
): string {
340340
const consultedNodes = new SetLike<Node>();
341341

@@ -355,7 +355,7 @@ export function computeTextAlternative(
355355
// 2F.i
356356
function computeMiscTextAlternative(
357357
node: Node,
358-
context: { isEmbeddedInLabel: boolean; isReferenced: boolean }
358+
context: { isEmbeddedInLabel: boolean; isReferenced: boolean },
359359
): string {
360360
let accumulatedText = "";
361361
if (isElement(node) && computedStyleSupportsPseudoElements) {
@@ -402,7 +402,7 @@ export function computeTextAlternative(
402402
*/
403403
function useAttribute(
404404
element: Element,
405-
attributeName: string
405+
attributeName: string,
406406
): string | null {
407407
const attribute = element.getAttributeNode(attributeName);
408408
if (
@@ -559,7 +559,7 @@ export function computeTextAlternative(
559559
isEmbeddedInLabel: boolean;
560560
isReferenced: boolean;
561561
recursion: boolean;
562-
}
562+
},
563563
): string {
564564
if (consultedNodes.has(current)) {
565565
return "";
@@ -724,6 +724,6 @@ export function computeTextAlternative(
724724
// by spec computeAccessibleDescription starts with the referenced elements as roots
725725
isReferenced: compute === "description",
726726
recursion: false,
727-
})
727+
}),
728728
);
729729
}

sources/accessible-name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function prohibitsNaming(node: Node): boolean {
3232
*/
3333
export function computeAccessibleName(
3434
root: Element,
35-
options: ComputeTextAlternativeOptions = {}
35+
options: ComputeTextAlternativeOptions = {},
3636
): string {
3737
if (prohibitsNaming(root)) {
3838
return "";

sources/getRole.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function hasGlobalAriaAttributes(element: Element, role: string): boolean {
121121

122122
function ignorePresentationalRole(
123123
element: Element,
124-
implicitRole: string
124+
implicitRole: string,
125125
): boolean {
126126
// https://rawgit.com/w3c/aria/stable/#conflict_resolution_presentation_none
127127
return hasGlobalAriaAttributes(element, implicitRole);

0 commit comments

Comments
 (0)