vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 666 forks source link

eslint in the script scoped does not take effect #2469

Closed rainTai closed 5 months ago

rainTai commented 5 months ago

Checklist

Tell us about your environment

Please show your full configuration:

import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';

export default [
  pluginJs.configs.recommended,
  ...tseslint.configs.recommended,
  ...pluginVue.configs['flat/strongly-recommended'],
  {
    languageOptions: {
      globals: { ...globals.browser, ...globals.es2020, ...globals.node },
      ecmaVersion: 2022,
    },
    files: [
      '**/*.vue',
      '**/*.js',
      '**/*.jsx',
      '**/*.cjs',
      '**/*.mjs',
      '**/*.ts',
      '**/*.tsx',
      '**/*.cts',
      '**/*.mts',
    ],
    ignores: ['uno.config.ts'],
  },
];

What did you do?

<script setup lang="ts">
import { Document, Menu as IconMenu, Location, Setting } from '@element-plus/icons-vue';

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};

const data = "zzz"

const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
</script>

What did you expect to happen? i hope eslint9 can check vue files script scoped,by seems like its no working,ts is not even recognized

What actually happened?

eslint9 not work in script

Repository to reproduce this issue