For a considerable amount of time, I have been using the TypeScript and Vue presets provided below. While it has been functional, I realize that I do not fully comprehend each option and therefore seek to gain a better understanding. Firstly, what sets apart parser
from @typescript-eslint/parser
?
parser: vue-eslint-parser
parserOptions:
parser: "@typescript-eslint/parser"
sourceType: module
project: tsconfig.json
tsconfigRootDir: ./
extraFileExtensions: [ ".vue" ]
env:
es6: true
browser: true
node: true
plugins:
- "@typescript-eslint"
- vue
Experimental data
In the absence of
parser: "vue-eslint-parser"
, we encounter [unknown]: Parsing error: Unexpected token :
in a TypeScript file at this line:
(async function executeApplication(): Promise<void> {})()
Additionally, we come across
Parsing error: Unexpected token <
in a .vue
file on this line:
<template lang="pug">
If we remove or comment out
parserOptions.parser: "@typescript-eslint/parser"
,
persists.[unknown]: Parsing error: Unexpected token :
- The occurrence of
is eliminated, but instead,Parsing error: Unexpected token <
emerges at theParsing error: Unexpected character '@'
line.@Component export default class extends Vue {
Is it necessary to have both parser
and @typescript-eslint/parser
?