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

ESLint behaves differently on different system #4540

Open
rekmarks opened this issue Jul 18, 2024 · 5 comments
Open

ESLint behaves differently on different system #4540

rekmarks opened this issue Jul 18, 2024 · 5 comments

Comments

@rekmarks
Copy link
Member

Recently, @mcmire put up #4537 to address some lint errors he observes locally (ref: #4537 (comment)). These began to appear on his system after my PR #4521. I am unable to observe the same errors. On the other hand, I observe no less than 44 errors from the root yarn lint on current main (b7fa70e):

ESLint output

./packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts
  115:63  error  Invalid type "Infer" of template literal expression  @typescript-eslint/restrict-template-expressions
  154:70  error  Invalid type "any" of template literal expression         @typescript-eslint/restrict-template-expressions

./packages/json-rpc-middleware-stream/src/index.test.ts
34:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises

./packages/permission-controller/src/permission-middleware.ts
89:34 error Invalid type "any" of template literal expression @typescript-eslint/restrict-template-expressions

./packages/permission-log-controller/tests/PermissionLogController.test.ts
108:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
135:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
161:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
185:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
211:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
235:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
243:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
251:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
315:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
343:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
394:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
409:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
424:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
431:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
453:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
484:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
489:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
511:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
538:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
548:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
570:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
593:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
619:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
640:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
658:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
714:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
755:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises

./packages/queued-request-controller/src/QueuedRequestMiddleware.test.ts
17:21 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
31:21 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
45:21 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
59:21 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
73:23 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
97:23 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
118:23 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
134:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
158:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
182:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises
203:25 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises

./packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts
43:21 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
72:23 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises

✖ 44 problems (44 errors, 0 warnings)

@MajorLift
Copy link
Contributor

Comment thread where two more people experienced this: #4506 (comment)

In my case, it was something about my local dev environment that was off. Unfortunately, I didn't document the fix that ended up working, and haven't been able to repro the bug.

It wasn't a complex fix. It might have been removing node_modules and reinstalling dependencies, removing eslint cache, or something of the sort.

@rekmarks
Copy link
Member Author

I did several variations of the following to no effect:

# in ./core

# I don't know that there's more than one of these, but it's best to be sure
find . -type f -name ".eslintcache" -exec rm {} +
rm -rf node_modules
yarn cache clean

@rekmarks
Copy link
Member Author

ESLint succeeds in fresh clone of the repo, but only in a different directory on my system. If I delete my original copy of the repo and replace it with the freshly cloned copy, it starts failing again. There are no .eslintconfig files in any parent directory, and the Node versions are the same. This is definitely local to my system, but I don't understand the hell that I'm in.

I'll leave this open for other people who are debugging their local ESLint behavior.

@mcmire mcmire mentioned this issue Jul 22, 2024
3 tasks
@mcmire
Copy link
Contributor

mcmire commented Jul 22, 2024

I've just run into this problem again. There are two lint issues I see locally. I have tried all of the solutions posted above to remove them without success. I've attempted to fix these here but we shouldn't have to do this: #4545

@mcmire
Copy link
Contributor

mcmire commented Oct 23, 2024

Still running into this problem as of October 2024 — this time it's the @typescript-eslint/restrict-template-expression that's failing locally for me (but obviously not failing in CI, otherwise CI would be failing on main). This ESLint rule has failed numerous times in the past for me and is rather unreliable, so it's not a surprise, but still, rather annoying.

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

No branches or pull requests

4 participants