MCPcopy Index your code
hub / github.com/QwikDev/qwik / renderExample

Function renderExample

scripts/eslint-docs.ts:28–46  ·  view source on GitHub ↗
(example: QwikEslintExample, state: 'good' | 'bad' = 'good')

Source from the content-addressed store, hash-verified

26}
27
28function renderExample(example: QwikEslintExample, state: 'good' | 'bad' = 'good') {
29 mdx.push('<div class="code-wrapper">');
30 if (state === 'good') {
31 mdx.push('<span class="badge good">✓</span>');
32 } else {
33 mdx.push('<span class="badge bad">✕</span>');
34 }
35 mdx.push(
36 '```tsx' +
37 ((example.codeHighlight && ` ${example.codeHighlight}`) || '') +
38 ((example.codeTitle && ` title="${example.codeTitle}"`) || '')
39 );
40 mdx.push(example.code);
41 mdx.push('```');
42 if (example.description) {
43 mdx.push(`<p class="code-description">${example.description}</p>`);
44 }
45 mdx.push('</div>');
46}
47
48const rulesMap = Object.keys(rules).map((ruleName) => {
49 const rule = ruleName as keyof typeof rules;

Callers 1

eslint-docs.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…