Configure ESLint with createConfigForNuxt
mainThe project uses @nuxt/eslint-config/flat to generate a Nuxt-compatible ESLint configuration via the createConfigForNuxt function. This allows you to enable specific Nuxt features and define which directories should be linted.
Configuration Options
features
An object to enable or disable specific ESLint feature sets:
tooling: Enables tooling-related rules.stylistic: Enables stylistic rules.
dirs
An object defining the directories to be included in the linting process. The src key accepts an array of paths.
.append()
After calling createConfigForNuxt, you can use the .append() method to add custom ESLint rules to the generated configuration.
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
export default createConfigForNuxt({
features: {
tooling: true,
stylistic: true,
},
dirs: {
src: ['./examples/app-vitest'],
},
}).append({
rules: {
'vue/multi-word-component-names': 'off',
},
})