nuxt / eslint

Collection of ESLint-related packages for Nuxt

Home Page:https://eslint.nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

upgrade to eslint 8.0.0

GaborTorma opened this issue · comments

now i get the following error messages:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nuxtjs/eslint-config@6.0.1
npm ERR! Found: eslint@8.0.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^8.0.0" from the root project
npm ERR!   peer eslint@">=7.5.0" from @babel/eslint-parser@7.15.7
npm ERR!   node_modules/@babel/eslint-parser
npm ERR!     @babel/eslint-parser@"^7.12.16" from eslint-template-visitor@2.3.2
npm ERR!     node_modules/eslint-template-visitor
npm ERR!       eslint-template-visitor@"^2.2.2" from eslint-plugin-unicorn@28.0.2
npm ERR!       node_modules/eslint-plugin-unicorn
npm ERR!         eslint-plugin-unicorn@"^28.0.2" from @nuxtjs/eslint-config@6.0.1
npm ERR!         node_modules/@nuxtjs/eslint-config
npm ERR!   18 more (@nuxtjs/eslint-module, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^7.27.0" from @nuxtjs/eslint-config@6.0.1
npm ERR! node_modules/@nuxtjs/eslint-config
npm ERR!   dev @nuxtjs/eslint-config@"=6.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint@7.32.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^7.27.0" from @nuxtjs/eslint-config@6.0.1
npm ERR!   node_modules/@nuxtjs/eslint-config
npm ERR!     dev @nuxtjs/eslint-config@"=6.0.1" from the root project
# npm resolution error report

2021-10-10T05:18:56.471Z

While resolving: cc@2.0.0-19
Found: eslint@8.0.0
node_modules/eslint
  dev eslint@"^8.0.0" from the root project

Could not resolve dependency:
peer eslint@"^7.27.0" from @nuxtjs/eslint-config@6.0.1
node_modules/@nuxtjs/eslint-config
  dev @nuxtjs/eslint-config@"=6.0.1" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "eslint",
    "version": "8.0.0",
    "whileInstalling": {
      "name": "cc",
      "version": "2.0.0-19",
      "path": "/home/tgc/dev/app"
    },
    "location": "node_modules/eslint",
    "isWorkspace": false,
    "dependents": [
      {
        "type": "dev",
        "name": "eslint",
        "spec": "^8.0.0",
        "from": {
          "location": "/home/tgc/dev/app"
        }
      }
    ]
  },
  "currentEdge": {
    "type": "dev",
    "name": "eslint",
    "spec": "^8.0.0",
    "from": {
      "location": "/home/tgc/dev/app"
    }
  },
  "edge": {
    "type": "peer",
    "name": "eslint",
    "spec": "^7.27.0",
    "error": "INVALID",
    "from": {
      "name": "@nuxtjs/eslint-config",
      "version": "6.0.1",
      "whileInstalling": {
        "name": "cc",
        "version": "2.0.0-19",
        "path": "/home/tgc/dev/app"
      },
      "location": "node_modules/@nuxtjs/eslint-config",
      "isWorkspace": false,
      "dependents": [
        {
          "type": "dev",
          "name": "@nuxtjs/eslint-config",
          "spec": "=6.0.1",
          "from": {
            "location": "/home/tgc/dev/app"
          }
        }
      ]
    }
  },
  "strictPeerDeps": false,
  "force": false
}

Here's what I get:

c:\Users\User\myProject>yarn lint
yarn run v1.22.15
$ eslint --fix --ext .js,.vue client/

Oops! Something went wrong! :(

ESLint: 8.0.0

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'import' declared in '.eslintrc.js » @nuxtjs/eslint-config': Package subpath './lib/util/glob-util' is not defined by "exports" in c:\Users\User\myProject\node_modules\eslint\package.json
Referenced from: c:\Users\User\myProject\node_modules\@nuxtjs\eslint-config\index.js
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (c:\Users\User\myProject\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object.<anonymous> (c:\Users\User\myProject\node_modules\eslint-plugin-import\lib\rules\no-unused-modules.js:43:34)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

At first it seemed to work on my side after yarn dev.
But I get Environment key "jest/globals" is unknown #98 every time I save now.

I believe this should be solved.

commented

Hi,
I just upgraded eslint from 7.30.0 to 8.17.0, and eslint-plugin-nuxt from 2.0.0 to 3.2.0, i.e. the latest and greatest versions of each.

I am getting the error talked about is this issue, and the infuriating thing is that I don't even use Jest or have it installed. I have searched around and tried different fixes and nothing seems to help. The "Details" are below.

Now every time I open a file in my (RubyMine) IDE I get an annoying red banner at the top of the file.

Can someone please re-open this or tell me what I should do?

Thanks,
Larry

Error: .eslintrc.js » @nuxtjs/eslint-config:
Environment key "jest/globals" is unknown

Error: .eslintrc.js » @nuxtjs/eslint-config:
Environment key "jest/globals" is unknown

at /home/larry/RubymineProjects/FrontEnd/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2058:23
at Array.forEach (<anonymous>)
at ConfigValidator.validateEnvironment (/home/larry/RubymineProjects/FrontEnd/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2052:34)
at ConfigValidator.validateConfigArray (/home/larry/RubymineProjects/FrontEnd/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2202:18)
at CascadingConfigArrayFactory._finalizeConfigArray (/home/larry/RubymineProjects/FrontEnd/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3947:23)
at CascadingConfigArrayFactory.getConfigArrayForFile (/home/larry/RubymineProjects/FrontEnd/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3753:21)
at CLIEngine.isPathIgnored (/home/larry/RubymineProjects/FrontEnd/node_modules/eslint/lib/cli-engine/cli-engine.js:989:18)
at ESLint.isPathIgnored (/home/larry/RubymineProjects/FrontEnd/node_modules/eslint/lib/eslint/eslint.js:678:26)
at ESLint8Plugin.<anonymous> (/snap/rubymine/290/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint8-plugin.js:164:57)
at step (/snap/rubymine/290/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint8-plugin.js:44:23)

Process finished with exit code -1

commented

Hello again,

I found another of your issues related to this (#98) and they said to make sure @nuxtjs/eslint-config was updated. I was way behind on that so I updated from 6.0.1 to the latest, 10.0.0

The "jest/globals" error message went away, but now I have this:
Error: ENOENT: no such file or directory, open '/node_modules/@nuxtjs/eslint-config/node_modules/eslint-config-standard/index.js'

I have node/modules/@nuxtjs/esling-config... but no /node_modules directory under that => I need to look into this.

I can't work on this any more today, but I wanted to add this update so as not to waste anyone's time on my error. I will look into this tomorrow and report back. Hopefully I can resolve the problem and this will help anyone else who stumbles across this.

commented

Well, the error message I copied and pasted above didn't even appear when I fired up my IDE the next day. (Seems to happen to a lot of folks: one day the error message just showed up, and the next day it disappeared.)
There were other error messages => other rabbit holes to descend into and spend time in. (And then they wonder why people hate upgrading software - man, it can be soooo painful and sooo time-consuming.)
Anyway, finally got everything resolved => no need to re-open.
P.S. Thanks to all of the work you good people do to provide us with free software. I know it must be a RPITA at times, and it is MUCH APPRECIATED!