While trying to set a computed property in my Vue component using TypeScript to specify a return type, I encountered an error from eslint. Even though the application functions correctly, the error persists.
I have experimented with removing the typing and also tried associating a get()
, but the issue remains regardless of formatting.
presets():Array<Iperf>{
return this.$store.state.presets.iperf
}
The expected outcome is no error, yet the actual result shows:
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 | }