From 02b202bb7d7ff41e7fb26c9781908687181b2eec Mon Sep 17 00:00:00 2001 From: yinm Date: Thu, 28 Dec 2023 18:28:33 +0900 Subject: [PATCH 1/3] Insert newline at end of file --- tools/generate-rule.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/generate-rule.ts b/tools/generate-rule.ts index 305e0ea..64999be 100644 --- a/tools/generate-rule.ts +++ b/tools/generate-rule.ts @@ -138,7 +138,9 @@ const generateRule = async () => { }, } }, - })\n`) + }) + +`) ) logger.log(`creating tests/lib/rules/${ruleId}.test.ts`) @@ -178,7 +180,8 @@ const generateRule = async () => { }, ], }) - `) + +`) ) logger.log(`creating docs/rules/${ruleId}.md`) @@ -221,7 +224,8 @@ const generateRule = async () => { ## Further Reading If there are other links that describe the issue this rule addresses, please include them here in a bulleted list. Otherwise, delete this section. - `) + +`) ) const { shouldOpenInVSCode } = await prompts({ From ea03039395b9a9545c93e31a2f37a81b5138b099 Mon Sep 17 00:00:00 2001 From: yinm Date: Thu, 28 Dec 2023 18:30:21 +0900 Subject: [PATCH 2/3] Remove lines to match Prettier --- tools/generate-rule.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/generate-rule.ts b/tools/generate-rule.ts index 64999be..1e0e700 100644 --- a/tools/generate-rule.ts +++ b/tools/generate-rule.ts @@ -200,17 +200,13 @@ const generateRule = async () => { Examples of **incorrect** code for this rule: \`\`\`js - // fill me in - \`\`\` Examples of **correct** code for this rule: \`\`\`js - // fill me in - \`\`\` ### Options From a2fc883743e7d5548d8a3171b24d210afeb22ebb Mon Sep 17 00:00:00 2001 From: yinm Date: Thu, 28 Dec 2023 18:33:10 +0900 Subject: [PATCH 3/3] Use `ruleDescription` by user input --- tools/generate-rule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate-rule.ts b/tools/generate-rule.ts index 1e0e700..9845839 100644 --- a/tools/generate-rule.ts +++ b/tools/generate-rule.ts @@ -81,7 +81,7 @@ const generateRule = async () => { meta: { type: 'problem', // \`problem\`, \`suggestion\`, or \`layout\` docs: { - description: 'Fill me in', + description: '${ruleDescription}', // Add the categories that suit this rule. categories: [CategoryId.RECOMMENDED], recommended: 'warn', // \`warn\` or \`error\`