Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Running Linter on main locally #1893

Open
tmpmachine opened this issue Mar 27, 2024 · 4 comments
Open

Error Running Linter on main locally #1893

tmpmachine opened this issue Mar 27, 2024 · 4 comments

Comments

@tmpmachine
Copy link
Contributor

Got error after running the test on main for the first time. Can't find any issue related to this. Is this expected?

npm i
npm run test

Encounter in node version: 10.18.0, 20.12.0

Errors:

PS D:\git\isomorphic-git> npm run test

> isomorphic-git@0.0.0-development test D:\git\isomorphic-git
> nps test

nps is executing `test` : nps lint && nps build && nps test.typecheck && nps test.setup && nps test.jest && nps test.karma && nps test.teardown
nps is executing `lint` : eslint .

D:\git\isomorphic-git\src\api\writeRef.js
  2:1  error  `clean-git-ref` import should occur after import of `../utils/join.js`  import/order

D:\git\isomorphic-git\src\commands\addRemote.js
  4:1  error  `clean-git-ref` import should occur after import of `../managers/GitConfigManager.js`  import/order

D:\git\isomorphic-git\src\commands\branch.js
  4:1  error  `clean-git-ref` import should occur after import of `../managers/GitRefManager.js`  import/order

D:\git\isomorphic-git\src\commands\pack.js
  1:1  error  `sha.js/sha1.js` import should occur after import of `../utils/padHex.js`  import/order

D:\git\isomorphic-git\src\commands\renameBranch.js
  2:1  error  `clean-git-ref` import should occur after import of `../managers/GitRefManager.js`  import/order

D:\git\isomorphic-git\src\http\node\index.js
  1:1  error  `simple-get` import should occur after import of `../../utils/fromNodeStream.js`  import/order

D:\git\isomorphic-git\src\managers\GitIgnoreManager.js
  1:1  error  `ignore` import should occur after import of `../utils/join.js`  import/order

D:\git\isomorphic-git\src\managers\GitIndexManager.js
  2:1  error  `async-lock` import should occur after import of `../utils/compareStats.js`  import/order

D:\git\isomorphic-git\src\managers\GitRefManager.js
  2:1  error  `async-lock` import should occur after import of `./GitConfigManager`  import/order

D:\git\isomorphic-git\src\managers\GitShallowManager.js
  3:1  error  `../utils/join.js` import should occur before import of `async-lock`  import/order

D:\git\isomorphic-git\src\models\FileSystem.js
  1:1  error  `pify` import should occur after import of `../utils/types.js`  import/order

D:\git\isomorphic-git\src\models\GitPackIndex.js
  1:1  error  `crc-32` import should occur after import of `../utils/shasum.js`  import/order

D:\git\isomorphic-git\src\utils\git-list-pack.js
  4:1  error  `pako` import should occur after import of `../utils/StreamReader.js`  import/order

D:\git\isomorphic-git\src\utils\shasum.js
  4:1  error  `./toHex.js` import should occur before import of `sha.js/sha1.js`  import/order

D:\git\isomorphic-git\__tests__\test-log.js
  2:17  error  There should be at least one empty line between import groups                                  import/order
  2:17  error  `@isomorphic-git/pgp-plugin` import should occur after import of `./__helpers__/FixtureFS.js`  import/order

D:\git\isomorphic-git\__tests__\test-merge.js
  2:20  error  There should be at least one empty line between import groups             import/order
  2:20  error  `diff3` import should occur after import of `./__helpers__/FixtureFS.js`  import/order

D:\git\isomorphic-git\__tests__\__helpers__\FixtureFS\makeBrowserFS.js

  17 errors and 0 warnings potentially fixable with the `--fix` option.

The script called "lint" which runs "eslint ." failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "test" which runs "nps lint && nps build && nps test.typecheck && nps test.setup && nps test.jest && nps test.karma && nps test.teardown" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! isomorphic-git@0.0.0-development test: `nps test`
npm ERR!
npm ERR! Failed at the isomorphic-git@0.0.0-development test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SB7\AppData\Roaming\npm-cache\_logs\2024-03-27T09_44_38_042Z-debug.log
@jcubic
Copy link
Contributor

jcubic commented Mar 27, 2024

There were problems running test locally, but recently I run them and they were working fine. I need to check how I've run them. But note that those are lint error. I'm not sure why they show up locally and not in CI/CD.

@jcubic
Copy link
Contributor

jcubic commented Mar 27, 2024

Weird I've got this error:

Error: Cannot find module './.prettierrc.cjs' from '/home/kuba/projects/jcubic/isomorphic-git/TEST/node_modules/isomorphic-git'
Occurred while linting /home/kuba/projects/jcubic/isomorphic-git/TEST/node_modules/isomorphic-git/http/node/index.js:1
    at Function.sync (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/index.js:15946:13)
    at Object.transform (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/index.js:22820:36)
    at run (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4583:30)
    at cacheWrapper (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4358:16)
    at Explorer.searchFromDirectorySync (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4587:16)
    at run (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4580:25)
    at cacheWrapper (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4358:16)
    at Explorer.searchFromDirectorySync (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4587:16)
    at run (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4580:25)
    at cacheWrapper (/home/kuba/projects/jcubic/isomorphic-git/node_modules/prettier/third-party.js:4358:16)
The script called "lint" which runs "eslint ." failed with exit code 2 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "test" which runs "nps lint && nps build && nps test.typecheck && nps test.setup && nps test.jest && nps test.karma && nps test.teardown" failed with exit code 2 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code

But the tests are running fine:

export NODE_OPTIONS=--openssl-legacy-provider
npx nps build && npx nps test.typecheck && npx nps test.setup && npx nps test.jest && npx nps test.karma && npx nps test.teardown

@jcubic jcubic changed the title Error Running Test for The First Time on main Error Running Linter on main locally Mar 27, 2024
@seanpoulter
Copy link
Contributor

I don't think the build/test will work on Node v10. I see an error using flatMap here:
a34579c#diff-8108a824db5615a9442788ac6a5ede7b30df99cd36f8ab4db1ffdf1d569429dcR156-R161

If we scroll over for Node v10, you'll see flatMap isn't supported.
https://node.green/#ES2019-features-Array-prototype--flat--flatMap-

@jcubic
Copy link
Contributor

jcubic commented Apr 6, 2024

We need to update the README and website with supported Node version. This is kind of silly that the README say it supports Node 10. It probably works because of bundled version (the build was not changed since Node 10 was supported).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants