Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
[FIX] [indent] add handling for TSTypeReference (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher authored Jan 4, 2019
1 parent 867df2e commit 52fa7c5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rules/indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const KNOWN_NODES = new Set([
"TSModuleDeclaration",
"TSParameterProperty",
"TSPropertySignature",
"TSTypeAnnotation",
"TSTypeLiteral",
"TSTypeReference",
]);

const defaultOptions = [
Expand Down
21 changes: 21 additions & 0 deletions tests/lib/rules/indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ const firebaseApp = firebase.apps.length
messagingSenderId: __FIREBASE_MESSAGING_SENDER_ID__,
})
`,
// https://github.com/bradzacher/eslint-plugin-typescript/issues/271
{
code: `
const foo = {
a: 1,
b: 2
},
bar = 1;
`,
options: [4, { VariableDeclarator: { const: 3 } }],
},
{
code: `
const foo : Foo = {
a: 1,
b: 2
},
bar = 1;
`,
options: [4, { VariableDeclarator: { const: 3 } }],
},
],
invalid: [
{
Expand Down

0 comments on commit 52fa7c5

Please sign in to comment.