Skip to content

ESLint behaves differently on different system #4540

Closed

Description

@rekmarks

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)

Activity

  1. MajorLift commented on Jul 18, 2024

    @MajorLift
    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.

  2. rekmarks commented on Jul 19, 2024

    @rekmarks
    ContributorAuthor

    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
  3. rekmarks commented on Jul 19, 2024

    @rekmarks
    ContributorAuthor

    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.

  4. mcmire commented on Jul 22, 2024

    @mcmire
    Collaborator

    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

  5. mcmire commented on Oct 23, 2024

    @mcmire
    Collaborator

    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.

  6. mcmire commented on Jan 9, 2025

    @mcmire
    Collaborator

    I've just merged in #4727 which bumped all of the lint packages. I ran yarn lint locally and no longer see the false positive I was seeing before (not the one I mentioned above, but a different one with KeyringController). So it's possible that this problem is now solved, but we should keep an eye on it for now.

  7. mcmire commented on Feb 4, 2025

    @mcmire
    Collaborator

    With the upgrade to the ESLint 9, the false positives around the typescript-eslint rules seem to be gone (in fact there are tons of eslint-disable lines we can now remove). I think the inconsistencies in behavior we were seeing before are basically gone as well. @mikesposito did report an issue in a recent PR, but I think this was due to an outdated ESLint cache file rather than a bug in any one rule.

    I'm going to close this ticket for now and we can reopen it if we see it again.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-wallet-frameworkDeprecated: Please use `team-core-platform` instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions