Skip to content

[no-restricted-imports] No way to use this rule with import = require() syntax. #2563

@rtruong

Description

@rtruong
  • 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": {
    "no-restricted-imports": [
      "error",
      {
        paths: ["lodash"],
      },
    ],
  }
}
import _ = require("lodash");

Expected Result

Should result in a linting error.

Actual Result

No errors.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.1.0
@typescript-eslint/parser 4.1.0
@typescript-eslint/typescript-estree 4.1.0
@typescript-eslint/experimental-utils 4.1.0
TypeScript 3.5.2
node 12.16.3
npm 6.14.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: new base rule extensionNew base rule extension required to handle a TS specific casepackage: 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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy