Skip to content

Commit 199863d

Browse files
authored
fix(eslint-plugin): [quotes] false positive with backtick in import equals statement (typescript-eslint#1769)
1 parent 6646959 commit 199863d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/eslint-plugin/src/rules/quotes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default util.createRule<Options, MessageIds>({
4242
case AST_NODE_TYPES.TSPropertySignature:
4343
case AST_NODE_TYPES.TSModuleDeclaration:
4444
case AST_NODE_TYPES.TSLiteralType:
45+
case AST_NODE_TYPES.TSExternalModuleReference:
4546
return true;
4647

4748
case AST_NODE_TYPES.TSEnumMember:

packages/eslint-plugin/tests/rules/quotes.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ ruleTester.run('quotes', rule, {
310310
code: `export * from "a"; export * from 'b';`,
311311
options: ['backtick'],
312312
},
313-
313+
// `backtick` should not warn import with require.
314+
{
315+
code: `import moment = require('moment');`,
316+
options: ['backtick'],
317+
},
314318
// `backtick` should not warn property/method names (not computed).
315319
{
316320
code: `var obj = {"key0": 0, 'key1': 1};`,

0 commit comments

Comments
 (0)
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