pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Fails to run with eslint 8.0.0 version #96

Closed ganeshrn closed 2 years ago

ganeshrn commented 2 years ago

Reference links: https://results.pre-commit.ci/run/github/389989116/1633953619.iNs6lsoUTKWGgpbSYshWoQ https://github.com/ansible/ansible-language-server/pull/54

TypeError: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.json': Class extends value undefined is not a constructor or null
Referenced from: /code/.eslintrc.json
    at Object.<anonymous> (/pc/clone/GYc0WlWsS52N5ZCR9AajJw/node_env-system/lib/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js:12:34)
    at Module._compile (/pc/clone/GYc0WlWsS52N5ZCR9AajJw/node_env-system/lib/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (/pc/clone/GYc0WlWsS52N5ZCR9AajJw/node_env-system/lib/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/pc/clone/GYc0WlWsS52N5ZCR9AajJw/node_env-system/lib/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js:14:14)
    at Module._compile (/pc/clone/GYc0WlWsS52N5ZCR9AajJw/node_env-system/lib/node_modules/eslint/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
asottile commented 2 years ago

this isn't a pre-commit or pre-commit.ci issue -- that configuration never succeeded when it was introduced

ssbarnea commented 2 years ago

The reality is that the project does mention 7.32.0 in package.json and 7.30.0 inside https://github.com/ansible/ansible-language-server/blob/main/.pre-commit-config.yaml#L70 -- so there are no reasons why it should ever run with a pre-release version of eslint.

When running pre-commit locally it works fine, but when run on pre-commit.ci it does use a different version and fails.

Where does the 8.0.0 comes from because is clearly not from inside the repository config?

The statement that the config never succeeded when it was introduced, with linked to merged pr. That config did run a lint job which executed pre-commit tool on it and reported success.

The pre-commit configuration did not change in the last 11 days but if we are looking at the eslint hook, we can see some very recent changes related to 8.0.0 beta. Considering that one of the main features of pre-commit is pinning the version of the hooks, seeing 8.0.0 was an unexpected surprise. My impression is that the tag is not used.

asottile commented 2 years ago

your config requests unpinned eslint: https://github.com/ansible/ansible-language-server/blob/15567404bf706c24fb217e99cedaa3109c61342f/.pre-commit-config.yaml#L80

ssbarnea commented 2 years ago

Ouch (head-in-wall), copy/pasta error on deps. Thanks for pointing it and sorry for bothering you.