Eslint marks parameter for 'options' as error #574
-
Hi! When I use the 'options' property and set for example the visibility to 'auto' eslint marks everything as an error and I get the message: "Type {scrollbars: {visibility: string}} is not assignable to type PartialOptions | false | null ". What can I do to avoid this? Kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Good day @benjamin-hoefer-fnt This doesn't happen on my side, but the error I'm not too familiar with angular, but is there a possibility to mark this object as Something like this: <overlay-scrollbars
[options]="{ scrollbars: { visibility: 'auto' } } as const"
> |
Beta Was this translation helpful? Give feedback.
-
Good morning! I tried the narrowing but it does not work. It is quite strange. I also do not get an autocompleting by my ide. Actually it should suggest the key/values according to the defined types. Something on the config seems not to be correct. But thank you anyway! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Good day @benjamin-hoefer-fnt
This doesn't happen on my side, but the error
Type {scrollbars: {visibility: string}} is not assignable to type PartialOptions | false | null
is correct, because thescrollbars.visibility
field isn't accepting any string but just certain ones. And since Eslint or your type checker identified'auto'
as astring
this error is valid.I'm not too familiar with angular, but is there a possibility to mark this object as
const
? This would lead to type narrowing and fix the issue.Something like this: