-
Notifications
You must be signed in to change notification settings - Fork 61
[indent] Extend base rule to support typescript nodes #201
Comments
@bradzacher tests for this are done in parser, but sure, more test is always better |
You added the test here! However, it has valid cases only. |
Hmm yeah instantly can see the value in this... I added this invalid test case, and it fails:
|
it means that its working as expected, eslint is not supporting TS nodes, and there is/was bunch of issues that nodes was handled incorrectly. |
we should write new rule that extends eslint rule to support indent in TS specific nodes |
As a plugin developer that knows its purposely designed to not support typescript ast nodes, sure it's working correctly. As a user that wants their interfaces and type literals indented; the rule is broken. |
i can work on this after i solving issue with array-type |
I'm already hacking away at it! |
Is it possible to add a fix (if not already fixed) for eslint/typescript-eslint-parser#577 too? |
Fixes #201 Fixes #96 Fixes eslint/typescript-eslint-parser#577 The [base eslint implementation](https://github.com/eslint/eslint/blob/master/lib/rules/indent.js) purposely ignores nodes it doesn't know about (i.e. our TS nodes). Because of how the base rule is written, we have to override the implementation entirely.
Uh oh!
There was an error while loading. Please reload this page.
#174 adds some tests for indent which covers some default eslint cases.
Unfortunately the rule is designed such that it completely ignores non-standard nodes (i.e. all of the new typescript nodes introduced in parser v20+).
Specifically we need to support:
TSTypeLiteral
TSInterfaceBody
TSImportEqualsDeclaration
The text was updated successfully, but these errors were encountered: