Skip to content

Commit

Permalink
chore: reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Dec 10, 2023
1 parent f626b54 commit dd8d570
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
29 changes: 13 additions & 16 deletions 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<FlatConfigItem[]> {
await ensurePackages(['eslint-plugin-format'])
await ensurePackages([
'eslint-plugin-format',
])

if (options === true) {
options = {
Expand All @@ -32,7 +23,11 @@ export async function formatters(
}
}

const { indent, quotes, semi } = {
const {
indent,
quotes,
semi,
} = {
...StylisticConfigDefaults,
...stylistic,
}
Expand Down Expand Up @@ -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(
{
Expand Down
12 changes: 5 additions & 7 deletions 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<FlatConfigItem[]> {
const { componentExts = [], overrides = {} } = options
const {
componentExts = [],
overrides = {},
} = options

return [
{
Expand Down

0 comments on commit dd8d570

Please sign in to comment.