-
-
Notifications
You must be signed in to change notification settings - Fork 662
Add lint rule to automatically add playground links to JSDoc example codeblocks #1283
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
base: main
Are you sure you want to change the base?
Conversation
c14142e to
73e7a64
Compare
73e7a64 to
879af08
Compare
596aa61 to
ab66b08
Compare
Review SummaryThis PR adds an automated lint rule to generate TypeScript Playground links for JSDoc code examples. The implementation is well-structured, but there are several issues that need to be addressed before this can be merged. Critical Issues1. Incomplete Implementation - PR marked as WIPThe PR description states "WIP" (Work in Progress), indicating this is not ready for review or merge. 2. Missing Test ExecutionBefore merging, you MUST run
3. Massive File Changes (184 files)The PR modifies 184 files across the codebase, adding playground links to existing types. This needs careful verification:
4. Potential Bug: Empty Code HandlingFile: const getCodeIndent = code => {
const line = code.split('\n').filter(Boolean); // eslint-disable-line unicorn/prefer-array-find
const firstLine = line[0];
const leadingSpaces = firstLine.slice(0, firstLine.length - firstLine.trimStart().length);
return leadingSpaces;
};Issue: If code contains only empty lines, Fix: Add a guard: const getCodeIndent = code => {
const line = code.split('\n').filter(Boolean);
if (line.length === 0) return '';
const firstLine = line[0];
const leadingSpaces = firstLine.slice(0, firstLine.length - firstLine.trimStart().length);
return leadingSpaces;
};5. Regex Doesn't Handle Edge CasesFile: The regex
|
WIP