Replies: 2 comments
-
Babel doesn't support angle-bracket type casting, so you might as well do this instead: const hasActiveType = filters.some((filter) => (Object.values(InvoicesType) as string[]).includes(filter.value)) If you need any more reasons to use
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html You might also have luck with const hasActiveType = filters.some((filter) => (Object.values<string>(InvoicesType)).includes(filter.value)) |
Beta Was this translation helpful? Give feedback.
-
In one of the projects I manage, I also encountered this issue and came across this discussion. // .eslintrc
{
rules: {
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
},
],
}
} |
Beta Was this translation helpful? Give feedback.
-
Hello, I have seen this problem (#109 & #81).
In my case, it does not work. Does anyone have any idea why?
It return :
The problem come from
<string[]>
.My config :
Beta Was this translation helpful? Give feedback.
All reactions