From 54aed3bee518b1d495505f9fca819904fce0904f Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Tue, 24 Jan 2023 17:08:54 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Add=20coverage,=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/rules/key-spacing.test.ts | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/tests/rules/key-spacing.test.ts b/packages/eslint-plugin/tests/rules/key-spacing.test.ts index d3c96d293f9c..820f95f6c1e1 100644 --- a/packages/eslint-plugin/tests/rules/key-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/key-spacing.test.ts @@ -332,8 +332,23 @@ 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 }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: false, afterColon: false, align: 'value' }, }, ], }, @@ -519,6 +534,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 +909,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