Skip to content

Commit e082e90

Browse files
authored
fix: lint-snippets glob (#7686)
* fix: lint snippets glob * fix: snippet syntax
1 parent e19099e commit e082e90

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

apps/site/pages/en/learn/test-runner/using-test-runner.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,15 @@ import { test } from 'node:test';
7777
import { detectOsInUserAgent } from '';
7878

7979
const userAgents = [
80-
{ ua: /**/, os: 'WIN' },
80+
{
81+
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.3',
82+
os: 'WIN',
83+
},
8184
//
8285
];
8386

8487
test('Detect OS via user-agent', { concurrency: true }, t => {
85-
for (const { os, ua } from userAgents) {
88+
for (const { os, ua } of userAgents) {
8689
t.test(ua, () => assert.equal(detectOsInUserAgent(ua), os));
8790
}
8891
});

apps/site/scripts/lint-snippets/index.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ function reportErrors(errors) {
7979
// Get all markdown files
8080
const filePaths = await glob('**/*.md', {
8181
root: process.cwd(),
82-
cwd: 'apps/site/pages/en/learn/',
82+
cwd: 'pages/en/learn/',
8383
absolute: true,
8484
});
8585

86+
console.log(`Found ${filePaths.length} markdown files.`);
87+
8688
// Validate all files and collect errors
8789
const allErrors = await Promise.all(filePaths.map(validateFile));
8890

0 commit comments

Comments
 (0)