nuxt-modules / eslint

ESLint module for Nuxt.js
MIT License
159 stars 15 forks source link

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

Closed mrleblanc101 closed 8 months ago

mrleblanc101 commented 1 year ago

Hi, I'm trying to setup this module to lint my JavaSript (no Typescript) Nuxt 3 project. But I get this warning when Nuxt start:

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

Here is my eslint config:

module.exports = {
    root: true,
    parser: '@babel/eslint-parser',
    env: {
        browser: true,
        node: true,
    },
    parserOptions: {
        ecmaVersion: 'latest',
        requireConfigFile: false,
        sourceType: 'module',
    },
    extends: [
        'eslint:recommended',
        'plugin:vue/essential',
        '@nuxt/eslint-config',
        'plugin:prettier/recommended',
        'prettier',
    ],
    plugins: ['prettier'],
    // add your custom rules here
    rules: {
        'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'vue/no-v-html': 'off',
        'vue/html-button-has-type': 'error',
        // 'import/newline-after-import': 'error',
        'vue/padding-line-between-blocks': ['error', 'always'],
    },
};

And here are my dependencies:

    "devDependencies": {
        "@babel/eslint-parser": "^7.22.15",
        "@nuxt/devtools": "^1.0.0-beta.0",
        "@nuxt/eslint-config": "^0.2.0",
        "@nuxtjs/i18n": "^8.0.0-rc.4",
        "eslint": "^8.50.0",
        "eslint-config-prettier": "^9.0.0",
        "eslint-plugin-prettier": "^5.0.0",
        "eslint-plugin-vue": "^9.17.0",
        "nuxt": "^3.7.4",
        "postcss-html": "^1.5.0",
        "prettier": "^3.0.3",
        "sass": "^1.68.0",
        "stylelint": "^15.10.3",
        "stylelint-config-recommended-vue": "^1.5.0",
        "stylelint-config-standard-scss": "^11.0.0",
        "stylelint-order": "^6.0.3",
        "vite-plugin-eslint": "^1.8.1",
        "vite-plugin-stylelint": "^5.1.1",
        "vite-svg-loader": "^4.0.0"
    },
antfu commented 8 months ago

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.

Why reproduction is required