nuxt / framework

Old repo of Nuxt 3 framework, now on nuxt/nuxt

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eslint/Prettier config that actually works with 3.0.0-rc.8

bf opened this issue · comments

Environment

3.0.0-rc.8 on arch linux

Reproduction

.eslintrc.js

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true,
  },
  parserOptions: {
    ecmaVersion: 2020,
    sourceType: 'module',
    parser: '@typescript-eslint/parser',
  },
  extends: [
    'plugin:@typescript-eslint/recommended',
    'plugin:nuxt/recommended',
    'plugin:vue/vue3-recommended',
    'plugin:prettier/recommended',
  ],
  plugins: ['@typescript-eslint'],
  "rules": { 
   "indent": ["error", 2], 
    "vue/no-v-html": "off",
    "vue/multi-word-component-names": 0 
  }
}

package.json
"lint": "eslint . --fix --ext .ts,.js,.vue",

Describe the bug

For weeks I have been trying to get eslint/prettier to work with nuxt3. Especially linting of the server-side code does not work, or only work on the first start of the application.

Closest to a working solution is vite-plugin-eslint which runs only once on nuxt startup, and which is also unable to automatically fix issues.

Can someone please share a working example where nuxt3 uses eslint both for files in /server/ directory and the client-side .vue files?

On a high level, should eslint be called from a plugin in vite, in nuxt3 itself or via npm lint?

Thank you very much.

Additional context

I keep losing hair about this issue.

Logs

No response