-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Move a11y check to the eslint plugin #9485
Comments
I'm completely in favor of this. Largely motivated by sveltejs/language-tools#650. The Svelte community as a whole has spent so many brain cycles trying to engineer around a solved problem. Conventions and patterns already exist for enabling/disabling linting in ESLint and we now have an AST-based plugin which should make it easier. We shouldn't be re-inventing the wheel especially if it's holding us back rather than helping us. There are also a number of accessibility checks that simply don't make sense component-level, but page-level that should happen in SvelteKit (see sveltejs/kit#1265 for example). We should have component & framework level rules in configured in one place (i.e ESLint) and build on the already established patterns in that ecosystem. |
You can export functions from the eslint package (if possible) and use them in svelte. |
This is a... bold statement. What do you anticipate this code would look like, concretely? |
The main code of the a11y checks is in https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/2-analyze/a11y.js and https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/warnings.js. I suggest:
|
Closing this as not planned — a11y checks will remain in Svelte. There's no plausible implementation that relies on an external package, and we don't want to make a11y an optional extra. |
Describe the problem
The current a11y check is far from perfect. There are many open and closed issues related to it.
If a user cares about the quality of his project, including accessibility, he probably uses eslint anyway. For others, frequent warnings only annoy them and they have to turn off the check manually.
Describe the proposed solution
The a11y check is a large number of checks of various sizes and complexity that can be disabled or configured. This is literally a regular eslint plugin.
In addition, it needs to be greatly improved: slots, actions, custom elements, etc. It is better to put all this in a separate repository.
Alternatives considered
Leave everything as it is.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: