Skip to content

chore(lint): Ensure EOL newlines #42629

chore(lint): Ensure EOL newlines

chore(lint): Ensure EOL newlines #42629

Triggered via pull request December 20, 2024 14:51
Status Failure
Total duration 4m 11s
Artifacts

infra.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

1 error and 11 warnings
Lint snippets
Process completed with exit code 1.
Lint snippets
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 10 | expect(accessibilityScanResults.violations).toEqual([]); // 5 11 | }); > 12 | }); | ^ Unable to lint: import { test, expect } from '@playwright/test'; import AxeBuilder from '@axe-core/playwright'; // 1 test.describe('homepage', () => { // 2 test('should not have any automatically detectable accessibility issues', async ({ page }) => { await page.goto('https://your-site.com/'); // 3 const accessibilityScanResults = await new AxeBuilder({ page }).analyze(); // 4 expect(accessibilityScanResults.violations).toEqual([]); // 5 }); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 10 | expect(accessibilityScanResults.violations).toEqual([]); // 5 11 | }); > 12 | }); | ^ Unable to lint: const { test, expect } = require('@playwright/test'); const AxeBuilder = require('@axe-core/playwright').default; // 1 test.describe('homepage', () => { // 2 test('should not have any automatically detectable accessibility issues', async ({ page }) => { await page.goto('https://your-site.com/'); // 3 const accessibilityScanResults = await new AxeBuilder({ page }).analyze(); // 4 expect(accessibilityScanResults.violations).toEqual([]); // 5 }); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 16 | 17 | expect(accessibilityScanResults.violations).toEqual([]); > 18 | }); | ^ Unable to lint: test('navigation menu should not have automatically detectable accessibility violations', async ({ page, }) => { await page.goto('https://your-site.com/'); await page.getByRole('button', { name: 'Navigation Menu' }).click(); // It is important to waitFor() the page to be in the desired // state *before* running analyze(). Otherwise, axe might not // find all the elements your test expects it to scan. await page.locator('#navigation-menu-flyout').waitFor(); const accessibilityScanResults = await new AxeBuilder({ page }) .include('#navigation-menu-flyout') .analyze(); expect(accessibilityScanResults.violations).toEqual([]); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 7 | 8 | expect(accessibilityScanResults.violations).toEqual([]); > 9 | }); | ^ Unable to lint: test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => { await page.goto('https://your-site.com/'); const accessibilityScanResults = await new AxeBuilder({ page }) .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']) .analyze(); expect(accessibilityScanResults.violations).toEqual([]); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 9 | 10 | expect(accessibilityScanResults.violations).toEqual([]); > 11 | }); | ^ Unable to lint: test('should not have any accessibility violations outside of elements with known issues', async ({ page, }) => { await page.goto('https://your-site.com/page-with-known-issues'); const accessibilityScanResults = await new AxeBuilder({ page }) .exclude('#element-with-known-issue') .analyze(); expect(accessibilityScanResults.violations).toEqual([]); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 9 | 10 | expect(accessibilityScanResults.violations).toEqual([]); > 11 | }); | ^ Unable to lint: test('should not have any accessibility violations outside of rules with known issues', async ({ page, }) => { await page.goto('https://your-site.com/page-with-known-issues'); const accessibilityScanResults = await new AxeBuilder({ page }) .disableRules(['duplicate-id']) .analyze(); expect(accessibilityScanResults.violations).toEqual([]); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 1 | // Don't do this! This is fragile. > 2 | expect(accessibilityScanResults.violations).toMatchSnapshot(); | ^ Unable to lint: // Don't do this! This is fragile. expect(accessibilityScanResults.violations).toMatchSnapshot();
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 12 | 13 | return JSON.stringify(violationFingerprints, null, 2); > 14 | } | ^ Unable to lint: // This is less fragile than snapshotting the entire violations array. expect(violationFingerprints(accessibilityScanResults)).toMatchSnapshot(); // my-test-utils.js function violationFingerprints(accessibilityScanResults) { const violationFingerprints = accessibilityScanResults.violations.map(violation => ({ rule: violation.id, // These are CSS selectors which uniquely identify each element with // a violation of the rule in question. targets: violation.nodes.map(node => node.target), })); return JSON.stringify(violationFingerprints, null, 2); }
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 10 | 11 | expect(accessibilityScanResults.violations).toEqual([]); > 12 | }); | ^ Unable to lint: test('example with attachment', async ({ page }, testInfo) => { await page.goto('https://your-site.com/'); const accessibilityScanResults = await new AxeBuilder({ page }).analyze(); await testInfo.attach('accessibility-scan-results', { body: JSON.stringify(accessibilityScanResults, null, 2), contentType: 'application/json' }); expect(accessibilityScanResults.violations).toEqual([]); });
js linting error: docs/src/accessibility-testing-js.md#L1
Error: Newline required at end of file but not found. 19 | } 20 | }); > 21 | export { expect } from '@playwright/test'; | ^ Unable to lint: import { test as base } from '@playwright/test'; import AxeBuilder from '@axe-core/playwright'; type AxeFixture = { makeAxeBuilder: () => AxeBuilder; }; // Extend base test by providing "makeAxeBuilder" // // This new "test" can be used in multiple test files, and each of them will get // a consistently configured AxeBuilder instance. export const test = base.extend<AxeFixture>({ makeAxeBuilder: async ({ page }, use, testInfo) => { const makeAxeBuilder = () => new AxeBuilder({ page }) .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']) .exclude('#commonly-reused-element-with-known-issue'); await use(makeAxeBuilder); } }); export { expect } from '@playwright/test';