From 2a55b0399d49d6aee2a436084aea5423675c1722 Mon Sep 17 00:00:00 2001 From: Kazuma Ebina Date: Sat, 14 Aug 2021 15:30:33 +0900 Subject: [PATCH] feat: make @linaria/shaker optional (#819) --- packages/babel/src/utils/loadOptions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel/src/utils/loadOptions.ts b/packages/babel/src/utils/loadOptions.ts index 8c0f0b83e..3553f68f3 100644 --- a/packages/babel/src/utils/loadOptions.ts +++ b/packages/babel/src/utils/loadOptions.ts @@ -10,7 +10,7 @@ const explorer = cosmiconfig('linaria'); export default function loadOptions( overrides: Partial = {} ): Partial { - const { configFile, ignore, ...rest } = overrides; + const { configFile, ignore, rules, ...rest } = overrides; const result = configFile !== undefined @@ -20,7 +20,7 @@ export default function loadOptions( return { displayName: false, evaluate: true, - rules: [ + rules: rules ?? [ { // FIXME: if `rule` is not specified in a config, `@linaria/shaker` should be added as a dependency // eslint-disable-next-line import/no-extraneous-dependencies