简体   繁体   English

无法加载配置“@nuxtjs”以从

[英]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:将 Typescript 安装到我的 Nuxt 项目中并对其进行配置后,我收到以下警告:

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: ** 这是我的配置步骤:

  • buildModules: ['@nuxt/typescript-build'] in nuxt.config.js buildModules: ['@nuxt/typescript-build']在 nuxt.config.js
  • create the tsconfig.json创建 tsconfig.json
  • create vue-shim.d.ts创建 vue-shim.d.ts
  • install eslint for TypeScript and remove the Nuxt version为 TypeScript 安装 eslint 并删除 Nuxt 版本
  • update the lint script更新 lint 脚本

** Here is my eslintrc.js config: ** 这是我的eslintrc.js配置:

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"
      }
    }]
  }
}

No prior experience to this but the Github for @nuxtjs eslint says the following:没有这方面的经验,但@nuxtjs eslint 的 Github 说明如下:

If you're using TypeScript, follow Usage section by replacing @nuxtjs/eslint-config by @nuxtjs/eslint-config-typescript.如果您使用的是 TypeScript,请按照用法部分将 @nuxtjs/eslint-config 替换为 @nuxtjs/eslint-config-typescript。 And in your.eslintrc all you need is:在 your.eslintrc 中,您只需要:

{
  "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所以基本上你必须运行npm i @nuxtjs/eslint-config-typescript -D然后更新 eslint extends-config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“无法加载配置“airbnb-typescript”以扩展自。” 在谷歌云构建上? - How to solve "Failed to load config "airbnb-typescript" to extend from." on Google Cloud Build? Visual Studio 警告:(ESLint)无法加载配置“defaults/configurations/eslint”以扩展。 引用自 C:\Users\{用户名}\.eslintrc - visual studio warning: (ESLint) Failed to load config "defaults/configurations/eslint" to extend from. Referenced from C:\Users\{username}\.eslintrc eslint 命令在 CI 服务器上失败,并出现错误“ESLint 找不到要扩展的配置”标准“” - eslint command fails on CI Server with error “ESLint couldn't find the config ”standard“ to extend from” 您可以从 Angular 中的 API 调用加载 OKTA_CONFIG 吗? - Can you load OKTA_CONFIG from an API call in Angular? 如何从 nuxtjs typescript 中的 auth 模块(nuxtjs/auth-next)获取 access_token? - How to get access_token from auth module (nuxtjs/auth-next) in nuxtjs typescript? 无法使用 typescript 全局扩展 node.js - Failed to extend node.js global with typescript 使用 NuxtJS 和 AsyncData 方法从 URL 获取查询字符串值 - Fetch query string value from URL with NuxtJS and AsyncData method 无法从Typescript类中的angular Directive加载模板(404) - Failed to load template ( 404 ) from angular Directive in Typescript class Firebase 云功能 - 无法从源加载 function 定义:Restful 端点 - 无法添加定义的端点 - Firebase Cloud functions - Failed to load function definition from source: Restful Endpoints - Failed to add the endpoint defined 加载资源 rxjs 失败 - Failed to load resource rxjs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM