From 32b2c366f77f30ff506a2048df8d81046b3630c6 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 11 Jul 2024 16:22:13 +0100 Subject: [PATCH] chore: lint --- .eslintignore | 2 -- eslint.config.mjs | 4 +++- test/e2e.spec.ts | 14 ++++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index de4d1f00..00000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -node_modules diff --git a/eslint.config.mjs b/eslint.config.mjs index 3b614a0d..2ee6c2ed 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,3 +1,5 @@ import antfu from '@antfu/eslint-config' -export default antfu() +export default antfu().append({ + ignores: ['README.md'], +}) diff --git a/test/e2e.spec.ts b/test/e2e.spec.ts index 62ef6744..55adead0 100644 --- a/test/e2e.spec.ts +++ b/test/e2e.spec.ts @@ -15,7 +15,7 @@ describe('fontaine', () => { ) // @ts-expect-error there must be a file or we _want_ a test failure const css = await readFile(join(assetsDir, cssFile), 'utf-8') - expect(css.replace(/\.[\w]+\.woff2/g, '.woff2')).toMatchInlineSnapshot(` + expect(css.replace(/\.\w+\.woff2/g, '.woff2')).toMatchInlineSnapshot(` "@font-face{font-family:Poppins variant fallback;src:local("Segoe UI");size-adjust:112.7753%;ascent-override:93.1055%;descent-override:31.0352%;line-gap-override:8.8672%}@font-face{font-family:Poppins variant fallback;src:local("Arial");size-adjust:112.1577%;ascent-override:93.6182%;descent-override:31.2061%;line-gap-override:8.916%}@font-face{font-family:Poppins variant;font-display:swap;src:url(/assets/font-CTKNfV9P.ttf) format("truetype")}@font-face{font-family:Roboto fallback;src:local("Segoe UI");size-adjust:100.3304%;ascent-override:92.4679%;descent-override:24.3337%;line-gap-override:0%}@font-face{font-family:Roboto fallback;src:local("Arial");size-adjust:99.7809%;ascent-override:92.9771%;descent-override:24.4677%;line-gap-override:0%}@font-face{font-family:Roboto;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format("woff2")}@font-face{font-family:Inter fallback;src:local("Segoe UI");size-adjust:107.6492%;ascent-override:89.9914%;descent-override:22.4319%;line-gap-override:0%}@font-face{font-family:Inter fallback;src:local("Arial");size-adjust:107.0596%;ascent-override:90.4869%;descent-override:22.5554%;line-gap-override:0%}@font-face{font-family:Inter;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v12/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7.woff2) format("woff2")}:root{--someFont: "Poppins variant", "Poppins variant fallback"}h1{font-family:Poppins variant,Poppins variant fallback,sans-serif}.roboto{font-family:Roboto,Roboto fallback,Arial,Helvetica,sans-serif}p{font-family:Poppins variant,Poppins variant fallback}div{font-family:var(--someFont)}.inter{font-family:Inter,Inter fallback} " `) @@ -34,9 +34,15 @@ async function $(literals: TemplateStringsArray, ...values: any[]) { const proc = execaCommand(cmd, { stdio: 'pipe', }) - proc.stdin && process.stdin.pipe(proc.stdin) - proc.stdout && proc.stdout.pipe(process.stdout) - proc.stderr && proc.stderr.pipe(process.stderr) + if (proc.stdin) { + process.stdin.pipe(proc.stdin) + } + if (proc.stdout) { + proc.stdout.pipe(process.stdout) + } + if (proc.stderr) { + proc.stderr.pipe(process.stderr) + } const result = await proc return result.stdout }