ITADN

Default Nuxt 4 project with ESLint fails to parse defineEmits in <script setup lang="ts">

#622Closedineptchan 创建于 2025-10-20
pending triage
I
ineptchancommented
### Environment - Operating System: Windows_NT - Node Version: v22.18.0 - Nuxt Version: 4.1.3 - CLI Version: 3.29.3 - Nitro Version: 2.12.7 - Package Manager: pnpm@10.14.0 - Builder: - - User Config: compatibilityDate, devtools, modules - Runtime Modules: @nuxt/eslint@1.9.0 - Build Modules: - ### Package None ### Reproduction Create a new clean project and select only @nuxt/eslint module ``` pnpm create nuxt@latest nuxt_test √ Installation completed. nuxi 17:10:24 undefined √ Initialize git repository? undefined No undefined √ Would you like to install any of the official modules? undefined Yes undefined √ Pick the modules to install: undefined @nuxt/eslint – Project-aware, easy-to-use, extensible and future-proof ESLint integration ``` Create a Vue component components/Test.vue ``` <template> <div> </div> </template> <script lang="ts" setup> const emit = defineEmits<{ change: [id: number] update: [value: string] }>() //or const emit = defineEmits<{ (e: 'change', id: number): void (e: 'update', value: string): void }>() </script> ``` ### Describe the bug In a fresh Nuxt 4 project generated via `pnpm create nuxt@latest`, using `defineEmits` inside <script setup lang="ts"> triggers an ESLint parsing error: Parsing error: Unexpected token ### Additional context _No response_ ### Logs ```shell-script ```
关闭于 2025-12-24 2 条评论