-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
faf90ef
commit 35d80a5
Showing
18 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'eslint-plugin-svelte': minor | ||
--- | ||
|
||
feat: support `warningFilter` in `valid-compile` rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
...velte/tests/fixtures/rules/valid-compile/invalid/svelte-config-warning-filter/_config.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @typedef {import("svelte/compiler").Warning} Warning | ||
*/ | ||
module.exports = { | ||
languageOptions: { | ||
parserOptions: { | ||
svelteConfig: { | ||
warningFilter: (warning) => { | ||
return ( | ||
warning.code !== 'a11y_missing_attribute' && warning.code !== 'a11y-missing-attribute' | ||
); | ||
} | ||
} | ||
} | ||
} | ||
}; |
6 changes: 6 additions & 0 deletions
6
.../tests/fixtures/rules/valid-compile/invalid/svelte-config-warning-filter/a11y-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- message: |- | ||
Avoid using autofocus | ||
https://svelte.dev/e/a11y_autofocus(a11y_autofocus) | ||
line: 5 | ||
column: 12 | ||
suggestions: null |
5 changes: 5 additions & 0 deletions
5
...tests/fixtures/rules/valid-compile/invalid/svelte-config-warning-filter/a11y-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
let src = 'tutorial/image.gif'; | ||
</script> | ||
|
||
<img {src} autofocus /> |
3 changes: 3 additions & 0 deletions
3
.../fixtures/rules/valid-compile/invalid/svelte-config-warning-filter/a11y-requirements.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
...-svelte/tests/fixtures/rules/valid-compile/valid/svelte-config-warning-filter/_config.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @typedef {import("svelte/compiler").Warning} Warning | ||
*/ | ||
module.exports = { | ||
languageOptions: { | ||
parserOptions: { | ||
svelteConfig: { | ||
warningFilter: (warning) => { | ||
return ( | ||
warning.code !== 'a11y_missing_attribute' && warning.code !== 'a11y-missing-attribute' | ||
); | ||
} | ||
} | ||
} | ||
} | ||
}; |
5 changes: 5 additions & 0 deletions
5
...e/tests/fixtures/rules/valid-compile/valid/svelte-config-warning-filter/a11y-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
let src = 'tutorial/image.gif'; | ||
</script> | ||
|
||
<img {src} /> |