Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [quotes] false positive with backtick in import equals statement #1769

Merged
merged 1 commit into from Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/quotes.ts
Expand Up @@ -42,6 +42,7 @@ export default util.createRule<Options, MessageIds>({
case AST_NODE_TYPES.TSPropertySignature:
case AST_NODE_TYPES.TSModuleDeclaration:
case AST_NODE_TYPES.TSLiteralType:
case AST_NODE_TYPES.TSExternalModuleReference:
return true;

case AST_NODE_TYPES.TSEnumMember:
Expand Down
6 changes: 5 additions & 1 deletion packages/eslint-plugin/tests/rules/quotes.test.ts
Expand Up @@ -310,7 +310,11 @@ ruleTester.run('quotes', rule, {
code: `export * from "a"; export * from 'b';`,
options: ['backtick'],
},

// `backtick` should not warn import with require.
{
code: `import moment = require('moment');`,
options: ['backtick'],
},
// `backtick` should not warn property/method names (not computed).
{
code: `var obj = {"key0": 0, 'key1': 1};`,
Expand Down