feat(eslint-plugin): Begin rewrite of indent rule #439
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to commit this into the repo, as the PR was already HUGE as it was.
My existing strategy of spoofing estree nodes and relying on eslint's underlying indentation logic for those nodes just wasn't working well, and really isn't maintainable - it's really dodgy in its typings (lots of
any
s), and it was lazy in its spoofing for simplicity.Also there are things that eslint doesn't indent in the way that our users expect (i.e. #121 - this is essentially just a binary expression, but eslint doesn't lint the indent of binary expressions, trust me - I tried to make it work).
So I'm kicking things up a notch. Almost everything in this PR is copied directly from the eslint repo, except it has been adapted to be fully typed, and work within our tooling.
I deleted a few tests because they were asserting eslint's handling (or purposeful not handling) of unknown nodes (i.e. TS-ESTree custom nodes).
I've added the code as a new rule, and for now it's called
indent-new-do-not-use
. I have not added this rule to the export, so it's not directly available to consumers.The plan will be as follows:
indent
.