Skip to content

Commit bd48f17

Browse files
committed
Fix issue when there are no attached decorators
1 parent 4cd830b commit bd48f17

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Below you can find a recommended configuration which is based on the [Angular 2
3131
- [x] Use `@Input` instead of `inputs` decorator property.
3232
- [x] Use `@Output` instead of `outputs` decorator property.
3333
- [x] Use `@HostListeners` and `@HostBindings` instead of `host` decorator property.
34-
- [ ] Do not inject `ElementRef`.
34+
- [ ] Do not use `nativeElement` injected with `ElementRef`.
3535
- [ ] Do not rename inputs.
3636
- [ ] Do not rename outputs.
3737
- [ ] Externalize template above *n* lines of code.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng2lint",
3-
"version": "0.0.4",
3+
"version": "0.0.6",
44
"description": "A set of linters for Angular 2 applications, following https://github.com/mgechev/angular2-style-guide.",
55
"main": "index.js",
66
"scripts": {

src/parameterDecoratorBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class DirectiveMetadataWalker extends Lint.RuleWalker {
4949
}
5050

5151
visitClassDeclaration(node: ts.ClassDeclaration) {
52-
node.decorators.forEach(this.validateDecorator.bind(this, node.name.text));
52+
(node.decorators || []).forEach(this.validateDecorator.bind(this, node.name.text));
5353
super.visitClassDeclaration(node);
5454
}
5555

0 commit comments

Comments
 (0)