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

289 Commits

Author SHA1 Message Date
Simon H
6ce6f14755
fix: relax a11y-no-noninteractive-element-to-interactive-role warning (#8402)
#8167 introduced the strict version of it - until this is configurable, we should use the relaxed version instead, since many a11y docs actually advise using ul/ol etc
2023-03-21 10:51:05 +01:00
Nguyen Tran
fed93ab9e1
feat: add a11y interactive-supports-focus (#8392)
#820
2023-03-20 13:18:54 +01:00
Dave Lunny
f56fe33931
feat: bind:innerText for contenteditable (#4291)
closes #3311

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-03-16 10:58:49 +01:00
Nguyen Tran
26c38e750c
feat: add a11y no-noninteractive-element-to-interactive-role (#8167)
Part of #820
2023-03-14 10:51:40 +01:00
Tan Li Hau
d525901556
fix validation for global compound selector (#8344) 2023-03-02 09:24:33 +01:00
Tan Li Hau
c611f318d2
feat: add stopImmediatePropagation event modifier (#8341)
Closes #5085

---------

Co-authored-by: Marcin Wicha <23581770+marcin-wicha@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-03-01 11:51:40 +01:00
Roy Choo
acbf8135a8
fix: add global compound selector validation (#6322)
fixes #6272
prevents invalid CSS output

---------

Co-authored-by: Roy Choo <roy.choo@bytedance.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-03-01 11:28:59 +01:00
Nguyen Tran
ed575cc927
fix: make svelte-ignore work above components (#8338)
Fixes #8082, where svelte-ignore somehow does not pick up the reactive-component warning.

The issue on this problem is that the map_children function suppresses warnings and errors while traversing AST nodes as src/compiler/compile/nodes classes. However, the reactive-component warning is called in src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts, and its warnings are not suppressed in map_children. Thus, we need to extract ignores and suppress here separately.
2023-03-01 11:06:15 +01:00
Simon H
60db05da86
fix: hide some a11y warnings for <svelte:element> tags (#8335)
Some a11y warnings only work on specific tags, which results in potential false positives for `<svelte:element>` tags - silence those
closes #7939
2023-03-01 00:01:40 +08:00
Cory Virok
32a94fcfc5
chore: implemented a small runtime optimization for SSR (#7539)
Prior to this change, the compiler would generate a template literal that had many purely static
string variables nested within it. This change collapses these static strings into the surrounding
template literal which should result in (minor) size and performance improvements for the SSR
generated code.

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-27 16:32:45 +01:00
Vaibhav Rai
26104eaaba
fix: no error assigning to a const property (#7966)
Fixes #7964
currently for a case where the parent type is ArrayPattern code needs to check if the elements are of direct type MemberExpression or Identifier, in the case of MemberExpression there will be an Identifier check for the Object of the MemberExpression.

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-27 13:45:14 +01:00
Nguyen Tran
b56dfe51a8
feat: add a11y role-supports-aria-props (#8195)
#820

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-27 12:28:59 +01:00
Yuichiro Yamashita
5f99ae76ce
chore: Reduce number of lines of expected files (#8325)
- removes character and pos from the expected output to reduce noise
- adds a test that pos/character are correct
2023-02-27 11:40:24 +01:00
Vaibhav
c9a269c149
fix: silence no content a11y warning if the tag has an aria-label (#8299)
fixes #8296

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-22 17:19:33 +01:00
ngtr6788
3559997223
feat: implement a11y aria-activedescendant-has-tabindex (#8172)
#820
2023-02-22 17:14:21 +01:00
Carlos Ivanchuk
aa9b2dd5f3
fix: omit a11y warning on <video> when aria-hidden="true" (#7880)
Related to #5967. Closes #7874

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 17:27:49 +01:00
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