From 5b7fe8b80321738fd8878d2e2e5880d38f0b089c Mon Sep 17 00:00:00 2001 From: Konstantinos Paparas Date: Tue, 16 Jan 2024 14:23:06 +0100 Subject: [PATCH] chore: integrate prettier config and fix spacing --- docs/rules/no-deprecated-classes.md | 14 +++++++------- scripts/update-docs-index.ts | 11 ++++++----- scripts/update-rule-docs.ts | 7 ++++--- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/rules/no-deprecated-classes.md b/docs/rules/no-deprecated-classes.md index 0f6d44e..34e895c 100644 --- a/docs/rules/no-deprecated-classes.md +++ b/docs/rules/no-deprecated-classes.md @@ -24,32 +24,32 @@ This rule reports usages of deprecated css classes in the code. ``` diff --git a/scripts/update-docs-index.ts b/scripts/update-docs-index.ts index dfc530c..cf23807 100644 --- a/scripts/update-docs-index.ts +++ b/scripts/update-docs-index.ts @@ -1,14 +1,15 @@ /** * Forked from https://github.com/intlify/eslint-plugin-vue-i18n/blob/master/scripts/update-docs-index.ts */ -import { readFileSync, writeFileSync } from 'node:fs'; -import { join, resolve } from 'node:path'; +import { writeFileSync } from 'node:fs'; +import { resolve } from 'node:path'; import { type Options, format } from 'prettier'; import { type RuleInfo, withCategories } from './lib/rules'; -const prettierrc = JSON.parse( - readFileSync(join(__dirname, '../.prettierrc.json'), 'utf8'), -) as Options; +const prettierrc: Options = { + semi: true, + singleQuote: true, +}; function toTableRow(rule: RuleInfo) { const mark = `${rule.recommended ? ':star:' : ''}${ diff --git a/scripts/update-rule-docs.ts b/scripts/update-rule-docs.ts index cc5b147..4cc31dd 100644 --- a/scripts/update-rule-docs.ts +++ b/scripts/update-rule-docs.ts @@ -8,9 +8,10 @@ import rules, { type RuleInfo } from './lib/rules'; const PLACE_HOLDER = /#[^\n]*\n+> .+\n+(?:- .+\n)*\n*/u; -const prettierrc = JSON.parse( - readFileSync(join(__dirname, '../.prettierrc.json'), 'utf8'), -) as Options; +const prettierrc: Options = { + semi: true, + singleQuote: true, +}; async function pickSince(content: string): Promise { const fileIntro = /^---\n(?[\s\S]+?)---\n*/u.exec(content);