Skip to content

[quotes] False positive with backtick in require lines #1766

@regevbr

Description

@regevbr

Repro

{
  "rules": {
        "@typescript-eslint/quotes": [
            "error",
            "backtick"
        ]
  }
}
import moment = require('moment');

Expected Result

Should not produce any error

Actual Result

produces an error, and fix will cause typescript compilation to fail as back ticks are not valid in a require statement.

Additional info
When you need to import from old modules that use the following syntax

export = ...

You must use

import moment = require('moment');

to import them, and the rule alerts on those.

Versions

package version
@typescript-eslint/eslint-plugin ^2.24.0
@typescript-eslint/parser ^2.24.0
TypeScript ^3.8.3
ESLint ^6.8.0
node v10.19.0
npm 6.13.4
moment ^2.24.0

Related Issues
#762
#757
#756

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerspackage: 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