Accessors are throwing type errors and there's no autocomplete for them
See original GitHub issueDescribe the bug Accessors work, but are throwing type errors and there’s no autocomplete for them.
To Reproduce Install Svelte-ts-template, update all dependencies and test with this simple App while using the latest Svelte for VSCode (v104.6.4):
Expected behavior No type errors. Autocomplete: ability to select accessors from the list.
System (please complete the following information):
- Windows 10
- VSCode
- Svelte for VSCode v104.6.4
Additional context
"devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-typescript": "^8.2.0",
"@tsconfig/svelte": "^1.0.10",
"rollup": "^2.41.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^3.35.0",
"svelte-check": "^1.2.5",
"svelte-preprocess": "^4.6.9",
"tslib": "^2.1.0",
"typescript": "^4.2.3"
},
"dependencies": {
"sirv-cli": "^1.0.11"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Improve error message "No value accessor for form control ...
When you get the error No value accessor for form control with unspecified name attribute , there are generally two things that possibly...
Read more >No value accessor for form control with unspecified name ...
I fixed this error by adding the name="fieldName" ngDefaultControl attributes to the element that carries the [(ngModel)] attribute.
Read more >Angular Development #8 - Control Value Accessor
Learn about the well-known and some lesser known uses of ControlValueAccessor in the latest post of our series on Angular Development.
Read more >9 UX Best Practice Design Patterns for Autocomplete ...
Sweetwater displays 20 autocomplete suggestions on desktop, including some redundancies (e.g., “drumsticks” and “drum sticks”) that can make it ...
Read more >TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes the eslint error does not matter, we can do all kinds of dirty stuff in there 😄 One thing I noticed is that the generated code for a setter is
set foo(foo)
without{}
afterwards which is invalid syntax. This needs to be added. Also one more test to check if there’s no setter for things likeexport const foo = ''
is created would be good. Other than this looks good, you might as well go ahead and open a PR and we can put the finishing touches to it over there 👍@dummdidumm Ok, I’m done! 👉
add-accessors-autocomplete(branch deleted after PR merge)Remarks:
type SvelteTsxRender
is not even needed to infer the type of the setter, since corresponding getters are also always generated for accessors, so they can be used for that. With this solution there’s an adjacent-overload-signatures eslint error in the generated tsx class, but I guess this is not important, right?setters: {}
object in therender()
output. All 217 svelte2tsx tests are passing.Feedback much appreciated + I’m awaiting further instructions. Thanks!