Skip to content

Add align rule converter + indent merger #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2019

Conversation

jeremyyap
Copy link
Contributor

PR Checklist

Overview

The TSLint align converter maps rule arguments to the equivalent options for @typescript-eslint-indent rule supporting the "first" option, which aligns all parameters / arguments / elements / properties with the first one in each declaration.

Next, a merger is required for the @typescript-eslint/indent since two TSLint rules are mapped to it: align and indent.

There is a small issue where the object option cannot be supplied without the indent size option. This is a problem since TSLint's align rule does not concern itself with the indent size. I decided to specify the default indent size of 4 when converting the indent rule. Correspondingly, the indent merger ignores indent size values of 4 when merging rules.

Docs:
TSLint align
@typescript-eslint/indent

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, really interesting how these defaults work out.

Just ruminating: this PR's change is definitely better than how it is right now, and although there might be some edge case trickiness with the default option of 4, it seems... better to put it out there than to try to shoehorn something else in. I can't think of any other way of dealing with this...

Anyway, thanks @jeremyyap! This looks great 💖

@JoshuaKGoldberg JoshuaKGoldberg merged commit aac5ef9 into typescript-eslint:master Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict between tslint:align and @typescript-eslint/indent
2 participants