Skip to content

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

@HolgerJeromin

Description

@HolgerJeromin
  • 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

Metadata

Metadata

Assignees

Labels

bugSomething 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