Skip to content

fix: lint-snippets glob #7686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/site/pages/en/learn/test-runner/using-test-runner.md
Original file line number Diff line number Diff line change
@@ -77,12 +77,15 @@ import { test } from 'node:test';
import { detectOsInUserAgent } from '';

const userAgents = [
{ ua: /**/, os: 'WIN' },
{
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.3',
os: 'WIN',
},
//
];

test('Detect OS via user-agent', { concurrency: true }, t => {
for (const { os, ua } from userAgents) {
for (const { os, ua } of userAgents) {
t.test(ua, () => assert.equal(detectOsInUserAgent(ua), os));
}
});
4 changes: 3 additions & 1 deletion apps/site/scripts/lint-snippets/index.mjs
Original file line number Diff line number Diff line change
@@ -79,10 +79,12 @@ function reportErrors(errors) {
// Get all markdown files
const filePaths = await glob('**/*.md', {
root: process.cwd(),
cwd: 'apps/site/pages/en/learn/',
cwd: 'pages/en/learn/',
absolute: true,
});

console.log(`Found ${filePaths.length} markdown files.`);

// Validate all files and collect errors
const allErrors = await Promise.all(filePaths.map(validateFile));