svelte
svelte copied to clipboard
[fix]: Warn user when binding rest operator
Fioxes: https://github.com/sveltejs/svelte/issues/6860
- [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [x] Prefix your PR title with
[feat],[fix],[chore], or[docs]. - [x] This message body should clearly illustrate what problems it solves.
- [x] Ideally, include a test that fails without this PR but passes with it.
Tests
- [x] Run the tests with
npm testand lint the project withnpm run lint
Hey @tanhauhau can you check the PR and help me with the test, I ran my changes locally and I can see the warning when I am using the same component on repl but on test it says there is no warning.
Therefore you need to move the validation into parse part.
Hey @baseballyama please check the changes in the test repo
Actually existing warning checks are at the parse step. (constructor of Node) I still didn't think alternative implementing idea. (So I'm sorry if there is no alternative implementing way) but personally, this change seems like architecture breaking. (But we need to wait for maintainer's thoughts)
And 75 tests failed. I think there are actual failures so maybe you need to fix them.
Thank you for the response, most checks are failing because of the test runner change, I will check and fix this.
Actually existing warning checks are at the parse step. (constructor of Node)
i've moved the validation from the compile/render-dom/wrappers/Element/Binding to compile/nodes/Binding
Hey, @tanhauhau thank you for the update and refactoring :+1: