Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rule: "@typescript-eslint/prefer-optional-chain" fails with "Error: Unexpected member object type: TSNonNullExpression" #5553

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@B4nan

Description

@B4nan

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Issue Description

Latest version fails to process the MikroORM codebase. You can see the failed build in CI here:

https://github.com/mikro-orm/mikro-orm/runs/8041169217?check_suite_focus=true

There are more dependency updates, but the error was there even before, when it was only about eslint - I did verify it locally too, by only updating eslint.

$ eslint packages/**/*.tsOops! Something went wrong! :(ESLint: 8.22.0Error: Unexpected member object type: TSNonNullExpressionOccurred while linting /home/runner/work/mikro-orm/mikro-orm/packages/core/src/EntityManager.ts:1104Rule: "@typescript-eslint/prefer-optional-chain"    at getMemberExpressionText (/home/runner/work/mikro-orm/mikro-orm/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js:284:27)    at getText (/home/runner/work/mikro-orm/mikro-orm/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js:2[6](https://github.com/mikro-orm/mikro-orm/runs/8041169217?check_suite_focus=true#step:8:7)3:20)    at LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > Identifier,LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > MemberExpression,LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > ChainExpression > MemberExpression (/home/runner/work/mikro-orm/mikro-orm/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js:12[7](https://github.com/mikro-orm/mikro-orm/runs/8041169217?check_suite_focus=true#step:8:8):40)    at ruleErrorHandler (/home/runner/work/mikro-orm/mikro-orm/node_modules/eslint/lib/linter/linter.js:1114:2[8](https://github.com/mikro-orm/mikro-orm/runs/8041169217?check_suite_focus=true#step:8:9))    at /home/runner/work/mikro-orm/mikro-orm/node_modules/eslint/lib/linter/safe-emitter.js:45:58    at Array.forEach (<anonymous>)    at Object.emit (/home/runner/work/mikro-orm/mikro-orm/node_modules/eslint/lib/linter/safe-emitter.js:45:38)    at NodeEventGenerator.applySelector (/home/runner/work/mikro-orm/mikro-orm/node_modules/eslint/lib/linter/node-event-generator.js:2[9](https://github.com/mikro-orm/mikro-orm/runs/8041169217?check_suite_focus=true#step:8:10)7:26)    at NodeEventGenerator.applySelectors (/home/runner/work/mikro-orm/mikro-orm/node_modules/eslint/lib/linter/node-event-generator.js:326:22)    at NodeEventGenerator.enterNode (/home/runner/work/mikro-orm/mikro-orm/node_modules/eslint/lib/linter/node-event-generator.js:340:[14](https://github.com/mikro-orm/mikro-orm/runs/8041169217?check_suite_focus=true#step:8:15))error Command failed with exit code 2.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The line where it fails is here:

https://github.com/mikro-orm/mikro-orm/blob/40f725e851d0217fb1a3022492f72bcdad331e26/packages/core/src/EntityManager.ts#L1104

Reproduction Repository Link

https://github.com/mikro-orm/mikro-orm

Repro Steps

  1. clone the repo
  2. update eslint to latest version in the root package.json
  3. yarn install
  4. yarn lint

Versions

packageversion
@typescript-eslint/eslint-plugin5.35.1
@typescript-eslint/parser5.35.1
@typescript-eslint/scope-manager5.35.1
@typescript-eslint/typescript-estree5.35.1
@typescript-eslint/type-utils5.35.1
@typescript-eslint/utils5.35.1
TypeScript4.7 &4.8
ESLint8.22.0
node16.16 &18.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp