Open
Description
Tell us about your environment
- ESLint version: 8.17.0
- eslint-plugin-vue version: 9.1.0
- Node version: 16.15.1
The problem you want to solve.
It would be awesome to be able to filter .vue
with lang="ts"
in ESLint overrides
.
Currently, it seems to be not possible.
But if there was an ESLint Processor for Vue, it would be possible to filter for the <script>
lang
(or even <template>
?):
https://eslint.org/docs/user-guide/configuring/plugins#specifying-processor.
Your take on the correct solution to problem.
Implement an ESLint Processor for Vue SFCs.
Something like the following could be possible?
.eslintrc.js
{
plugin: 'vue',
processor: 'vue/sfc-processor',
parser: 'vue-eslint-parser', // why not 'vue/parser'?
overrides: [
{
files: ['*.vue'],
rules: {
// ...
}
},
{
files: ['**/*.vue/*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
]
}
]
}
Additional context
Addresses:
- fix: get the real filename to avoid rule invalidation #1852
- Looking for champion to better support Vue in typescript-eslint #1296
@typescript-eslint/eslint-plugin
crashes when applying rules to Vue SFC<script>
not parsed with@typescript-eslint/parser
vue-eslint-parser#156- fix: add overrides from eslint-recommended also for .vue files eslint-config-typescript#40
Metadata
Metadata
Assignees
Labels
No labels