Skip to content

Commit e2008e3

Browse files
shaodahongbradzacher
authored andcommitted
fix(eslint-plugin): [indent] fix decorator type (#1189)
1 parent 4fac6c5 commit e2008e3

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

packages/eslint-plugin/src/rules/indent.ts

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const KNOWN_NODES = new Set([
8181
AST_NODE_TYPES.TSTypeParameterInstantiation,
8282
AST_NODE_TYPES.TSTypeReference,
8383
AST_NODE_TYPES.TSUnionType,
84+
AST_NODE_TYPES.Decorator,
8485
]);
8586

8687
export default util.createRule<Options, MessageIds>({

packages/eslint-plugin/tests/rules/indent/indent.test.ts

+21
Original file line numberDiff line numberDiff line change
@@ -1717,5 +1717,26 @@ declare module "Validation" {
17171717
},
17181718
],
17191719
},
1720+
{
1721+
code: `
1722+
@Decorator()
1723+
class Foo {}
1724+
`,
1725+
output: `
1726+
@Decorator()
1727+
class Foo {}
1728+
`,
1729+
errors: [
1730+
{
1731+
messageId: 'wrongIndentation',
1732+
data: {
1733+
expected: '0 spaces',
1734+
actual: 4,
1735+
},
1736+
line: 2,
1737+
column: 1,
1738+
},
1739+
],
1740+
},
17201741
],
17211742
});

0 commit comments

Comments
 (0)