Skip to content

[no-extra-non-null-assertion] incorrect report for assertion in an optional chain #2166

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

Closed
bradzacher opened this issue Jun 3, 2020 · 0 comments · Fixed by #2167
Closed
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@bradzacher
Copy link
Member

Repro

cc @sindresorhus @fregante
refined-github/refined-github#3168 (comment)

{
  "rules": {
    "@typescript-eslint/no-extra-non-null-assertion": ["error"]
  }
}
checksCounter?.textContent!.trim()

Expected Result

No errors

Actual Result

   checksCounter?.textContent!.trim()
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Forbidden extra non-null assertion.

Versions

package version
@typescript-eslint/eslint-plugin master
@typescript-eslint/parser master
TypeScript 3.9.x
@bradzacher bradzacher added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin labels Jun 3, 2020
@bradzacher bradzacher changed the title [no-extra-non-null-assertion] issue title [no-extra-non-null-assertion] incorrect report for assertion in an optional chain in 3.9 Jun 3, 2020
@bradzacher bradzacher changed the title [no-extra-non-null-assertion] incorrect report for assertion in an optional chain in 3.9 [no-extra-non-null-assertion] incorrect report for assertion in an optional chain Jun 3, 2020
@bradzacher bradzacher added the has pr there is a PR raised to close this label Jun 3, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
1 participant