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

typescript: TagValue is missing many values #2312

Closed
stephenmathieson opened this issue Jun 18, 2020 · 2 comments
Closed

typescript: TagValue is missing many values #2312

stephenmathieson opened this issue Jun 18, 2020 · 2 comments
Assignees

Comments

@stephenmathieson
Copy link
Member

stephenmathieson commented Jun 18, 2020

The TagValue type is missing many values. This makes setting these tags impossible when using the TypeScript compiler (as most Attest products do).

Tags that are not allowed by the definition, but are used in axe itself

Each of these tags can be seen in the doc/rule-descriptions.md file.

  • cat.aria
  • cat.color
  • cat.forms
  • cat.keyboard
  • cat.language
  • cat.name-role-value
  • cat.parsing
  • cat.semantics
  • cat.sensory-and-visual-cues
  • cat.structure
  • cat.tables
  • cat.text-alternatives
  • cat.time-and-media
  • section508.22.a
  • section508.22.f
  • section508.22.g
  • section508.22.i
  • section508.22.j
  • section508.22.n
  • section508.22.o
  • wcag111
  • wcag121
  • wcag122
  • wcag131
  • wcag143
  • wcag211
  • wcag221
  • wcag224
  • wcag241
  • wcag242
  • wcag244
  • wcag2aaa
  • wcag311
  • wcag312
  • wcag325
  • wcag332
  • wcag411
  • wcag412
Additional tags used by Attest, but are not seen in the rule-descriptions.md file

Used by Attest, but not seen in axe-core:

  • cat.time
  • section508.22.b
  • wcag125
  • wcag125
  • wcag144

I'm happy to update the TagValue type to include these tags, but this doesn't seem like a sustainable practice, as we're going to eventually add more tags (and forget to add them).

Thoughts on how to continue?

@stephenmathieson
Copy link
Member Author

Related #2313

@straker
Copy link
Contributor

straker commented Jun 18, 2020

Our type file continues to be out of date with our actual API. We should either convert our code to use TypeScript or develop a way to automate the types file. I vote on the former.

stephenmathieson added a commit that referenced this issue Jun 18, 2020
Tags (especially in custom rules) can be any string. Hard-coding this list prevents the ability to use custom tags.

This patch has the unfortunate side-effect of preventing intellisense in TypeScript-enabled editors, but provides more "technically correct" types.

Related #2312
stephenmathieson added a commit that referenced this issue Jun 24, 2020
Tags (especially in custom rules) can be any string. Hard-coding this list prevents the ability to use custom tags.

This patch has the unfortunate side-effect of preventing intellisense in TypeScript-enabled editors, but provides more "technically correct" types.

Related #2312
@straker straker closed this as completed Jul 28, 2020
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

No branches or pull requests

3 participants