Skip to content

Commit

Permalink
fix(eslint-plugin): [indent] fix decorator type (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaodahong authored and bradzacher committed Nov 15, 2019
1 parent 4fac6c5 commit e2008e3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/indent.ts
Expand Up @@ -81,6 +81,7 @@ const KNOWN_NODES = new Set([
AST_NODE_TYPES.TSTypeParameterInstantiation,
AST_NODE_TYPES.TSTypeReference,
AST_NODE_TYPES.TSUnionType,
AST_NODE_TYPES.Decorator,
]);

export default util.createRule<Options, MessageIds>({
Expand Down
21 changes: 21 additions & 0 deletions packages/eslint-plugin/tests/rules/indent/indent.test.ts
Expand Up @@ -1717,5 +1717,26 @@ declare module "Validation" {
},
],
},
{
code: `
@Decorator()
class Foo {}
`,
output: `
@Decorator()
class Foo {}
`,
errors: [
{
messageId: 'wrongIndentation',
data: {
expected: '0 spaces',
actual: 4,
},
line: 2,
column: 1,
},
],
},
],
});

0 comments on commit e2008e3

Please sign in to comment.