Skip to content

Instantly share code, notes, and snippets.

@khanghh
Created March 22, 2025 10:11
Show Gist options
  • Save khanghh/5c3ac8789e4865b85a5f6528e46ff398 to your computer and use it in GitHub Desktop.
Save khanghh/5c3ac8789e4865b85a5f6528e46ff398 to your computer and use it in GitHub Desktop.
Nuxtjs eslint config
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
export default createConfigForNuxt(
{
features: {
stylistic: {
semi: false,
indent: 2,
quotes: 'single',
},
},
},
{
languageOptions: {
...globals.builtin,
...globals.browser,
...globals.node,
defineNuxtConfig: 'readonly',
defineEventHandler: 'readonly',
}
},
).override('nuxt/vue/rules', {
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/first-attribute-linebreak': 'off',
'vue/multi-word-component-names': 'off',
'vue/html-self-closing': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/html-indent': ['error', 2, { alignAttributesVertically: false }],
'vue/multiline-html-element-content-newline': ['error', {
ignoreWhenEmpty: false,
ignores: ['pre', 'textarea'],
allowEmptyLines: false,
}],
},
})
npx nuxi module add eslint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment