Skip to content

Commit

Permalink
fix: enhance ExportNamedDeclaration
Browse files Browse the repository at this point in the history
  • Loading branch information
edvardchen committed Jul 24, 2019
1 parent fc00d0f commit 29e9f29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-literal-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ module.exports = {
visited.add(node);
},

'ExportNamedDeclaration Literal'(node) {
'ExportNamedDeclaration > Literal'(node) {
// allow export { named } from 'mod'
visited.add(node);
},
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-literal-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ ruleTester.run('no-literal-string', rule, {
],

invalid: [
{ code: 'export const a = "hello_string";', errors },
{ code: 'const a = "foo";', errors },
{ code: 'const a = call("Ffo");', errors },
{ code: 'var a = {foo: "bar"};', errors },
Expand Down

0 comments on commit 29e9f29

Please sign in to comment.