0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
Commit Graph

273 Commits

Author SHA1 Message Date
Tim McCabe
cb972ecdba
[chore] fix a11y-no-nointeractive-tabindex typo (#8252) 2023-02-05 20:23:43 +09:00
Ben McCann
34ae6aaf1f
fix: make noreferrer warning less zealous (#8230)
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-28 08:50:14 -08:00
Ming07
1f021226c5
[fix] named slots breaks svelte-ignore comments (#8105)
* [fix] Named slots breaks svelte-ignore comments

Fixes #8075

* test: add tests

* refactor

* refactor test

Co-authored-by: mojinming <mojinming@cmcm.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-02 10:23:35 +08:00
wackbyte
094483b397
[fix] say "nonnegative" instead of "positive" tabIndex for a11y-no-noninteractive-tabindex (#8126) 2023-01-02 09:39:55 +08:00
Bert B
ed3ac92ec0
[fix] Suppress a11y-no-noninteractive-tabindex warning if an element has a tabpanel (#8025)
* update tabindex warning to ignore tabpanels

* refactor

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2022-12-05 23:25:25 +09:00
Torsten Dittmann
676716979a
[fix] a11y - allow fallback roles (#8045) 2022-12-05 23:00:51 +09:00
Dominik G
ee480bded6
[fix] only read static value for rel attribute validation (#8003)
fixes #7994
2022-11-10 14:00:08 +01:00
Josh Soref
b265bc6f0f
[chore] fix spelling and typos (#7974) 2022-10-27 08:09:18 -07:00
Billy Levin
88ed9931f2
warn on assignment to const (#4960)
* warn on assignment to const

* fix formatting and switch to error

* check most local scopes first

* fix logic and add more tests

* more formatting

* Fix broken test

* use find_owner instead

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-13 22:23:07 +08:00
Joffrey LEVEUGLE
c7c6c05c7f
[feat] add security warning for anchor element (rel attribute) (#6289)
* add security warning for anchor element (rel attribute)

* manage more case for security warnings on anchor (aplocks, false positive ...)

* remove noopener checks as noreferrer imples noopener

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-13 21:58:10 +08:00
gtmnayan
bee1851faa
[feat] |important modifier for style directive (#7489)
* important modifier for style directive

* docs

* Exclude third param if false
third param for set_style is optional

* Remove unused test

Runtime test doesn't work because of weird behaviour of computed style
the puppeteer test should cover it

* remove unnecessary test

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-13 21:52:06 +08:00
metonym
26a428972b
[fix] "not interactive" -> "noninteractive" (#7930) 2022-10-13 20:49:00 +08:00
Tan Li Hau
8de7931c64
[feat] better error message for invalid logic block placement (#7862)
* better error message for invalid logic block placement

* include checking for {@html} tags in invalid location
2022-10-07 08:23:12 +08:00
metonym
980aff8a4a
[fix] omit a11y warning for native checkbox/radio inputs (#7838)
* [fix] omit a11y warning for native checkbox/radio inputs

Fixes #7837

* align implementation with eslint-plugin-jsx-a11y

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-09-13 23:44:20 +08:00
MCMXC
82013aa161
feat(a11y): add click-events-have-key-events rule (#5073)
* feat(a11y): add click-events-have-key-events rule

Signed-off-by: mhatvan <markus_hatvan@aon.at>

* Fine-tune click-events-have-key-events rule

Signed-off-by: mhatvan <markus_hatvan@aon.at>

* Implement PR feedback

Signed-off-by: Markus Hatvan <markus_hatvan@aon.at>

* Implement PR feedback

Signed-off-by: Markus Hatvan <markus_hatvan@aon.at>

* slight refactor to use existing utils

* update docs

* fix rebase conflicts

Signed-off-by: mhatvan <markus_hatvan@aon.at>
Signed-off-by: Markus Hatvan <markus_hatvan@aon.at>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: dsfx3d <dsfx3d@gmail.com>
2022-09-13 21:22:10 +08:00
tanhauhau
899d0cc67c update docs for a11y-no-noninteractive-tabindex and rename from a11y-no-nointeractive-tabindex -> a11y-no-noninteractive-tabindex 2022-09-13 19:16:58 +08:00
Shinobu Hayashi
2cd661156e
[feat] Add a11y rule to check no tabindex in nointeractive element (#6693)
* [feature] add util module to check element is interactive element

* [feature] add util module to check role is interactive role

* [feature] add a11y checker for no-nointeractive-tabindex

* [chore] add test for no-nointeractive-tabindex

* [chore] fix tabindex-no-positive test div -> button

* [refactor] bundle up two filter into one

* Refactor: export a11y-no-nointeractive-tabindex warning from compiler_warning

* slight refactor to use existing utils

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-09-13 19:10:45 +08:00
Vaibhav Rai
78b81277e7
[fix]: Warn user when binding rest operator (#7526)
* Fix 6860: Warn user when binding rest operator

* move the binding validation to Binding node

* update test

Co-authored-by: vaibhav rai <vaibhavrai@vaibhavs-MacBook-Pro.local>

* add more test case, supporting deep destructuring and array destructuring

Co-authored-by: vaibhav rai <vaibhavrai@vaibhavs-MacBook-Pro.local>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-09-12 03:28:30 +08:00
Simon H
efe1df0e23
[fix] Only show lowercase component warning for non-html/svg elements (#7826)
Fixes #5712
2022-09-02 07:48:40 -04:00
Niko Simonson
419641bb3e
Recursively check label children for input control (#5323)
* Recursively check label children for input control

* Add another test case

* Update snapshot

* clean up test

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-08-09 00:01:54 +08:00
Tan Li Hau
91b20b9c2e
[fix] error when using combinator incorrectly (#7650)
* error when using combinator incorrectly

* add new test case
2022-07-20 00:01:08 +08:00
Anthony Le Goas
b517df14e4
[feat] check noninteractive roles on interactive elements (#5955)
* check noninteractive roles on interactive elements

* refactor to match the eslint-plugin-jsx-a11y implementation

* update test case

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-17 17:27:35 +08:00
Tan Li Hau
2db60a77e1
rename test files from svelte-slot -> svelte-fragment (#7679) 2022-07-12 23:20:44 +08:00
Anthony Le Goas
f5111ef436
[feat] add a11y check on abstract roles (#6241)
* add a11y check on abstract roles

* use aria-query and move warnings to compiler_warnings file

* uppercase warning message

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-12 06:52:25 +08:00
kwangure
39901986d6
[feat]: Add A11y aria-proptypes check (#6978)
* Add aria prop type list

* feat: check aria attribute types

* feat: add proptype tests

* Add documentation

* use aria-query

Co-authored-by: Nurassyl Zekenov <nurassyl@snoonu.com>
Co-authored-by: mka_882@yahoo.com <mka_882@yahoo.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: David Mosher <davidmosher@gmail.com>
2022-07-11 09:40:12 +08:00
Mel
1d19aebe38
a11y: Add role-has-required-aria-props rule (#5852)
* Check required props for ARIA roles

* Test required ARIA props check

* Properly indent with tabs in test

* swtich to use aria-query

* fix validation test

* update docs

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-11 02:23:41 +08:00
Tan Li Hau
a2de3894c0
[feat] support const tag for if block (#7451) 2022-04-30 14:34:58 -04:00
Henning Groß
9276f85768
[feat] improve error message for animate used in a non-keyed each block (#6838)
* introdcued new compiler error

* making use of newly created compiler error

* updated test for animation not in keyed each

* removed unneeded conditions
2022-04-13 00:22:11 +08:00
Tan Li Hau
d9687da632
each animate allow having comment siblings (#7435)
Co-authored-by: GHOST <ghostdevbusiness@gmail.com>

Co-authored-by: GHOST <ghostdevbusiness@gmail.com>
2022-04-12 16:48:09 +08:00
Yuichiro Yamashita
e0d93254fd
[feature] Dynamic elements implementation <svelte:element> (#6898)
Closes #2324

Co-authored-by: Alfred Ringstad <alfred.ringstad@hyperlab.se>
Co-authored-by: Simon Holthausen <simon.holthausen@accso.de>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-04-08 16:54:55 +02:00
rgossiaux
e2adf6a211
fix: do not generate unused-export-let inside <script context="module"> (#7232)
Fixes #7055. This warning can be delegated to userland tools like eslint
2022-03-02 16:55:02 -08:00
Efe Selim Küçük
587f94eb65
[feat] Better error message for inline component style directive (#7187)
Closes #7177
2022-02-02 08:56:23 +01:00
Yuichiro Yamashita
5665f711fd
[fix] raise compile error if variable name is same as imported variable name (#7145) 2022-01-26 10:16:20 -05:00
Andreas Ehrencrona
a4e4027f79
Handle whitespace inside #each with animation (#5477)
* Strip out whitespace inside each when it has an animation

* remove accidentally committed file

* lint

* add test to validate no error

* update changelog

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2022-01-15 11:47:02 +08:00
Tan Li Hau
b5aaa6641b
[feat] implement constants in markup (#6413) 2022-01-11 17:10:09 -05:00
Tan Li Hau
5e40277167
[feat] add reference for default values in destructuring context (#7007) 2022-01-06 16:05:49 -05:00
James Bradbury
84a4ef07c9
[feat] add a11y-no-redundant-roles check (#7067)
Part of #820
Closes #5361

Co-authored-by: mhatvan <markus_hatvan@aon.at>
2022-01-03 11:33:08 +01:00
Oliver Ford
f48239914d
[fix] warning on reactive use of module const (#6606) (#6607) 2021-08-03 18:10:56 -04:00
Maxime LUCE
0cf5511ae0
[feat] Add errorMode option to compile to allow continuing on errors (and mark them as warnings) (#6194)
This PR adds a new option errorMode to CompileOptions to allow continuing the compilation process when errors occured.
When set to warn, this new option will indicate to Svelte that it should log errors as warnings and continue compilation.

This allows (notably) preprocessors to compile the markup to detect vars in markup before preprocessing (in this case: script and style tags are stripped so it can produce a lot of errors).

This PR is part of a work on the svelte-preprocess side to improve the preprocessing of TypeScript files: https://github.com/sveltejs/svelte-preprocess/issues/318

- allow compiler to pass error as warnings
- enforce stops after errors during compilation (for type-checking, TS doesn't know the error method throws)
- should review Element.ts:302
- added a test case for errorMode
- added documentation
2021-07-17 13:37:29 +02:00
Tan Li Hau
fd031105aa
[fix] do not warn if module variables are not the only dependencies in reactive statements (#6510)
The warning was too strict, since there are valid use cases for having non-reactive variables inside reactive statements
Fixes #5954
2021-07-14 10:01:05 +02:00
Simon H
a8c35daa9a
[fix] be able to silence more warnings (#6504)
including css-unused-selector, unused-export-let, module-script-reactive-declaration
Fixes #5954
Related to #5281
2021-07-14 09:54:15 +02:00
Tan Li Hau
f60cb22a9d
standalone :global() with multiple selectors shouldn't be treated as error (#6508) 2021-07-08 11:24:22 -04:00
Geoff Rich
391258aa10
Remove caption warning on <audio> (#6054) 2021-07-02 12:02:02 -07:00
Geoff Rich
e73f641ca5
Remove deprecated a11y-no-onchange warning (#6457) 2021-06-29 10:46:03 -04:00
Tan Li Hau
fca6a6d38a
:global() with pseudo element should be considered as global (#6470) 2021-06-29 10:45:29 -04:00
Tan Li Hau
98ddf8b588
update periscopic (#6471) 2021-06-29 10:44:54 -04:00
Ignatius Bagus
8c3fb922d8
only check selector that are direct children of :global (#6435)
* failing test for i6434

* use string match to simplify regexp

* more tests

* separate test suite

* test for commas inside attributes

* stricter regex pattern

* test escaped brackets and parentheses

* change latest test selector to lists

* correct failing test for escaped parentheses

* update with proposed pattern
2021-06-29 15:08:58 +08:00
Anthony Le Goas
58790a9281
a11y: check if mouse events are accompanied by key events (#5938) 2021-06-28 12:50:52 +02:00
Dennis Kaspar
b464320607
Add trusted modifier (#6149)
Fixes #6137

Adding a trusted modifier to make events not be dispatchable by console/sourcecode.
Useful to prevent injected code to automatically dispatch event for preventing botting
2021-06-27 18:48:42 +02:00
Roy Choo
228832c9a3
fix: :global(...):some-pseudoclass should be considered global (#6317) 2021-06-22 11:03:08 -04:00