scaffold-eth-2: bug: ESLint Error

Which method was used to setup Scaffold-ETH 2 ?

git clone, npx create-eth@latest

Current Behavior

Linter not working so i dont get squigles warning me of unused variables, imports, ect.

image

I do still get blocked from committing and get warnings explained when the lint script runs

image

Expected Behavior

Here is what it looks like on older version of scaffold when Linter works without error

image

Steps To Reproduce

Happens instantly with fresh clone and fresh npx create-eth@latest

Anything else?

The ESLint error logs

[Info  - 1:46:49 PM] ESLint server is starting.
[Info  - 1:46:49 PM] ESLint server running in node v20.9.0
[Info  - 1:46:49 PM] ESLint server is running.
[Info  - 1:46:50 PM] ESLint library loaded from: /home/matthu/Desktop/test/packages/nextjs/node_modules/eslint/lib/api.js
Pages directory cannot be found at /home/matthu/Desktop/test/pages or /home/matthu/Desktop/test/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.
[Error - 1:46:52 PM] An unexpected error occurred:
[Error - 1:46:52 PM] Error: Cannot find package '@trivago/prettier-plugin-sort-imports' imported from /home/matthu/Desktop/test/noop.js
    at new NodeError (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:16425:5)
    at packageResolve (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:17366:9)
    at moduleResolve (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:17406:18)
    at defaultResolve (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:17497:16)
    at resolve2 (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:17514:12)
    at importFromFile (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:17529:16)
    at importFromDirectory (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:22444:10)
    at importPlugin (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:22456:12)
    at async loadPluginWithoutCache (file:///home/matthu/Desktop/test/packages/nextjs/node_modules/prettier/index.mjs:22460:18)
    at async Promise.all (index 0)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

Just update on this, was debugging with @MattPereira and seems like #875 is the culprit if he checks out to #869 i.e after clonning the main repo and then doing :

git checkout a78be8761e1d039218cccf57d60a4de56261d859 && yarn install

It does seem to solve the problem for him.

Would love if you guys could test it out.

Also if it doesn’t work then maybe #904 would the way to go it seems

It doesn’t work for me too, but I didn’t even notice it 😄 since unused vars have less opacity and it’s enough for me

I think there are other benefits besides just the unused imports / vars. The linter being broken blocks out all warnings including missing dependencies in complex useEffect hooks

image

And if you miss a single warning the linter check will fail in the github action, which is a small annoyance requiring an extra commit to fix 🫠

I agree!

Prolly not cool enough to switch to make the switch to neovim yet 🤣

But very open to using a different extension if there are recommendations