Skip to content

Commit 98c496e

Browse files
author
Michał Sajnóg
authored
Merge pull request #3 from dwickern/master
Fix error in 'use-brace-expansion' rule
2 parents 1ea35f6 + b8349be commit 98c496e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

rules/use-brace-expansion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function(context) {
2121

2222
if (ember.isComputedProp(node)) {
2323
var properties = node.arguments
24-
.filter(arg => utils.isLiteral(arg))
24+
.filter(arg => utils.isLiteral(arg) && typeof arg.value === 'string')
2525
.map(e => e.value.split('.'))
2626
.filter(e => e.length > 1)
2727
.map(e => e[0])

test/use-brace-expansion.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ eslintTester.run('use-brace-expansion', rule, {
1818
{ code: '{ test: computed(function() {}) }' },
1919
{ code: '{ test: computed("a.test", "b.test", function() {}) }' },
2020
{ code: '{ test: computed("a.{test,test2}", "b", function() {}) }' },
21+
{ code: "{ test: Ember.computed.filterBy('a', 'b', false) }"},
2122
],
2223
invalid: [
2324
{

0 commit comments

Comments
 (0)