From 8a3bd14585dc52bb9613fc06f9153550e139a959 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sat, 9 Dec 2023 00:12:24 +0800 Subject: [PATCH] chore: reformat --- src/configs/formatters.ts | 29 +++++++++++++---------------- src/configs/markdown.ts | 12 +++++------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/configs/formatters.ts b/src/configs/formatters.ts index 4877e381ebf..53afaf1715d 100644 --- a/src/configs/formatters.ts +++ b/src/configs/formatters.ts @@ -1,26 +1,17 @@ import * as parserPlain from 'eslint-parser-plain' -import { - GLOB_CSS, - GLOB_LESS, - GLOB_MARKDOWN, - GLOB_MDX, - GLOB_POSTCSS, - GLOB_SCSS, -} from '../globs' +import { GLOB_CSS, GLOB_LESS, GLOB_MARKDOWN, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS } from '../globs' import type { VendoredPrettierOptions } from '../vender/prettier-types' import { ensurePackages, interopDefault } from '../utils' -import type { - FlatConfigItem, - OptionsFormatters, - StylisticConfig, -} from '../types' +import type { FlatConfigItem, OptionsFormatters, StylisticConfig } from '../types' import { StylisticConfigDefaults } from './stylistic' export async function formatters( options: OptionsFormatters | true = {}, stylistic: StylisticConfig = {}, ): Promise { - await ensurePackages(['eslint-plugin-format']) + await ensurePackages([ + 'eslint-plugin-format', + ]) if (options === true) { options = { @@ -32,7 +23,11 @@ export async function formatters( } } - const { indent, quotes, semi } = { + const { + indent, + quotes, + semi, + } = { ...StylisticConfigDefaults, ...stylistic, } @@ -161,7 +156,9 @@ export async function formatters( } if (options.markdown) { - const formatter = options.markdown === true ? 'prettier' : options.markdown + const formatter = options.markdown === true + ? 'prettier' + : options.markdown configs.push( { diff --git a/src/configs/markdown.ts b/src/configs/markdown.ts index 0b553bab26b..6043db5f56c 100644 --- a/src/configs/markdown.ts +++ b/src/configs/markdown.ts @@ -1,17 +1,15 @@ import * as mdx from 'eslint-plugin-mdx' -import type { - FlatConfigItem, - OptionsComponentExts, - OptionsFiles, - OptionsOverrides, -} from '../types' +import type { FlatConfigItem, OptionsComponentExts, OptionsFiles, OptionsOverrides } from '../types' import { GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_OR_MDX } from '../globs' export async function markdown( options: OptionsFiles & OptionsComponentExts & OptionsOverrides = {}, ): Promise { - const { componentExts = [], overrides = {} } = options + const { + componentExts = [], + overrides = {}, + } = options return [ {