Skip to content

Commit 571d5c8

Browse files
committedAug 15, 2023
fix(cli): fix default dimensions, prettier & svgo
1 parent 8b97248 commit 571d5c8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
 

‎packages/cli/src/__snapshots__/index.test.ts.snap

+3-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ export { default as File } from './File'
77
`;
88

99
exports[`cli should not override config with cli defaults 1`] = `
10-
"import * as React from 'react'
11-
const SvgFile = () => (
12-
<svg xmlns="http://www.w3.org/2000/svg" width={48} height={1}>
13-
<path fill="#063855" fillRule="evenodd" d="M0 0h48v1H0z" />
14-
</svg>
15-
)
16-
export default SvgFile
17-
10+
"import * as React from "react";
11+
const SvgFile = () => <svg viewBox="0 0 48 1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink"><title>{"Rectangle 5"}</title><desc>{"Created with Sketch."}</desc><defs /><g id="Page-1" stroke="none" strokeWidth={1} fill="none" fillRule="evenodd"><g id="19-Separator" transform="translate(-129.000000, -156.000000)" fill="#063855"><g id="Controls/Settings" transform="translate(80.000000, 0.000000)"><g id="Content" transform="translate(0.000000, 64.000000)"><g id="Group" transform="translate(24.000000, 56.000000)"><g id="Group-2"><rect id="Rectangle-5" x={25} y={36} width={48} height={1} /></g></g></g></g></g></g></svg>;
12+
export default SvgFile;
1813
"
1914
`;
2015

‎packages/cli/src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ async function run() {
199199
}
200200

201201
const programOpts = noUndefinedKeys(program.opts<Options>())
202+
if (programOpts.dimensions) delete programOpts.dimensions
203+
if (programOpts.svgo) delete programOpts.svgo
204+
if (programOpts.prettier) delete programOpts.prettier
202205
const opts = (await loadConfig(programOpts, {
203206
filePath: process.cwd(),
204207
})) as Options

1 commit comments

Comments
 (1)

vercel[bot] commented on Aug 15, 2023

@vercel[bot]

Successfully deployed to the following URLs:

svgr – ./

svgr-git-main-gregberge.vercel.app
svgr-gregberge.vercel.app
api.react-svgr.com

Please sign in to comment.