Closed
Description
Repro
{
"rules": {
"@typescript-eslint/indent": ["error", 2, { "VariableDeclarator": { "const": 3 } }]
}
}
const div: JQuery<HTMLElement> = $('<div>')
.addClass('some-class')
.appendTo($('body')),
button: JQuery<HTMLElement> = $('<button>')
.text('Cancel')
.appendTo(div);
Expected Result
No errors
Actual Result
2:1 error Expected indentation of 2 spaces but found 8 @typescript-eslint/indent
3:1 error Expected indentation of 2 spaces but found 8 @typescript-eslint/indent
Additional Info
- Only the indentation on lines 2-3 seems to trigger the error. Similar indentation used on lines 6-7 does not trigger the error.
- The error only seems to trigger when generic type annotations (e.g.
JQuery<HTMLElement>
) are used.
An example without generics does not error:
const name: string = ' Typescript '
.toUpperCase()
.trim(),
greeting: string = ` Hello ${name} `
.toUpperCase()
.trim();
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
1.0.0 |
@typescript-eslint/parser |
1.0.0 |
TypeScript |
3.2.1 |
ESLint |
5.11.1 |
node |
11.5.0 |
npm |
6.5.0 |