diff --git a/packages/eslint-plugin/tests/rules/key-spacing.test.ts b/packages/eslint-plugin/tests/rules/key-spacing.test.ts index d3c96d293f9c..c2587e4c0735 100644 --- a/packages/eslint-plugin/tests/rules/key-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/key-spacing.test.ts @@ -332,8 +332,9 @@ interface X { `, options: [ { + align: { on: 'value', beforeColon: true, afterColon: true }, singleLine: { beforeColon: false, afterColon: false }, - multiLine: { beforeColon: true, afterColon: true, align: 'value' }, + multiLine: { beforeColon: false, afterColon: false }, }, ], }, @@ -519,6 +520,22 @@ let x: { }, { code: ` +let x: { + a: number; + abc: string +}; + `, + output: ` +let x: { + a: number; + abc: string +}; + `, + options: [{ align: { on: 'value' } }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` let x: { a: number; "🌷": "bar", // 2 code points @@ -878,6 +895,22 @@ interface X { }; `, output: ` +interface X { + a : number; + abc: string +}; + `, + options: [{ align: { on: 'colon' } }], + errors: [{ messageId: 'extraKey' }], + }, + { + code: ` +interface X { + a : number; + abc: string +}; + `, + output: ` interface X { a : number; abc : string