Skip to content

Commit fddc416

Browse files
authored
Merge pull request ember-a11y#565 from deanmarano/deanmarano/add-prettier
Update prettier
2 parents 67f99c8 + b83c33d commit fddc416

19 files changed

+72
-48
lines changed

Diff for: addon-test-support/audit.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function _isContext(potential: MaybeElementContext) {
4545
*/
4646
export function _normalizeRunParams(
4747
elementContext?: MaybeElementContext,
48-
runOptions?: RunOptions | undefined
48+
runOptions?: RunOptions | undefined,
4949
): [ElementContext, RunOptions] {
5050
let context: ElementContext;
5151
let options: RunOptions | undefined;
@@ -75,7 +75,7 @@ export function _normalizeRunParams(
7575
*/
7676
export default function a11yAudit(
7777
contextSelector: MaybeElementContext = '#ember-testing-container',
78-
axeOptions?: RunOptions | undefined
78+
axeOptions?: RunOptions | undefined,
7979
): PromiseLike<void> {
8080
mark('a11y_audit_start');
8181

Diff for: addon-test-support/format-violation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import type { Result } from 'axe-core';
88
*/
99
export default function formatViolation(
1010
violation: Partial<Result>,
11-
markup: string[]
11+
markup: string[],
1212
) {
1313
if (!violation.impact || !violation.help || !violation.helpUrl) {
1414
throw new Error(
15-
'formatViolation called with improper structure of parameter: violation. Required properties: impact, help, helpUrl.'
15+
'formatViolation called with improper structure of parameter: violation. Required properties: impact, help, helpUrl.',
1616
);
1717
}
1818

Diff for: addon-test-support/logger.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function deduplicateViolations(results: AxeResults) {
7878
*/
7979
function logElement(
8080
node: NodeResult | RelatedNode,
81-
logFn: (...args: any[]) => void
81+
logFn: (...args: any[]) => void,
8282
): void {
8383
const el = document.querySelector(node.target.toString());
8484
if (!el) {
@@ -109,7 +109,7 @@ function logFailureMessage(node: NodeResult, key: AxeCoreNodeResultKey): void {
109109
const message: string = (
110110
axeCore as unknown as AxeWithAudit
111111
)._audit.data.failureSummaries[key].failureMessage(
112-
node[key].map((check) => check.message || '')
112+
node[key].map((check) => check.message || ''),
113113
);
114114

115115
console.error(message);
@@ -189,7 +189,7 @@ export function printResults() {
189189
result.impact,
190190
defaultReset,
191191
result.help,
192-
result.helpUrl
192+
result.helpUrl,
193193
);
194194
result.nodes.forEach((node) => {
195195
failureSummary(node, 'any');

Diff for: addon-test-support/performance.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function measure(comment: string, startMark: string, endMark: string) {
3333
// eslint-disable-next-line no-console
3434
console.warn(
3535
'performance.measure could not be executed because of ',
36-
e.message
36+
e.message,
3737
);
3838
}
3939
}
@@ -48,7 +48,7 @@ export function measure(comment: string, startMark: string, endMark: string) {
4848
export function markEndAndMeasure(
4949
comment: string,
5050
startMark: string,
51-
endMark: string
51+
endMark: string,
5252
) {
5353
if (HAS_PERFORMANCE) {
5454
mark(endMark);

Diff for: addon-test-support/reporter.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const DEFAULT_REPORTER = async (results: AxeResults) => {
1919
let allViolationMessages = allViolations.join('\n');
2020
throw new Error(
2121
`The page should have no accessibility violations. Violations:\n${allViolationMessages}
22-
To rerun this specific failure, use the following query params: &testId=${QUnit.config.current.testId}&enableA11yAudit=true`
22+
To rerun this specific failure, use the following query params: &testId=${QUnit.config.current.testId}&enableA11yAudit=true`,
2323
);
2424
}
2525
};
@@ -37,7 +37,7 @@ export let reportA11yAudit: A11yAuditReporter = DEFAULT_REPORTER;
3737
* @param customReporter {A11yAuditReporter} The reporter to use in a11yAudit
3838
*/
3939
export function setCustomReporter(
40-
customReporter: A11yAuditReporter = DEFAULT_REPORTER
40+
customReporter: A11yAuditReporter = DEFAULT_REPORTER,
4141
) {
4242
reportA11yAudit = customReporter;
4343
}

Diff for: addon-test-support/setup-global-a11y-hooks.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ export const DEFAULT_A11Y_TEST_HELPER_NAMES: HelperName[] = [
4343
export function setupGlobalA11yHooks(shouldAudit: InvocationStrategy): void;
4444
export function setupGlobalA11yHooks(
4545
shouldAudit: InvocationStrategy,
46-
audit: AuditFunction
46+
audit: AuditFunction,
4747
): void;
4848
export function setupGlobalA11yHooks(
4949
shouldAudit: InvocationStrategy,
50-
options: GlobalA11yHookOptions
50+
options: GlobalA11yHookOptions,
5151
): void;
5252
export function setupGlobalA11yHooks(
5353
shouldAudit: InvocationStrategy,
5454
audit: AuditFunction,
55-
options: GlobalA11yHookOptions
55+
options: GlobalA11yHookOptions,
5656
): void;
5757
export function setupGlobalA11yHooks(
5858
shouldAudit: InvocationStrategy,
5959
auditOrOptions?: AuditFunction | GlobalA11yHookOptions,
60-
options?: GlobalA11yHookOptions
60+
options?: GlobalA11yHookOptions,
6161
): void {
6262
let audit: AuditFunction = a11yAudit;
6363

Diff for: addon-test-support/setup-middleware-reporter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function middlewareReporter(axeResults: AxeResults) {
8080
let { module, testName } = QUnit.config.current;
8181
if (!context) {
8282
throw new Error(
83-
'You tried to run ember-a11y-testing without calling one of the `setupTest` helpers from `@ember/test-helpers`. Please make sure your test setup calls `setupTest()`, `setupRenderingTest()`, or `setupApplicationTest()`!'
83+
'You tried to run ember-a11y-testing without calling one of the `setupTest` helpers from `@ember/test-helpers`. Please make sure your test setup calls `setupTest()`, `setupRenderingTest()`, or `setupApplicationTest()`!',
8484
);
8585
}
8686
let testMetaData = getTestMetadata(context);

Diff for: addon-test-support/should-force-audit.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ENABLE_A11Y_AUDIT } from './cli-options';
33
export function _calculateUpdatedHref(
44
href: string,
55
baseURI: string,
6-
enabled: boolean = false
6+
enabled: boolean = false,
77
): string {
88
const url = new URL(href, baseURI);
99
const initialHref = url.href;
@@ -28,7 +28,7 @@ export function setEnableA11yAudit(enabled: boolean = false) {
2828
const href = _calculateUpdatedHref(
2929
window.location.href,
3030
document.baseURI,
31-
enabled
31+
enabled,
3232
);
3333

3434
// Update the URL without reloading

Diff for: cli-options-filter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ class CliOptionsFilter extends Filter {
2323
if (enableMiddlewareReporter) {
2424
contents = contents.replace(
2525
/(ENABLE_A11Y_MIDDLEWARE_REPORTER = )false/,
26-
replacementToken
26+
replacementToken,
2727
);
2828
}
2929

3030
if (enableA11yAudit) {
3131
contents = contents.replace(
3232
/(ENABLE_A11Y_AUDIT = )false/,
33-
replacementToken
33+
replacementToken,
3434
);
3535
}
3636

Diff for: index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = {
6161
~ALLOWED_CONTENT_FOR.indexOf(type)
6262
) {
6363
return fs.readFileSync(
64-
path.join(__dirname, 'content-for', type + '.html')
64+
path.join(__dirname, 'content-for', type + '.html'),
6565
);
6666
}
6767
},

Diff for: node-tests/setup-middleware-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ QUnit.module('setupMiddleware', function (hooks) {
6767
}).then((res) => res.json());
6868

6969
assert.deepEqual(readJSONSync(json.outputPath), data);
70-
}
70+
},
7171
);
7272
});

Diff for: package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@
110110
"ember-truth-helpers": "^3.0.0",
111111
"ember-try": "^2.0.0",
112112
"eslint": "^7.32.0",
113-
"eslint-config-prettier": "^8.3.0",
113+
"eslint-config-prettier": "^9.1.0",
114114
"eslint-plugin-ember": "^10.5.8",
115115
"eslint-plugin-node": "^11.1.0",
116-
"eslint-plugin-prettier": "^4.0.0",
116+
"eslint-plugin-prettier": "^5.2.1",
117117
"eslint-plugin-qunit": "^7.2.0",
118118
"express": "^4.17.2",
119119
"get-port": "^6.0.0",
120120
"loader.js": "^4.7.0",
121121
"node-fetch": "^3.1.0",
122122
"npm-run-all": "^4.1.5",
123-
"prettier": "^2.5.1",
123+
"prettier": "^3.3.3",
124124
"qunit": "^2.17.2",
125125
"qunit-dom": "^2.0.0",
126126
"release-it": "^14.10.0",

Diff for: tests/acceptance/a11y-audit-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module('Acceptance | a11y audit', function (hooks) {
3131
await assert.rejects(
3232
<Promise<any>>a11yAudit(),
3333
/The page should have no accessibility violations. Violations:/,
34-
'error message is correct'
34+
'error message is correct',
3535
);
3636
});
3737

@@ -46,7 +46,7 @@ module('Acceptance | a11y audit', function (hooks) {
4646
await assert.rejects(
4747
<Promise<any>>a11yAudit(SELECTORS.failingComponent),
4848
/The page should have no accessibility violations. Violations:/,
49-
'error message is correct'
49+
'error message is correct',
5050
);
5151
});
5252

Diff for: tests/acceptance/setup-global-a11y-hooks-test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ module('setupGlobalA11yHooks with invokeAll', function (hooks) {
6161
// eslint-disable-next-line qunit/no-conditional-assertions
6262
assert.strictEqual(
6363
actualAuditInvocationsCount,
64-
EXPECTED_AUDIT_INVOCATIONS_COUNT
64+
EXPECTED_AUDIT_INVOCATIONS_COUNT,
6565
);
6666
}
67-
}
67+
},
6868
);
6969
});
7070
});
@@ -116,10 +116,10 @@ module('setupGlobalA11yHooks with invokeEveryN', function (hooks) {
116116
// eslint-disable-next-line qunit/no-conditional-assertions
117117
assert.strictEqual(
118118
actualAuditInvocationsCount,
119-
EXPECTED_AUDIT_INVOCATIONS_COUNT
119+
EXPECTED_AUDIT_INVOCATIONS_COUNT,
120120
);
121121
}
122-
}
122+
},
123123
);
124124
});
125125
});
@@ -174,7 +174,7 @@ module('setupGlobalA11yHooks with invokeWithExclusions', function (hooks) {
174174
'IGNORE: test used to validate setupGlobalA11yHooks (5)',
175175
]);
176176
}
177-
}
177+
},
178178
);
179179
});
180180
});

Diff for: tests/integration/components/setup-global-a11y-hooks-for-render-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ module(
5050
assert.strictEqual(
5151
actualAuditInvocationsCount,
5252
2,
53-
'a11yAudit was automatically called twice'
53+
'a11yAudit was automatically called twice',
5454
);
5555
});
56-
}
56+
},
5757
);

Diff for: tests/integration/helpers/a11y-audit-test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ module('Integration | Helper | a11yAudit', function (hooks) {
2828

2929
test('a11yAudit catches violations successfully', async function (this: Context, assert) {
3030
await render(
31-
hbs`<AxeComponent><button type="button"></button></AxeComponent>`
31+
hbs`<AxeComponent><button type="button"></button></AxeComponent>`,
3232
);
3333

3434
await assert.rejects(
3535
<Promise<any>>a11yAudit(this.element),
3636
/The page should have no accessibility violations. Violations:/,
37-
'error message is correct'
37+
'error message is correct',
3838
);
3939
});
4040

4141
test('a11yAudit can use custom axe options', async function (this: Context, assert) {
4242
await render(
43-
hbs`<AxeComponent><button type="button"></button></AxeComponent>`
43+
hbs`<AxeComponent><button type="button"></button></AxeComponent>`,
4444
);
4545

4646
await a11yAudit(this.element, {
@@ -56,7 +56,7 @@ module('Integration | Helper | a11yAudit', function (hooks) {
5656

5757
test('a11yAudit can use custom axe options as single argument', async function (assert) {
5858
await render(
59-
hbs`<AxeComponent><button type="button"></button></AxeComponent>`
59+
hbs`<AxeComponent><button type="button"></button></AxeComponent>`,
6060
);
6161

6262
await a11yAudit({

Diff for: tests/unit/calculate-updated-href-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module('Query parameter normalization', function (hooks) {
8585
assert.strictEqual(
8686
href,
8787
expectedHref,
88-
`_calculateUpdatedHref( ${url}, ${baseUrl}, ${enabled} ) -> ${href}`
88+
`_calculateUpdatedHref( ${url}, ${baseUrl}, ${enabled} ) -> ${href}`,
8989
);
9090
});
9191
});

Diff for: types/ember-debug.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ declare module '@ember/debug' {
3030
* An optional url to the transition guide on the emberjs.com website.
3131
*/
3232
url?: string | undefined;
33-
}
33+
},
3434
): void;
3535
}

Diff for: yarn.lock

+32-8
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,11 @@
16561656
dependencies:
16571657
"@octokit/openapi-types" "^12.11.0"
16581658

1659+
"@pkgr/core@^0.1.0":
1660+
version "0.1.1"
1661+
resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31"
1662+
integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==
1663+
16591664
"@scalvert/ember-setup-middleware-reporter@^0.1.1":
16601665
version "0.1.1"
16611666
resolved "https://registry.yarnpkg.com/@scalvert/ember-setup-middleware-reporter/-/ember-setup-middleware-reporter-0.1.1.tgz#bdd74c19d99feeef8807dea9c9ee2d272b6c1923"
@@ -5570,10 +5575,10 @@ escodegen@^1.8.1:
55705575
optionalDependencies:
55715576
source-map "~0.6.1"
55725577

5573-
eslint-config-prettier@^8.3.0:
5574-
version "8.8.0"
5575-
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348"
5576-
integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==
5578+
eslint-config-prettier@^9.1.0:
5579+
version "9.1.0"
5580+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
5581+
integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==
55775582

55785583
eslint-formatter-kakoune@^1.0.0:
55795584
version "1.0.0"
@@ -5614,12 +5619,13 @@ eslint-plugin-node@^11.1.0:
56145619
resolve "^1.10.1"
56155620
semver "^6.1.0"
56165621

5617-
eslint-plugin-prettier@^4.0.0:
5618-
version "4.2.1"
5619-
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b"
5620-
integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==
5622+
eslint-plugin-prettier@^5.2.1:
5623+
version "5.2.1"
5624+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz#d1c8f972d8f60e414c25465c163d16f209411f95"
5625+
integrity sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==
56215626
dependencies:
56225627
prettier-linter-helpers "^1.0.0"
5628+
synckit "^0.9.1"
56235629

56245630
eslint-plugin-qunit@^7.2.0:
56255631
version "7.3.4"
@@ -9865,6 +9871,11 @@ prettier@^2.5.1:
98659871
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
98669872
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
98679873

9874+
prettier@^3.3.3:
9875+
version "3.3.3"
9876+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
9877+
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
9878+
98689879
printf@^0.6.1:
98699880
version "0.6.1"
98709881
resolved "https://registry.yarnpkg.com/printf/-/printf-0.6.1.tgz#b9afa3d3b55b7f2e8b1715272479fc756ed88650"
@@ -11381,6 +11392,14 @@ sync-disk-cache@^2.0.0:
1138111392
rimraf "^3.0.0"
1138211393
username-sync "^1.0.2"
1138311394

11395+
synckit@^0.9.1:
11396+
version "0.9.2"
11397+
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.9.2.tgz#a3a935eca7922d48b9e7d6c61822ee6c3ae4ec62"
11398+
integrity sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
11399+
dependencies:
11400+
"@pkgr/core" "^0.1.0"
11401+
tslib "^2.6.2"
11402+
1138411403
table@^6.0.9:
1138511404
version "6.8.1"
1138611405
resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf"
@@ -11666,6 +11685,11 @@ tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0:
1166611685
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913"
1166711686
integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==
1166811687

11688+
tslib@^2.6.2:
11689+
version "2.8.1"
11690+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
11691+
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
11692+
1166911693
tsutils@^3.21.0:
1167011694
version "3.21.0"
1167111695
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"

0 commit comments

Comments
 (0)