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

Allowing for modes on a11y #9188

Closed
plutoniumm opened this issue Sep 7, 2023 · 1 comment · Fixed by #12296
Closed

Allowing for modes on a11y #9188

plutoniumm opened this issue Sep 7, 2023 · 1 comment · Fixed by #12296

Comments

@plutoniumm
Copy link

plutoniumm commented Sep 7, 2023

Describe the problem

When building applications, I often don't need A11y since I know it will just be me on the other end of the app. There are times when I know that A11y will be THE main feature. Due to this distinct range, I can see why Svelte's A11y is slightly aggressive but not by a lot.

So it'll be nice to have modes enabled in the (vite|svelte).config.js file where the default is current settings, and otherwise, I can select the sensitivity of A11y

Describe the proposed solution

// vite.config.js 
const config = defineConfig( {
	plugins: [ svelte( {
		a11y: 'off' // or 'strict' or 'default'
	} ) ],
} );

So here when off, it would turn off ALL a11y features, including img alt, whereas when strict may in some way ask for aria-x per component. I can see that is very non-trivial to decide at what SCALE to implement A11y since people may make a component for a part of a card which may not really need an A11y, but I think we can resolve that with some community input

Alternatives considered

I did look for alternatives, as extensions as such, but there don't really exist lightweight ones/ ones with sensible defaults. Additionally, this is going to be a svelte compiler modifying behaviour and will modify only a small part of the system namely the warnings generated by the compiler

Currently I resort to using a combination of eslint and/or turning off warnings as needed

Importance

would make my life easier

PS: I'm willing to contribute/help out in anyway i can

@j3rem1e
Copy link

j3rem1e commented Sep 8, 2023

Imo a11y warning should be part of the eslint plugin.

dummdidumm added a commit that referenced this issue Jul 4, 2024
Some people want to disable certain warnings for their whole application without having to add svelte-ignore comments everywhere. This new option makes that possible.
closes #9188
part of sveltejs/language-tools#650
dummdidumm added a commit that referenced this issue Jul 4, 2024
Some people want to disable certain warnings for their whole application without having to add svelte-ignore comments everywhere. This new option makes that possible.
closes #9188
part of sveltejs/language-tools#650
Rich-Harris added a commit that referenced this issue Jul 16, 2024
* feat: add ability to ignore warnings through compiler option

Some people want to disable certain warnings for their whole application without having to add svelte-ignore comments everywhere. This new option makes that possible.
closes #9188
part of sveltejs/language-tools#650

* make it a function

* singular

* warningFilter

* make internal filter non-nullable

* Update .changeset/little-seals-reflect.md

* filter_warning -> warning_filter, for symmetry with public option

* fix

---------

Co-authored-by: Rich Harris <[email protected]>
trueadm pushed a commit that referenced this issue Jul 16, 2024
* feat: add ability to ignore warnings through compiler option

Some people want to disable certain warnings for their whole application without having to add svelte-ignore comments everywhere. This new option makes that possible.
closes #9188
part of sveltejs/language-tools#650

* make it a function

* singular

* warningFilter

* make internal filter non-nullable

* Update .changeset/little-seals-reflect.md

* filter_warning -> warning_filter, for symmetry with public option

* fix

---------

Co-authored-by: Rich Harris <[email protected]>
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 a pull request may close this issue.

2 participants