一键导入
nuxt-eslint-typescript-setup
Workaround for @nuxt/eslint not auto-detecting TypeScript, causing vue-eslint-parser to fail on <script lang="ts"> blocks
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Workaround for @nuxt/eslint not auto-detecting TypeScript, causing vue-eslint-parser to fail on <script lang="ts"> blocks
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when producing, editing, or reviewing Traditional Chinese technical writing, including comments, documentation, explanations, and Chinese answers that must avoid translationese, casual phrasing, template language, and weak logic.
Audit NixOS impermanence state — find files still on the current filesystem device. Use when the user wants to check for untracked files, audit impermanence, or runs /impermanence-audit.
去除文字中的 AI 生成痕跡。適用於編輯或審閱文字,使其聽起來更自然、更像人類書寫。 基於維基百科的「AI 寫作特徵」綜合指南。偵測並修復以下模式:誇大的象徵意義、 宣傳性語言、以 -ing 結尾的膚淺分析、模糊的歸因、破折號過度使用、三段式法則、 AI 詞彙、否定式排比、過多的連接性短語。
Universal coding standards, best practices, and patterns. Use when developing in any language — triggers on TypeScript, JavaScript, React, Node.js, Python, Nix, ruff, pyright, pytest, uv, flake.nix, justfile, just, recipes, and general code quality topics.
Use when writing git commit messages, reviewing commits, or setting up commit conventions. Triggers on commit, git commit, commit message, changelog, semantic versioning.
A formal evaluation framework for Claude Code sessions, implementing eval-driven development (EDD) principles.
| name | nuxt-eslint-typescript-setup |
| description | Workaround for @nuxt/eslint not auto-detecting TypeScript, causing vue-eslint-parser to fail on <script lang="ts"> blocks |
When adding @nuxt/eslint to a Nuxt 3 project, ESLint fails to parse TypeScript in Vue SFCs with errors like:
Parsing error: Unexpected token {
This happens because @nuxt/eslint does NOT auto-detect TypeScript. Without explicit configuration, features.typescript defaults to false, and vue-eslint-parser never gets parserOptions.parser set to @typescript-eslint/parser.
Explicitly enable TypeScript in nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@nuxt/eslint'],
eslint: {
config: {
typescript: true,
},
},
})
Then run nuxt prepare to regenerate .nuxt/eslint.config.mjs.
You can verify the issue by inspecting the generated config:
node --input-type=module -e "
import { options } from './.nuxt/eslint.config.mjs'
console.log('features:', JSON.stringify(options?.features, null, 2))
"
If typescript: false, that's the problem.
@nuxt/eslint requires ESLint 9 (not 10). ESLint 10 causes peer dependency failures.typescript-eslint as a devDependency alongside @nuxt/eslint.<!-- eslint-disable --> comments placed before <script> do NOT cover the <template> block. Use global rule config or inline comments per usage instead.