【问题标题】:eslint in a Nuxt app is suddenly not working - getting Error: No ESLint configuration foundNuxt 应用程序中的 eslint 突然无法正常工作 - 出现错误:未找到 ESLint 配置
【发布时间】:2019-05-08 05:44:58
【问题描述】:

我上周启动了一个项目。一切都很完美。

我这周回来了,现在 eslint 给了我错误:没有找到 ESLint 配置错误。

我的项目根目录中有 eslintrc.js。

这是我的 NUXT CONFIG 文件的相关部分。

extend(config, ctx) {
  // Run ESLint on save
  if (ctx.isDev && ctx.isClient) {
    config.module.rules.push({
      enforce: 'pre',
      test: /\.(js|vue)$/,
      loader: 'eslint-loader',
      exclude: /(node_modules)/
    })
  }
},

有什么想法吗?

【问题讨论】:

  • eslint的安装文件是否存在?(.eslintrc.js)

标签: eslint nuxt.js


【解决方案1】:

请添加这些行

extend(config, ctx) {
  if (ctx.dev && ctx.isClient) {
    config.module.rules.push({
      enforce: 'pre',
      test: /\.(js|vue)$/,
      loader: 'eslint-loader',
      exclude: /(node_modules)/,
      options: {
        fix: true
      }
    })
  }
}

【讨论】:

  • 您能否链接您的来源或简要解释更改?谢谢:)
猜你喜欢
  • 2017-07-13
  • 2016-11-05
  • 2020-06-07
  • 2020-12-09
  • 1970-01-01
  • 2021-02-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多