Skip to content

Commit

Permalink
refactor: use filepath instead of fileinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Jan 10, 2022
1 parent 9d1ed8e commit 9f93734
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/cli/src/dirCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs } from 'fs'
import * as path from 'path'
import { grey, white } from 'chalk'
import { loadConfig, Config } from '@svgr/core'
import { format, resolveConfig, getFileInfo } from 'prettier'
import { format, resolveConfig } from 'prettier'
import {
convertFile,
transformFilename,
Expand Down Expand Up @@ -100,9 +100,8 @@ export const dirCommand: SvgrCommand = async (
const prettierRcConfig = opts.runtimeConfig
? await resolveConfig(filepath, { editorconfig: true })
: {}
const prettierFileInfo = await getFileInfo(filepath)
return format(fileContent, {
parser: prettierFileInfo.inferredParser,
filepath,
...prettierRcConfig,
...opts.prettierConfig,
})
Expand Down

0 comments on commit 9f93734

Please sign in to comment.