mirror of https://github.com/sveltejs/svelte
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 https://github.com/sveltejs/language-tools/issues/650pull/12296/head
parent
eb3e677e05
commit
281debfc62
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
feat: add ability to ignore warnings through compiler option
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
warnings: {
|
||||
ignore: ['a11y_missing_attribute', 'a11y_misplaced_scope']
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
<div>
|
||||
<img src="this-is-fine.jpg" />
|
||||
<marquee>but this is still discouraged</marquee>
|
||||
</div>
|
||||
|
||||
<div scope></div>
|
||||
|
||||
<img src="potato.jpg" />
|
||||
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "a11y_distracting_elements",
|
||||
"end": {
|
||||
"column": 49,
|
||||
"line": 3
|
||||
},
|
||||
"message": "Avoid `<marquee>` elements",
|
||||
"start": {
|
||||
"column": 1,
|
||||
"line": 3
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in new issue