question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

I’m running into a conflict between @typescript-eslint/indent and the align rule in @typescript-eslint/tslint/config, specifically with regard to the alignment of parameters on my class constructors.

🐛 Bug Report

  • tslint-to-eslint-config version: 0.2.5
  • ESLint version: 6.3.0
  • Node version: 10.15.3

Actual Behavior

Expected indentation of x spaces but found x @typescript-eslint/indent or parameters are not aligned (tslint:align) @typescript-eslint/tslint/config

Expected Behavior

I don’t really mind which convention is accepted as long as its consistent.

Reproduction

constructor(private router: Router,
            private authenticationService: AuthenticationService,
            private tokenService: TokenService) {}
constructor(private router: Router,
  private authenticationService: AuthenticationService,
  private tokenService: TokenService) { }
{
    "rules": {
        "@typescript-eslint/indent": [
            "error",
            2
        ],
        "@typescript-eslint/tslint/config": [
            "error",
            {
                "rulesDirectory": [
                    "**MyPath**"
                ],
                "rules": {
                    "align": [
                        true,
                        "parameters",
                        "statements"
                    ]
                }
            }
        ]
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremyyapcommented, Oct 21, 2019

May I work on this? typescript-eslint’s indent rule supports an indentation level of "first" which should be similar to what TSLint’s align rule enforces:

the string “first” indicating that all parameters of the declaration must be aligned with the first parameter

1reaction
JoshuaKGoldbergcommented, Oct 10, 2019

@KingDarBoja the issue here is that TSLint’s align rule isn’t yet converted - not the indent one, sadly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier and eslint indents not working together - Stack Overflow
ESLint's indent rule and Prettier's indentation styles do not match - they're completely separate implementations and are two different ...
Read more >
Indentation rule conflict with prettier · Issue #372 - GitHub
I'm not sure you understand why this was closed. This is 100% intentional. The two should conflict because prettier does its own indentation...
Read more >
indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Importing 'indent' rule from ESLint configuration should ...
The first example (Align when Multiline On) conflicts with ESLint's 'indent' rule, so when importing code style settings from a config that contains...
Read more >
Using Prettier and ESLint to automate formatting and fixing ...
Managing ESLint's rules to avoid conflict with Prettier. There are two broad categories of linting rules: formatting rules and code-quality ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found