diff --git a/fixtures/finnish-with-$/fixture.ts b/fixtures/finnish-with-$/fixture.ts index 8654d8ac..d64e8e08 100644 --- a/fixtures/finnish-with-$/fixture.ts +++ b/fixtures/finnish-with-$/fixture.ts @@ -4,8 +4,8 @@ import "rxjs/add/observable/of"; const someObservable$ = Observable.of(0); const someEmptyObject = {}; -const someObject = { someKey$: someObservable$ }; -const { ...someEmptyObject, someKey$ } = someObject; +const someObject = { ...someEmptyObject, someKey$: someObservable$ }; +const { someKey$ } = someObject; const { someKey$: someRenamedKey$ } = someObject; const someArray = [someObservable$]; diff --git a/fixtures/finnish-without-$/fixture.ts b/fixtures/finnish-without-$/fixture.ts index 524dfed7..f5cbdfac 100644 --- a/fixtures/finnish-without-$/fixture.ts +++ b/fixtures/finnish-without-$/fixture.ts @@ -4,8 +4,8 @@ import "rxjs/add/observable/of"; const someObservable = Observable.of(0); const someEmptyObject = {}; -const someObject = { someKey: someObservable }; -const { ...someEmptyObject, someKey } = someObject; +const someObject = { ...someEmptyObject, someKey: someObservable }; +const { someKey } = someObject; const { someKey: someRenamedKey } = someObject; const someArray = [someObservable]; diff --git a/fixtures/no-finnish-with-$/fixture.ts b/fixtures/no-finnish-with-$/fixture.ts index 8654d8ac..d64e8e08 100644 --- a/fixtures/no-finnish-with-$/fixture.ts +++ b/fixtures/no-finnish-with-$/fixture.ts @@ -4,8 +4,8 @@ import "rxjs/add/observable/of"; const someObservable$ = Observable.of(0); const someEmptyObject = {}; -const someObject = { someKey$: someObservable$ }; -const { ...someEmptyObject, someKey$ } = someObject; +const someObject = { ...someEmptyObject, someKey$: someObservable$ }; +const { someKey$ } = someObject; const { someKey$: someRenamedKey$ } = someObject; const someArray = [someObservable$]; diff --git a/fixtures/no-finnish-without-$/fixture.ts b/fixtures/no-finnish-without-$/fixture.ts index 524dfed7..f5cbdfac 100644 --- a/fixtures/no-finnish-without-$/fixture.ts +++ b/fixtures/no-finnish-without-$/fixture.ts @@ -4,8 +4,8 @@ import "rxjs/add/observable/of"; const someObservable = Observable.of(0); const someEmptyObject = {}; -const someObject = { someKey: someObservable }; -const { ...someEmptyObject, someKey } = someObject; +const someObject = { ...someEmptyObject, someKey: someObservable }; +const { someKey } = someObject; const { someKey: someRenamedKey } = someObject; const someArray = [someObservable]; diff --git a/source/rules/rxjsFinnishRule.ts b/source/rules/rxjsFinnishRule.ts index ffbfbe59..53999269 100644 --- a/source/rules/rxjsFinnishRule.ts +++ b/source/rules/rxjsFinnishRule.ts @@ -62,7 +62,7 @@ class Walker extends Lint.ProgramAwareRuleWalker { protected visitObjectLiteralExpression(node: ts.ObjectLiteralExpression): void { node.properties.forEach(property => { - if (property.name.kind !== ts.SyntaxKind.ComputedPropertyName) { + if (property.name && (property.name.kind !== ts.SyntaxKind.ComputedPropertyName)) { this.validateNode(property); } }); diff --git a/source/rules/rxjsNoFinnishRule.ts b/source/rules/rxjsNoFinnishRule.ts index 4f9f2683..de2ffa01 100644 --- a/source/rules/rxjsNoFinnishRule.ts +++ b/source/rules/rxjsNoFinnishRule.ts @@ -64,7 +64,7 @@ class Walker extends Lint.ProgramAwareRuleWalker { protected visitObjectLiteralExpression(node: ts.ObjectLiteralExpression): void { node.properties.forEach(property => { - if (property.name.kind !== ts.SyntaxKind.ComputedPropertyName) { + if (property.name && (property.name.kind !== ts.SyntaxKind.ComputedPropertyName)) { this.validateNode(property); } });