Skip to content

[ban-types] Doesn't work with namespaced type #135

Closed
@SimenB

Description

@SimenB

Repro

{
  "rules": {
    "@typescript-eslint/ban-types": [
      "error",
      {
        "types": {
          "React.FunctionComponent": {
            "message": "Use React.FC instead",
            "fixWith": "React.FC"
          }
        }
      }
    ]
  }
}
import * as React from 'react';

const Thing: React.FunctionComponent = () => 'foobar';

Expected Result
Should be reported, and fixed to React.FC

Actual Result
Not reported

Additional Info
Removing React. from the rule and the code makes it work correctly

Versions

package version
@typescript-eslint/eslint-plugin 1.1.0
@typescript-eslint/parser 1.1.0
TypeScript 3.2.4
ESLint 5.12.1
node 10.15.0
yarn 1.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthas prthere is a PR raised to close thispackage: 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