Andri Sul
Andri Sul

Reputation: 505

Failed to load config "@nuxtjs" to extend from

Anyone, please help me

After installing Typescript into my Nuxt project and configure it I get this warn:

WARN  Compiled with 1 warnings                                                            
Module Warning (from ./node_modules/eslint-loader/dist/cjs.js):                            friendly-errors 11:28:18
Failed to load config "@nuxtjs" to extend from.
Referenced from: /home/x/nuxt-project/.eslintrc.js                                 friendly-errors 11:28:18
You may use special comments to disable some warnings.                                     friendly-errors 11:28:18
Use // eslint-disable-next-line to ignore the next line.                                   friendly-errors 11:28:18
Use /* eslint-disable */ to ignore all warnings in a file.                                 friendly-errors 11:28:18

What does it mean and how to solve it?

** Here is my configuration steps:

** Here is my eslintrc.js config:

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true
  },
  parserOptions: {
    parser: 'babel-eslint',
      ecmaFeatures: {
      legacyDecorators: true
    }
  },
  extends: [
    '@nuxtjs',
    'plugin:nuxt/recommended',
    'eslint:recommended',
    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
    'plugin:vue/recommended'
  ],
  plugins: [
    'vue'
  ],
  // add your custom rules here
  rules: {
    'semi': [2, 'never'],
    'no-console': 'off',
    'vue/max-attributes-per-line': 'off',
    "vue/html-self-closing": ["error", {
      "html": {
        "void": "always",
        "normal": "never",
        "component": "any"
      }
    }]
  }
}

Upvotes: 1

Views: 6673

Answers (1)

discolor
discolor

Reputation: 1376

No prior experience to this but the Github for @nuxtjs eslint says the following:

If you're using TypeScript, follow Usage section by replacing @nuxtjs/eslint-config by @nuxtjs/eslint-config-typescript. And in your .eslintrc all you need is:

{
  "extends": [
    "@nuxtjs/eslint-config-typescript"
  ]
}

So basically you have to run npm i @nuxtjs/eslint-config-typescript -D and then update the eslint extends-config

Upvotes: 3

Related Questions