From 571d5c8bd18bc13c12eeb27a9052fa065aeb012e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Tue, 15 Aug 2023 08:45:34 +0200 Subject: [PATCH] fix(cli): fix default dimensions, prettier & svgo --- packages/cli/src/__snapshots__/index.test.ts.snap | 11 +++-------- packages/cli/src/index.ts | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/__snapshots__/index.test.ts.snap b/packages/cli/src/__snapshots__/index.test.ts.snap index 2a14529d..58f7d7d4 100644 --- a/packages/cli/src/__snapshots__/index.test.ts.snap +++ b/packages/cli/src/__snapshots__/index.test.ts.snap @@ -7,14 +7,9 @@ export { default as File } from './File' `; exports[`cli should not override config with cli defaults 1`] = ` -"import * as React from 'react' -const SvgFile = () => ( - - - -) -export default SvgFile - +"import * as React from "react"; +const SvgFile = () => {"Rectangle 5"}{"Created with Sketch."}; +export default SvgFile; " `; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index d1b2a371..ae685ccf 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -199,6 +199,9 @@ async function run() { } const programOpts = noUndefinedKeys(program.opts()) + if (programOpts.dimensions) delete programOpts.dimensions + if (programOpts.svgo) delete programOpts.svgo + if (programOpts.prettier) delete programOpts.prettier const opts = (await loadConfig(programOpts, { filePath: process.cwd(), })) as Options