The Wayback Machine - https://web.archive.org/web/20210508044903/https://github.com/rome/tools/issues/1345
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搸 Port most of the a11y-jsx rules under the new a11y category rules #1345

Open
ematipico opened this issue Feb 8, 2021 · 5 comments
Open

Comments

@ematipico
Copy link
Member

@ematipico ematipico commented Feb 8, 2021

Recently, we created a new lint category called a11y. This new category is meant to be generic and work for JSX and HTML at the same time.

At the moment, we ported only two rules and we should to the same for most of the a11y-jsx we currently have

@mainangethe
Copy link
Contributor

@mainangethe mainangethe commented Feb 28, 2021

Hi @ematipico ,
I'd like to take this up. Though I'm not sure what it means when you say you "ported"

Could you give a more details surrounding what I should do to port a rule, so that I can be able to start.

@ematipico
Copy link
Member Author

@ematipico ematipico commented Mar 1, 2021

Hi @mainangethe

You can use this PR as example #1346

At the moment we have a bunch of rules that target some a11y requirements. These rules are tailored around JSX AST. Now that we have a working HTML AST parser, what we want to do is to make these rules a bit generic.

So we have to take those rules that are under jsx-a11y and move them under the category a11y. Not only that: we want to add HTML support, which means that one rule will be valid for JSX and HTML at the same time.

These are the steps we should follow to move an existing JSX rule:

  • create a new rule under the category a11y; the same of the rule should be the same of the one you plan to work on;
  • copy/paste the existing rule inside the new file (and tests too);
  • remove from the code base all the references to the old rule, e.g.: "jsx-a11y/useOldRule", "lint/jsx-a11y/useOldRule";
  • extend the rule to handle HTML too;
  • add new test cases for a HTML file;
@zant
Copy link
Contributor

@zant zant commented Apr 1, 2021

Hi! I'll be working on noHeaderScope :)

@imrishabh18
Copy link

@imrishabh18 imrishabh18 commented May 4, 2021

@ematipico Are some more rules left to be ported than I can work on? I am new to this

@ematipico
Copy link
Member Author

@ematipico ematipico commented May 4, 2021

@ematipico Are some more rules left to be ported than I can work on? I am new to this

useHeadingContent is available! useAnchorContent too. They are both simple to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment