This repository has been archived by the owner on Jan 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
[indent] regression with typescript-eslint-parser@20.1.0 #271
Labels
Comments
bradzacher
changed the title
Indent rule regression starting with typescript-eslint-parser@20.1.0
[indent] regression with typescript-eslint-parser@20.1.0
Jan 2, 2019
bradzacher
added
bug/incomplete rule
requires investigation
bug that require more investigation
parser bug
bugs with typescript-eslint-parser / typescript-estree
labels
Jan 2, 2019
It is known that v20+ of the parser breaks when using plugin version 0.14. They released a number of breaking changes which we had to handle ourselves. IIRC the only supported version for plugin v0.14 was parser@^17. For the plugin 1.0.0 rc - we have moved the parser dependency into our plugin, so that we can control which version users are using. Could you please try to switch your parser to use our exposed version, and let me know if it's still an issue? Excerpt from: https://github.com/bradzacher/eslint-plugin-typescript/releases/tag/1.0.0-rc.0
{
- "parser": "typescript-eslint-parser",
+ "parser": "eslint-plugin-typescript/parser",
"plugins": ["typescript"]
}
|
bradzacher
added
awaiting response
Issues waiting for a reply from the OP
and removed
requires investigation
bug that require more investigation
labels
Jan 2, 2019
Thanks @bradzacher. Unfortunately, the problem is the same when using
"dependencies": {
"eslint": "5.11.1",
"eslint-plugin-typescript": "1.0.0-rc.1",
"typescript": "3.1.1"
}
{
"parser": "eslint-plugin-typescript/parser",
"plugins": ["typescript"],
"rules": {
"indent": "off",
"typescript/indent": ["error", "tab", {"VariableDeclarator": {"const": 3}}]
}
}
interface Foo {
a: number;
b: number;
}
const foo: Foo = {
a: 1,
b: 2
},
bar = 1;
7:1 error Expected indentation of 1 tab but found 4 typescript/indent
8:1 error Expected indentation of 1 tab but found 4 typescript/indent
9:1 error Expected indentation of 0 tabs but found 3 typescript/indent |
no-response
bot
removed
the
awaiting response
Issues waiting for a reply from the OP
label
Jan 2, 2019
bradzacher
added
requires investigation
bug that require more investigation
and removed
parser bug
bugs with typescript-eslint-parser / typescript-estree
requires investigation
bug that require more investigation
labels
Jan 3, 2019
1 task
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This issue was originally posted over at eslint/typescript-eslint-parser#586; but it was suggested that it be raised here as well. Please refer to the original issue for additional commentary/discussion.
Repro
(in the code below, ^ represents a tab character)
Expected Result
No errors
Actual Result
In
typescript-eslint-parser@20.0.0
, code passes with no errors.With
typescript-eslint-parser@20.1.0
onwards, the errors below occur:Additional Info
The code can be modified like below to pass, but clearly this is not what the config intends:
Vanilla JS code without a type annotation passes as expected:
It also worth noting that the same issue occurs when using:
indent
rule fromeslint
instead of thetypescript/indent
rule fromeslint-plugin-typescript
Versions
eslint
5.11.1
typescript
3.1.1
eslint-plugin-typescript
0.14.0+
typescript-eslint-parser
20.1.0+
The text was updated successfully, but these errors were encountered: