Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Dec 20, 2023
1 parent baa52cf commit cf59f8d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 31 deletions.
18 changes: 1 addition & 17 deletions scripts/validateData.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
// @ts-check

import { packagesSchema, templatesSchema, resourcesSchema } from '../src/lib/schemas.js';
import { packagesSchema, templatesSchema } from '../src/lib/schemas.js';
import packages from '../src/routes/packages/packages.json' assert { type: 'json' };
import templates from '../src/routes/templates/templates.json' assert { type: 'json' };
import books from '../src/routes/resources/books.json' assert { type: 'json' };
import extensions from '../src/routes/resources/extensions.json' assert { type: 'json' };
import misc from '../src/routes/resources/misc.json' assert { type: 'json' };
import videos from '../src/routes/resources/videos.json' assert { type: 'json' };

packagesSchema.parse(packages);
console.log('Validated packages.json');

templatesSchema.parse(templates);
console.log('Validated templates.json');

resourcesSchema.parse(books);
console.log('Validated books.json');

resourcesSchema.parse(extensions);
console.log('Validated extensions.json');

resourcesSchema.parse(misc);
console.log('Validated misc.json');

resourcesSchema.parse(videos);
console.log('Validated videos.json');
8 changes: 0 additions & 8 deletions src/lib/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,3 @@ export const templatesSchema = z.array(
tags: z.array(z.string()).optional()
})
);

export const resourcesSchema = z.array(
z.object({
title: z.string(),
url: z.string().url(),
description: z.string()
})
);
20 changes: 15 additions & 5 deletions src/routes/resources/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
<div>There are a few books from major publishers:</div>
<ul>
{#each booksFromPublisher as { title, url, description }}
<li><a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}</li>
<li>
<a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}
</li>
{/each}
</ul>

<div>As well as a couple self-published books:</div>
<ul>
{#each booksSelfPublished as { title, url, description }}
<li><a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}</li>
<li>
<a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}
</li>
{/each}
</ul>

Expand All @@ -36,14 +40,18 @@
<div>There are also a number of third-party courses:</div>
<ul>
{#each videoCourses as { title, url, description }}
<li><a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}</li>
<li>
<a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}
</li>
{/each}
</ul>

<div>Finally, there are also YouTube channels and playlists that teach Svelte:</div>
<ul>
{#each youtube as { title, url, description }}
<li><a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}</li>
<li>
<a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}
</li>
{/each}
</ul>

Expand All @@ -68,7 +76,9 @@

<ul>
{#each misc as { title, url, description }}
<li><a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}</li>
<li>
<a href={url} target="_blank">{title}</a>{#if description}&nbsp;- {description}{/if}
</li>
{/each}
</ul>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/routes/resources/youtube.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
"url": "https://youtube.com/playlist?list=PL4cUxeGkcC9hlbrVO_2QFVqVPhlZmz7tO&si=HHE2i-mSt9u1_CtW",
"description": "by The Net Ninja"
}

]

0 comments on commit cf59f8d

Please sign in to comment.