-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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.tstonuxt.config.js. - I also delete the
tsconfig.jsonfile. - I created my
.eslintrcwith 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)
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.