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

[@typescript-eslint/ban-types] Does not detect {} with a line break inside #4220

Closed
3 tasks done
HolgerJeromin opened this issue Nov 25, 2021 · 0 comments · Fixed by #4223
Closed
3 tasks done

[@typescript-eslint/ban-types] Does not detect {} with a line break inside #4220

HolgerJeromin opened this issue Nov 25, 2021 · 0 comments · Fixed by #4223
Assignees
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@HolgerJeromin
Copy link

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/ban-types": "error"
  }
}
let foo: {
};
let bar:{};

Expected Result

Both expressions should report the same message:

Don't use {} as a type. {} actually means "any non-nullish value". [...] (@typescript-eslint/ban-types)

Actual Result
The expression with the newline is not detected.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 5.4.0
@typescript-eslint/parser 5.4.0
TypeScript 4.5.2
ESLint 7.32.0
@HolgerJeromin HolgerJeromin added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Nov 25, 2021
@armano2 armano2 added accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working and removed triage Waiting for maintainers to take a look accepting prs Go ahead, send a pull request that resolves this issue labels Nov 25, 2021
@armano2 armano2 self-assigned this Nov 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants