hmil / tslint-override

TSLint plugin bringing support for the override keyword
MIT License
27 stars 6 forks source link

"new-line-after-decorators-and-tags" not working #27

Closed koreem closed 5 years ago

koreem commented 5 years ago

"new-line-after-decorators-and-tags" not working.

I use the override decorator:

 "explicit-override": [
      true,
      "exclude-interfaces",
      "decorator",
      "new-line-after-decorators-and-tags"
    ],

All files pass linting despite the following:

@override myFunction(): void {
mzyil commented 5 years ago

there is a test case about this, https://github.com/hmil/tslint-override/blob/master/test/fixers/spec.fixed.newLineDecorator.ts and it seems ok

Do you expect the fixer to put a new line after the ALREADY existing decorator, or add the decorator and the new line at the same time?

hmil commented 5 years ago

@mzyil is right, the rule specifies the behavior of the fixer, not that of the linter. So although the fixer would add a new line after each override tag it creates, the linter accepts that the decorator be placed inline.

Whether inline decorators are allowed at all is a matter for another tslint rule.