+ aaa
+ bbb
+ ccc
+
+ `,
+
+ // ArrayExpression
+ unIndent`
+
+
+
+ `,
+
+ // ArrowFunctionExpression
+ unIndent`
+
+
+
+ `,
+
+ // AssignmentExpression / BinaryExpression
+ unIndent`
+
+
+
+ `,
+
+ // AwaitExpression
+ unIndent`
+
+
+
+ `,
+
+ // BreakStatement, LabeledStatement
+ unIndent`
+
+
+
+ `,
+
+ // CallExpression
+ unIndent`
+
+
+
+ `,
+
+ // ClassExpression / ClassDeclaration
+ unIndent`
+
+
+
+ `,
+
+ // ConditionalExpression
+ unIndent`
+
+
+
+ `,
+
+ // DoWhileStatement
+ unIndent`
+
+
+
+ `,
+
+ // ForInStatement, ForOfStatement
+ unIndent`
+
+
+
+ `,
+
+ // ForStatement
+ unIndent`
+
+
+
+ `,
+
+ // FunctionDeclaration, FunctionExpression
+ unIndent`
+
+
+
+ `,
+
+ // IfStatement
+ unIndent`
+
+
+
+ `,
+
+ // MemberExpression, MetaProperty
+ unIndent`
+
+
+
+ `,
+
+ // MethodDefinition, Property
+ unIndent`
+
+
+
+ `,
+
+ // NewExpression
+ unIndent`
+
+
+
+ `,
+
+ // ObjectExpression
+ unIndent`
+
+
+
+ `,
+
+ // RestElement / SpreadElement
+ unIndent`
+
+
+
+ `,
+
+ // SequenceExpression
+ unIndent`
+
+
+
+ `,
+ unIndent`
+
+ {{
+ a,
+ b,
+ c
+ }}
+
+ `,
+
+ // SwitchStatement, SwitchCase
+ unIndent`
+
+
+
+ `,
+
+ // TaggedTemplateExpression
+ unIndent`
+
+
+
+ `,
+
+ // TemplateLiteral
+ unIndent`
+
+
+
+ `,
+
+ // ReturnStatement
+ unIndent`
+
+
+
+ `,
+
+ // TryStatement / CatchClause
+ unIndent`
+
+
+
+ `,
+
+ // UnaryExpression
+ unIndent`
+
+
+
+ `,
+
+ // UpdateExpression
+ unIndent`
+
+
+
+ `,
+
+ // VariableDeclaration, VariableDeclarator
+ unIndent`
+
+
+
+ `,
+
+ // YieldExpression
+ unIndent`
+
+
+
+ `,
+
+ // 2 spaces
+ {
+ code: unIndent`
+
+
+
+ `,
+ options: [2]
+ },
+
+ // Tabs
+ {
+ code: unIndent`
+
+ \t {
+ \t\t\t\t\tfoo(a)
+ \t\t\t\t}
+ \t\t"
+ \t>
+
+ `,
+ options: ['tab']
+ },
+
+ // options.attribute
+ {
+ code: unIndent`
+
+
+
+ `,
+ options: [4, { attribute: 0 }]
+ },
+ {
+ code: unIndent`
+
+
+
+ `,
+ options: [4, { attribute: 2 }]
+ },
+
+ // options.closeBracket
+ {
+ code: unIndent`
+
+
+
+ `,
+ options: [4, { closeBracket: 1 }]
+ },
+ {
+ code: unIndent`
+
+
+
+ `,
+ options: [4, { closeBracket: 2 }]
+ },
+
+ // options.switchCase
+ {
+ code: unIndent`
+
+
+
+ `,
+ options: [4, { switchCase: 1 }]
+ },
+
+ // Comments
+ unIndent`
+
+
+ {{
+ // comment
+ // comment
+ message
+ }}
+
+ `,
+ unIndent`
+
+ {{
+ /*
+ * comment
+ */
+ message
+ }}
+
+ `,
+
+ // Ignores
+ {
+ code: unIndent`
+
+
+ Hello
+
+
+ `,
+ options: [4, {
+ // Ignore all :D
+ ignores: ['*']
+ }]
+ }
+ ],
+
+ invalid: [
+ // VAttribute
+ {
+ code: unIndent`
+
+
+ Text
+
+
+ `,
+ output: unIndent`
+
+
+ Text
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 3 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 4 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 9 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 }
+ ]
+ },
+
+ // VEndTag
+ {
+ code: unIndent`
+
+
+
+
+ {{
+ value
+ }}
+
+
+ `,
+ output: unIndent`
+
+
+ {{
+ value
+ }}
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 13 }
+ ]
+ },
+
+ // VForExpression
+ {
+ code: unIndent`
+
+
+
+
+ `,
+ output: unIndent`
+
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 19 }
+ ]
+ },
+
+ // VOnExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 }
+ ]
+ },
+
+ // VText
+ {
+ code: unIndent`
+
+ aaa
+ bbb
+ ccc
+
+ `,
+ output: unIndent`
+
+ aaa
+ bbb
+ ccc
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 4 spaces but found 2 spaces.', line: 2 },
+ { message: 'Expected indentation of 4 spaces but found 2 spaces.', line: 3 }
+ ]
+ },
+ // Mix of texts and mustaches
+ {
+ code: unIndent`
+
+ aaa
+ {{bbb}}
+ ccc {{
+ ddd
+ }}
+
+ `,
+ output: unIndent`
+
+ aaa
+ {{bbb}}
+ ccc {{
+ ddd
+ }}
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 4 spaces but found 2 spaces.', line: 2 },
+ { message: 'Expected indentation of 4 spaces but found 2 spaces.', line: 3 },
+ { message: 'Expected indentation of 4 spaces but found 2 spaces.', line: 4 },
+ { message: 'Expected indentation of 8 spaces but found 2 spaces.', line: 5 },
+ { message: 'Expected indentation of 4 spaces but found 2 spaces.', line: 6 }
+ ]
+ },
+
+ // ArrayExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 3 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 6 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 11 },
+ { message: 'Expected indentation of 14 spaces but found 6 spaces.', line: 12 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 13 }
+ ]
+ },
+
+ // ArrowFunctionExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 30 }
+ ]
+ },
+
+ // AssignmentExpression / BinaryExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 22 }
+ ]
+ },
+
+ // AwaitExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 14 spaces.', line: 6 }
+ ]
+ },
+
+ // BreakExpression / LabeledStatement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 }
+ ]
+ },
+
+ // CallExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 14 spaces but found 10 spaces.', line: 25 }
+ ]
+ },
+
+ // ClassExpression / ClassDeclaration
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 32 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 33 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 34 }
+ ]
+ },
+
+ // ConditionalExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 30 }
+ ]
+ },
+
+ // DoWhileStatement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 26 }
+ ]
+ },
+
+ // ForInStatement, ForOfStatement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 24 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 24 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 31 }
+ ]
+ },
+
+ // ForStatement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 32 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 33 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 34 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 35 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 36 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 37 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 38 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 41 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 42 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 43 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 44 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 45 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 46 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 47 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 48 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 49 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 50 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 53 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 54 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 55 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 56 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 57 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 58 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 59 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 60 }
+ ]
+ },
+
+ // FunctionDeclaration, FunctionExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 32 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 33 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 34 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 35 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 36 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 37 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 40 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 41 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 42 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 43 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 44 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 45 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 46 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 47 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 48 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 49 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 52 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 53 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 54 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 55 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 56 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 57 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 58 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 59 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 60 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 61 }
+ ]
+ },
+
+ // IfStatement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 31 }
+ ]
+ },
+
+ // MemberExpression, MetaProperty
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 31 }
+ ]
+ },
+
+ // MethodDefinition, Property
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 32 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 33 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 34 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 35 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 36 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 37 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 38 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 41 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 42 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 43 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 44 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 45 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 46 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 47 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 48 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 49 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 50 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 51 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 52 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 53 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 54 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 55 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 56 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 57 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 58 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 59 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 60 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 61 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 62 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 63 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 64 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 65 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 66 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 67 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 68 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 69 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 70 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 71 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 72 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 73 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 74 }
+ ]
+ },
+
+ // NewExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 24 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 24 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 33 }
+ ]
+ },
+
+ // ObjectExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 3 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 6 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 6 spaces.', line: 11 },
+ { message: 'Expected indentation of 17 spaces but found 6 spaces.', line: 12 },
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 13 }
+ ]
+ },
+
+ // SequenceExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 18 }
+ ]
+ },
+ {
+ code: unIndent`
+
+ {{
+ a,
+ b,
+ c
+ }}
+
+ `,
+ output: unIndent`
+
+ {{
+ a,
+ b,
+ c
+ }}
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 3 },
+ { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 4 },
+ { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 5 }
+ ]
+ },
+
+ // SwitchStatement, SwitchCase
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 32 }
+ ]
+ },
+
+ // TaggedTemplateExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 }
+ ]
+ },
+
+ // TemplateLiteral
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 13 }
+ ]
+ },
+
+ // RestElement / SpreadElement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 6 },
+ { message: 'Expected indentation of 20 spaces but found 14 spaces.', line: 7 },
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 10 },
+ { message: 'Expected indentation of 20 spaces but found 14 spaces.', line: 11 }
+ ]
+ },
+
+ // ReturnStatement
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 9 }
+ ]
+ },
+
+ // TryStatement / CatchClause
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 9 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 10 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 23 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 24 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 32 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 33 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 34 }
+ ]
+ },
+
+ // UnaryExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 }
+ ]
+ },
+
+ // UpdateExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 5 }
+ ]
+ },
+
+ // VariableDeclaration, VariableDeclarator
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 6 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 7 },
+ { message: 'Expected indentation of 18 spaces but found 10 spaces.', line: 8 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 11 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 12 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 13 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 14 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 15 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 16 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 17 },
+ { message: 'Expected indentation of 22 spaces but found 10 spaces.', line: 18 },
+ { message: 'Expected indentation of 22 spaces but found 10 spaces.', line: 19 },
+ { message: 'Expected indentation of 18 spaces but found 10 spaces.', line: 20 },
+ { message: 'Expected indentation of 22 spaces but found 10 spaces.', line: 21 },
+ { message: 'Expected indentation of 22 spaces but found 10 spaces.', line: 22 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 25 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 26 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 27 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 28 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 29 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 30 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 31 },
+ { message: 'Expected indentation of 20 spaces but found 10 spaces.', line: 32 },
+ { message: 'Expected indentation of 16 spaces but found 10 spaces.', line: 33 },
+ { message: 'Expected indentation of 12 spaces but found 10 spaces.', line: 34 },
+ { message: 'Expected indentation of 22 spaces but found 10 spaces.', line: 35 },
+ { message: 'Expected indentation of 18 spaces but found 10 spaces.', line: 36 },
+ { message: 'Expected indentation of 18 spaces but found 10 spaces.', line: 37 },
+ { message: 'Expected indentation of 22 spaces but found 10 spaces.', line: 38 },
+ { message: 'Expected indentation of 18 spaces but found 10 spaces.', line: 39 }
+ ]
+ },
+
+ // YieldExpression
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 5 },
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 10 },
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 11 },
+ { message: 'Expected indentation of 16 spaces but found 14 spaces.', line: 16 },
+ { message: 'Expected indentation of 20 spaces but found 14 spaces.', line: 17 }
+ ]
+ },
+
+ // Tabs
+ {
+ code: unIndent`
+
+ \t {
+ \t\tfoo(a)
+ \t\t}
+ \t\t"
+ \t>
+
+ `,
+ output: unIndent`
+
+ \t {
+ \t\t\t\t\tfoo(a)
+ \t\t\t\t}
+ \t\t"
+ \t>
+
+ `,
+ options: ['tab'],
+ errors: [
+ { message: 'Expected indentation of 3 tabs but found 2 tabs.', line: 4 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 5 },
+ { message: 'Expected indentation of 3 tabs but found 2 tabs.', line: 6 },
+ { message: 'Expected indentation of 3 tabs but found 2 tabs.', line: 7 },
+ { message: 'Expected indentation of 5 tabs but found 2 tabs.', line: 8 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 9 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 10 },
+ { message: 'Expected indentation of 5 tabs but found 2 tabs.', line: 11 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 12 },
+ { message: 'Expected indentation of 3 tabs but found 2 tabs.', line: 13 },
+ { message: 'Expected indentation of 5 tabs but found 2 tabs.', line: 14 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 15 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 16 },
+ { message: 'Expected indentation of 5 tabs but found 2 tabs.', line: 17 },
+ { message: 'Expected indentation of 4 tabs but found 2 tabs.', line: 18 }
+ ]
+ },
+
+ // A mix of spaces and tabs.
+ {
+ code: unIndent`
+
+
+ \tHello
+
+
+ `,
+ output: unIndent`
+
+
+ Hello
+
+
+ `,
+ errors: [
+ { message: 'Expected " " character, but found "\\t" character.', line: 3 }
+ ]
+ },
+ {
+ code: unIndent`
+
+ \t
+ \t Hello
+ \t
+
+ `,
+ output: unIndent`
+
+ \t
+ \t\tHello
+ \t
+
+ `,
+ options: ['tab'],
+ errors: [
+ { message: 'Expected "\\t" character, but found " " character.', line: 3 }
+ ]
+ },
+
+ // Comments
+ {
+ code: unIndent`
+
+
+ {{
+ // comment
+ // comment
+ message
+ }}
+
+ `,
+ output: unIndent`
+
+
+ {{
+ // comment
+ // comment
+ message
+ }}
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 4 spaces but found 0 spaces.', line: 2 },
+ { message: 'Expected indentation of 4 spaces but found 0 spaces.', line: 3 },
+ { message: 'Expected indentation of 8 spaces but found 0 spaces.', line: 4 },
+ { message: 'Expected indentation of 8 spaces but found 0 spaces.', line: 5 },
+ { message: 'Expected indentation of 8 spaces but found 0 spaces.', line: 6 },
+ { message: 'Expected indentation of 4 spaces but found 0 spaces.', line: 7 }
+ ]
+ },
+ {
+ code: unIndent`
+
+ {{
+ /*
+ * comment
+ */
+ message
+ }}
+
+ `,
+ output: unIndent`
+
+ {{
+ /*
+ * comment
+ */
+ message
+ }}
+
+ `,
+ errors: [
+ { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 3 },
+ { message: 'Expected indentation of 8 spaces but found 4 spaces.', line: 6 }
+ ]
+ },
+
+ // Ignores
+ {
+ code: unIndent`
+
+
+
+ `,
+ output: unIndent`
+
+
+
+ `,
+ options: [4, {
+ ignores: ['VAttribute']
+ }],
+ errors: [
+ { message: 'Expected indentation of 4 spaces but found 8 spaces.', line: 5 }
+ ]
+ },
+ {
+ code: unIndent`
+
+ {{
+ obj
+ .foo[
+ "bar"
+ ].baz
+ }}
+
+ `,
+ output: unIndent`
+
+ {{
+ obj
+ .foo[
+ "bar"
+ ].baz
+ }}
+
+ `,
+ options: [4, {
+ // Ignore inside of computed properties.
+ ignores: ['MemberExpression[computed=true] *.property']
+ }],
+ errors: [
+ { message: 'Expected indentation of 8 spaces but found 6 spaces.', line: 3 },
+ { message: 'Expected indentation of 12 spaces but found 8 spaces.', line: 4 },
+ { message: 'Expected indentation of 12 spaces but found 8 spaces.', line: 6 }
+ ]
+ }
+ ]
+})