microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 35 forks source link

Align check issue for continous line of method function declare #113

Closed doneykoo closed 4 years ago

doneykoo commented 4 years ago

(before all, sorry I'm not sure if this issue is from this plugin, or maybe the foundemental lint library. Forgive me and change this issue properly if I'm wrong)

For now the lint align checking has trouble for me in such situation:

In such situation, I want this kind of indent can be accepted:

align at the position of 4 chars after the first character in previous line (as shown in snapshot noted "(2)").

This style is also consistent with how the VSCode auto format works when you insert line-break by hit enter key in the middle of that function delcare.

However the current lint system checks as it has to be:

at the position of 1 char after ( parenthesis in previous line (as shown in snapshot noted "(3)")

And, if I want to ignore such situation, there is only one align option in tslint.json. If I set it to false, it will also ignore the align issues of the normal line of code (as shown in snapshot noted "(1)"), which is not what I wanted.

snapshot: 图片

mjbvz commented 4 years ago

What happens when you run tslint from the command line?

doneykoo commented 4 years ago

What happens when you run tslint from the command line?

got the resutl: EventDelegate.ts[29, 9]: parameters are not aligned

mjbvz commented 4 years ago

Is that what you expect?

doneykoo commented 4 years ago

nope.

It would be better to have a separate align option only for that continuous line of function parameters.

mjbvz commented 4 years ago

Ok, this sounds like a tslint issue or feature request then. Please file this against the main tslint repo

doneykoo commented 4 years ago

got it. thanks