eslint / typescript-eslint-parser

An ESLint custom parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
Other
915 stars 92 forks source link

[indent] import require are not reported as error #577

Closed ficristo closed 5 years ago

ficristo commented 5 years ago

What version of TypeScript are you using? 3.1.6

What version of typescript-eslint-parser are you using? 21.0.2

What code were you trying to parse?

// The code:
    import Dialogs              = require("widgets/Dialogs");

What did you expect to happen? An error because the code is indented but shouldn't.

For now my rule indent is:

"indent": ["error", 4, {
    "SwitchCase": 1,
    "VariableDeclarator": 1,
    "FunctionDeclaration": { "parameters": "first", body: 1 },
    "FunctionExpression": { "parameters": "first", body: 1 },
    "CallExpression": { "arguments": 1 },
    "ArrayExpression": 1,
    "ObjectExpression": 1,
    "ImportDeclaration": 1,
    "flatTernaryExpressions": false
}],

What happened? No error.

armano2 commented 5 years ago

TSImportEqualsDeclaration is not supported by eslint rule, this should be added in https://github.com/bradzacher/eslint-plugin-typescript

ficristo commented 5 years ago

It should be fixed by https://github.com/bradzacher/eslint-plugin-typescript/pull/219