mit einem Klick
nuxt-eslint-typescript-setup
Workaround for @nuxt/eslint not auto-detecting TypeScript, causing vue-eslint-parser to fail on <script lang="ts"> blocks
Menü
Workaround for @nuxt/eslint not auto-detecting TypeScript, causing vue-eslint-parser to fail on <script lang="ts"> blocks
| 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.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.
Audit NixOS impermanence configuration — find files on root filesystem not covered by persistence declarations. Use when the user wants to check for untracked files, audit impermanence, or runs /impermanence-audit.
Docker-in-Docker with network_mode host for multi-node simulation
Use when implementing LangGraph workflows that need to pause for user input or external confirmation before continuing execution