Skip to content
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

Feature/add a11y linter #3642

Closed
wants to merge 3 commits into from
Closed

Conversation

VachetVirginie
Copy link
Contributor

@VachetVirginie VachetVirginie commented Jul 24, 2024

Description

Ajout des linters antfu et a11y
https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility

Scenario de test:

  1. Supprimer les node_modules
  2. Re installer
  3. pnpm lint avec le playground ci-dessous

Playground

<template>
  <h1> Accessibility tests </h1>
  <div>
    <h2>Alt-text</h2>
    <div>
      <h3> Succeed </h3>
      <img src="foo" alt="Foo eating a sandwich." />
      <img src="foo" :alt="altText" />
      <img src="foo" alt="" />

      <object aria-label="foo" />
      <object aria-labelledby="id1" />
      <object>Meaningful description</object>
      <object title="An object" />

      <area aria-label="foo" />
      <area aria-labelledby="id1" />
      <area alt="This is descriptive!" />

      <input type="image" alt="This is descriptive!" />
      <input type="image" aria-label="foo" />
      <input type="image" aria-labelledby="id1" />

      <h3> Fail </h3>
      <img src="foo" />
      <img alt />
      <!-- Has no value -->
      <img src="foo" role="presentation" />
      <!-- Avoid ARIA if it can be achieved without -->
      <img src="foo" role="none" />
      <!-- Avoid ARIA if it can be achieved without -->

      <object />
      <area />
      <input type="image" />
    </div>
  </div>
</template>

@VachetVirginie VachetVirginie force-pushed the feature/add-a11y-linter branch 4 times, most recently from af3b6e0 to 85fcf08 Compare July 24, 2024 15:12
@VachetVirginie VachetVirginie requested review from DavidFyon and 4dr1en and removed request for DavidFyon and 4dr1en July 24, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant