diff --git a/src/index.ts b/src/index.ts index ba28fa7..38eb3e5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -114,14 +114,17 @@ const plugin: PluginCreator = ctx => { Declaration: { 'font-metrics': (declaration, helpers) => { - const { size, family: fontFamily, gap } = declaration.value.match(matcher)?.groups || {} + const { size, family: fontFamily, gap } = + declaration.value.match(matcher)?.groups || {} if (!size || !fontFamily || !gap) { - throw new Error('Correct syntax is `font-metrics: [font-size]px [font-family] [line-gap]px;') + throw new Error( + 'Correct syntax is `font-metrics: [font-size]px [font-family] [line-gap]px;' + ) } const declare = useDeclare(declaration, helpers.Declaration) - + declare({ fontFamily, fontSize: `${size}px`, diff --git a/test/index.spec.ts b/test/index.spec.ts index 783e90d..f79cb36 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -51,17 +51,16 @@ describe(`plugin`, () => { `.test { line-gap: 10px; font-size: 10vw; }`, `.test { line-gap: 10px; font-size: 10px; }`, ] - await Promise.all(invalidOptions.map(async (css) => { - let errored = false - try { - await processor.process( - css, - { from: undefined } - ) - } catch { - errored = true - } - expect(errored).toBeTruthy() - })) + await Promise.all( + invalidOptions.map(async css => { + let errored = false + try { + await processor.process(css, { from: undefined }) + } catch { + errored = true + } + expect(errored).toBeTruthy() + }) + ) }) })