Skip to content

Eslint marks parameter for 'options' as error #574

Discussion options

You must be logged in to vote

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 the scrollbars.visibility field isn't accepting any string but just certain ones. And since Eslint or your type checker identified 'auto' as a string 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:

<overlay-scrollbars
  [options]="{ scrollbars: { visibility: 'auto' } } as const"
>

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by benjamin-hoefer-fnt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@KingSora
Comment options

@benjamin-hoefer-fnt
Comment options

@benjamin-hoefer-fnt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants