I am integrating XO to a Vue Project and I'm having a hard time trying to apply ts rules under .vue
files.
Inside XO, If I update this constant:
const TYPESCRIPT_EXTENSION = [
'ts',
'tsx',
'mts',
'cts',
];
to that:
const TYPESCRIPT_EXTENSION = [
'ts',
'tsx',
'mts',
'cts',
'vue',
];
Then the rules start to get applied to .vue
files, which use Typescript. It seems like extensions
aren't taken into account when it comes to applying ts rules (doesn't fall under the condition of isTypescript
which only takes into account TYPESCRIPT_EXTENSION
), my expectation was to be able to include .vue
files as ts files somehow.
Any ideas on how to solve this issue? This is my current configuration:
"xo": {
"prettier": true,
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"plugins": [
"sonarjs",
"vue"
],
"extends": [
"plugin:sonarjs/recommended-legacy"
],
"extensions": [
"vue"
],
"envs": [
"browser"
],
"semicolon": false,
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "camelCase",
"ignore": [
"\\.vue$"
]
}
],
"unicorn/prevent-abbreviations": [
"error",
{
"replacements": {
"props": false
}
}
]
"overrides": [
{
"files": "level3/**/*.vue",
"extends": [
"plugin:vue/vue3-recommended",
"@vue/eslint-config-typescript/recommended"
]
}
]
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too