Skip to content

Reference @nuxt/eslint-config in the README #114

@mrleblanc101

Description

@mrleblanc101

Am I the only one finding configuring ESLint in Nuxt 3 very confusing ?
I'm trying to setup eslint for a JavaScript project (no Typescript), and I can't find reliable documentation.
Every .eslintrc file i find use parser: '@typescript-eslint/parser', but I can't make it work with @babel/eslint-parser

  • First, I used nuxi to create my project and renamed my nuxt.config.ts to nuxt.config.js.
  • I also delete the tsconfig.json file.
  • I created my .eslintrc with a basic config like this:
module.exports = {
    root: true,
    env: {
        browser: true,
        node: true,
    },
    parser: '@babel/eslint-parser',
    parserOptions: {
        ecmaVersion: 'latest',
        requireConfigFile: false,
        sourceType: 'module',
    },
    extends: [
        'eslint:recommended',
        'plugin:vue/essential',
        '@nuxt/eslint-config',
        'plugin:prettier/recommended',
        'prettier',
    ],
    plugins: ['prettier'],
};

But i get this error:

Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): "jsx", "flow", "typescript". (1:0)

Screenshot 2023-10-08 at 10 23 43 PM

Second, shouldn't the nuxt 3 version of this module be in the @nuxt namespace instead of the @nuxtjs namespace ?
Because the @nuxtjs/eslint-config and @nuxtjs/esling-config-typescript package are meant for Nuxt 2 and the Nuxt 3 version are called @nuxt/eslint-config and @nuxt/eslint-config-typescript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions