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

2677 Commits

Author SHA1 Message Date
Dominik G
ee480bded6
[fix] only read static value for rel attribute validation (#8003)
fixes #7994
2022-11-10 14:00:08 +01:00
Maximiliano Ruani
773dedf714
[feat] Compiler option css: 'none' support (#7914) 2022-11-09 10:21:38 -08:00
Josh Soref
b265bc6f0f
[chore] fix spelling and typos (#7974) 2022-10-27 08:09:18 -07:00
Sid
8921c04a21
[chore] Upgrade css-tree version to 2.1.0 (#7572)
* chore: upgrade to css-tree major version

* fix: handle whitespace token for new ast

* fix: css syntax error

* remove @types/css-tree

* import css-tree/parser instead of file path import

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-16 16:58:34 +08:00
Tan Li Hau
e8b4997bb5
[fix] duplicate meta tags during hydration (#7941) 2022-10-14 14:15:04 +09: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
Tan Li Hau
158ec43d99
[fix] do not warn about missing props for bindings (#6583) 2022-10-06 23:29:48 +09:00
Tan Li Hau
81d4dbad99
[fix] call on_destroy if unmounted called immediately before on_mount (#7860)
* call on_destroy if unmounted called immediately before on_mount

* feat: review changes
2022-10-06 10:21:36 +09:00
Tan Li Hau
5c5bc27d97
[feat] Support style props for SVG components (#7859) 2022-10-06 01:18:37 +09:00
Yuichiro Yamashita
01a91163a9
[fix] Improve error message if this attribute of <svelte:component> is not valid (#7551)
* add test

* improve error message if this attribute of <svelte:component> is not SvelteComponent

* add more tests

* improve validation

* simplify test

Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2022-10-05 23:28:00 +08:00
Tan Li Hau
b20fb114a6
allow nullish values for component event handlers (#7863) 2022-09-21 21:48:01 +08:00
Yuichiro Yamashita
433460ec2d
[feat] skip custom element check if <svelte:element> uses under svg (#7869)
* add test

* skip custom element check if svelte element uses under svg
2022-09-15 22:22:40 +09:00
Yuichiro Yamashita
5adac302c0
[fix] call attribute bindings for custom element if <svelte:element> render custom element (#7766)
* call attr bindings if tag is custom element

* add test
2022-09-13 23:56:19 +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
Yuichiro Yamashita
e2538c594b
[feat] support --style-props for <svelte:component> (#7468)
* add test

* support --style-props for <svelte:component>

* refactor

* add more test

* support switching instance

* add test with svelte:self

* merge duplicated if statement

* slight refactor

* remove unnecessary anchor

* reorder insertion

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-09-13 19:20:45 +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
Mathias Picker
6ec8ecf799
[fix] render of svg elements when using svelte:element (#7695)
* fixed render statement for svg when using  svelte:element

* removed unecessary stuff in test
2022-09-12 03:22:17 +08:00
Tan Li Hau
e2ef2b8731
apply class for dynamic elements (#7652) 2022-09-12 03:14:47 +08:00
Yuichiro Yamashita
1e2a55c88e
throw warning instead of error (#7834) 2022-09-12 02:48:13 +08:00
Maximiliano Ruani
8ffc8fd77b
[fix] Fix hydration duplicate svelte:head tag issue with @html expressions and nested components (#7745)
* Fix hydration duplicate `svelte:head` tag issue with `@html` and nested components #7444 #6463

* - Changed comment style to HEAD_${head_id}_START and HEAD_${head_id}_END
- Improved claim logic
- Changed tests accordingly
2022-09-12 02:35:17 +08:00
Yuichiro Yamashita
07d6d179ab
[fix] style manager transition regression (#7831) 2022-09-08 16:49:57 -04: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
Yuichiro Yamashita
3570a5361e
[fix] Apply class directive properly after half way transition (#7765) 2022-08-14 17:26:19 +09: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
qinmu
5dd703fe81
[fix] handle arrow function on slot inside svelte:fragment (#7667)
Fixes #7485
2022-07-28 18:02:15 +02: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
26d1455b27
fixed removal of empty stylesheets created from transitions (#7662)
Co-authored-by: Mathias Picker <mattis123@live.no>
2022-07-17 17:25:36 +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
kindoflew
7e1691cd62
[fix] support @layer (#7514)
* add test

* add layer to apply check
2022-07-04 23:55:34 +09:00
qinmu
02f60fbebf
[fix]destroy empty component (#7492)
* fix: destroy non-fragment element such as empty components

* fix: fragment property of Empty Component is set as true in dev mode, inconsistent with production mode

* chore: revert 'removal' of component.compile_options.dev

* feat: add test for destroying empty component

* chore: update typechecking callback

* chore: revert fragment dev checks

* chore: remove unnecessary comment

* chore: update test for empty-component-destroy

* fix: revert back the patching of console.log

* use before_test and after_test

Co-authored-by: qinmu <magenta2127@mail.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-04 09:45:39 +08:00
Maurício Kishi
f8605d6acb
[fix] harden attribute escaping during ssr (#7530) 2022-06-20 13:02:48 +02:00
Yuichiro Yamashita
6776fe03fd
fix to apply class directive for svelte:element (#7531) 2022-05-18 11:12:10 +08:00
Yuichiro Yamashita
0d017f4820
[fix] rendering void tag for <svelte:element> (#7453) 2022-04-30 14:37:09 -04:00
Tan Li Hau
a2de3894c0
[feat] support const tag for if block (#7451) 2022-04-30 14:34:58 -04:00
Yuichiro Yamashita
1f1750e72e
[fix] always use set_attributes for attribute of <svelte:element> (#7486) 2022-04-30 14:03:59 -04:00
Yuji Sugiura
a068719208
[fix] do not be over-eager in removing unused CSS for dialog[open] (#7495) 2022-04-30 13:57:49 -04:00
Yuichiro Yamashita
1803290864
[fix] Specify svg namespace if {@html} is used in svg (#7464)
* add test

* create svg element if {@html} tag is inside of svg

* always use claim_html_tag
2022-04-20 00:20:16 +08:00
Yuichiro Yamashita
eb37f4a285
[chore] fix lint (#7466) 2022-04-16 19:16:15 +02:00
lidlanca
fb341cca2c
[fix] textContent should not be set for <template> element. (#7297)
* [fix] textContent should not be set for <template> element.

* tidy - name convetion. minor refactor extract "is template" check to a variable and replace usages.

* test template with text content

* update html in test
2022-04-16 10:24:59 +08:00