Whenever I utilize the most recent version of eslint to initiate a project, a specific error pops up:
import { ref } from 'vue'
defineProps<{msg: string}>()
const count = ref(0)
Error message: Unexpected token )eslint
Adjusting the code triggers another error:
import { ref } from 'vue'
interface Props{
msg: string
}
defineProps<Props>()
Error message: The keyword 'interface' is reserved eslint
// eslint.cjs
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:vue/vue3-strongly-recommended',
'standard-with-typescript'
],
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json']
},
plugins: [
'vue'
],
rules: {
}
}
However, if I create a project with an older version, no errors are encountered.
The subsequent configuration file does not generate any errors:
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:vue/vue3-strongly-recommended',
'standard'
],
parserOptions: {
ecmaVersion: 12,
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
plugins: [
'vue',
'@typescript-eslint'
],
rules: {
'vue/multi-word-component-names': 0
}
}