I am setting a computed property in my Vue component using typescript to define a return type and eslint is giving me an error. Any ideas on what is going on? The application runs as expected
I have attempted removing the typing or setting a get() associated however the problem persists no matter the formatting.
presets():Array<Iperf>{
return this.$store.state.presets.iperf
}
The expected results should be no error, however the actual result is:
Module Warning (from ./node_modules/eslint-loader/index.js):
error: Parsing error: '}' expected at src\views\Iperf.view.vue:58:17:
56 | },
57 | computed: {
> 58 | presets():Array<Iperf>{
| ^
59 | return this.$store.state.presets.iperf
60 | }
61 | }
I figured out that ESLINT was trying to parse my TypeScript as JSX. So I fixed some formatting.
Cannot use: iperf:<Iperf>{}
Use insetad: iperf: {} as Iperf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With