Closed josecelano closed 5 months ago
When you run npm run check you get some svelte errors:
npm run check
> torrust-website@1.0.0 check > svelte-kit sync && svelte-check --tsconfig ./jsconfig.json ==================================== Loading svelte-check in workspace: /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website Getting Svelte diagnostics... (x2) (x3) (x4) (x5) (x6) (x7) (x8) (x9) (x10) (x11) (x12) (x13) (x14) (x15) (x16) (x17) (x18) (x19) (x20) (x21) (x22) (x23) (x24) (x25) (x26) (x27) (x28) (x29) (x30) (x31) (x32) (x33) (x34) /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/data/blog-posts/utils.ts:4:19 Hint: Could not find a declaration file for module 'prismjs'. '/home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/node_modules/prismjs/prism.js' implicitly has an 'any' type. Try `npm i --save-dev @types/prismjs` if it exists or add a new declaration (.d.ts) file containing `declare module 'prismjs';` // eslint-disable-next-line no-unused-vars import Prism from 'prismjs'; // Here we assign it to a variable so the import above /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/data/blog-posts/utils.ts:7:7 Hint: 'ifYouRemoveMeTheBuildFails' is declared but its value is never read. // is not removed automatically on build const ifYouRemoveMeTheBuildFails = Prism; import 'prism-svelte'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/data/blog-posts/utils.ts:9:25 Hint: Could not find a declaration file for module 'reading-time/lib/reading-time'. '/home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/node_modules/reading-time/lib/reading-time.js' implicitly has an 'any' type. If the 'reading-time' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'reading-time/lib/reading-time';` import 'prism-svelte'; import readingTime from 'reading-time/lib/reading-time'; import striptags from 'striptags'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/routes/rss.xml/+server.ts:3:24 Hint: Could not find a declaration file for module 'dateformat'. '/home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/node_modules/dateformat/lib/dateformat.js' implicitly has an 'any' type. Try `npm i --save-dev @types/dateformat` if it exists or add a new declaration (.d.ts) file containing `declare module 'dateformat';` import type { BlogPost } from '$lib/utils/types'; import dateformat from 'dateformat'; import { filterPosts, importPosts } from '$lib/data/blog-posts/utils'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/atoms/Button.story.svelte:11:6 Error: Property 'additionalClass' is missing in type '{ color: "primary"; style: "solid"; size: "medium"; href: string; target: "_blank"; rel: string; }' but required in type 'NoUndefinedField<{ [x: string]: any; color?: "primary" | "secondary" | undefined; style?: "solid" | "understated" | "clear" | undefined; size?: "small" | "medium" | "large" | undefined; href?: string | undefined; additionalClass?: string | undefined; target?: "_self" | ... 1 more ... | undefined; rel?: string | unde...'. (ts) let props: NoUndefinedField<ComponentProps<Button>> = { color: 'primary', /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/atoms/Logo.svelte:19:3 Error: at-rule or selector expected (scss) width: auto; } /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/atoms/Logo.svelte:24:2 Error: at-rule or selector expected (scss) } } </style> /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/atoms/Logo.svelte:17:3 Error: } expected (scss) :global(> img) { width: auto; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/atoms/Sparkles.svelte:54:34 Error: Type 'number' is not assignable to type 'string'. (ts) {#each sparkles as sparkle (sparkle.id)} <Sparkle color={sparkle.color} size={sparkle.size} style={sparkle.style} /> {/each} /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/molecules/ThemeToggle.svelte:50:20 Warn: Unused CSS selector ".theme-toggle:hover #sun > *" (svelte) <style lang="scss"> .theme-toggle { /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/organisms/ContentSection.story.svelte:11:6 Error: Property 'id' is missing in type '{ title: string; description: string; align: "top"; }' but required in type 'NoUndefinedField<{ id?: string | undefined; title?: string | undefined; description?: string | undefined; align?: "left" | "top" | "right" | undefined; }>'. (ts) let props: NoUndefinedField<ComponentProps<ContentSection>> = { title: 'Content Section', /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/organisms/Hero.svelte:33:20 Warn: Unused CSS selector "#hero .intro .left" (svelte) <style lang="scss"> @import '$lib/scss/breakpoints.scss'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/organisms/Hero.svelte:33:20 Warn: Unused CSS selector "#hero .intro .right" (svelte) <style lang="scss"> @import '$lib/scss/breakpoints.scss'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/lib/components/organisms/Hero.story.svelte:10:3 Error: Type '{}' is not assignable to type 'IntrinsicAttributes & { hasFeatures: Boolean; hasPosts: Boolean; }'. Type '{}' is missing the following properties from type '{ hasFeatures: Boolean; hasPosts: Boolean; }': hasFeatures, hasPosts (ts) <Hst.Story title="Organisms/Hero" layout={{ type: 'single', iframe: true }}> <Hero /> </Hst.Story> /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/routes/(blog-article)/+layout.svelte:91:20 Warn: Unused CSS selector "#article-content .full-bleed" (svelte) <style lang="scss"> @import '$lib/scss/_mixins.scss'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/routes/(blog-article)/+layout.svelte:91:20 Warn: Unused CSS selector "#article-content .cover-image img" (svelte) <style lang="scss"> @import '$lib/scss/_mixins.scss'; /home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/src/routes/(blog-article)/+layout.svelte:5:25 Hint: Could not find a declaration file for module 'dateformat'. '/home/josecelano/Documents/git/committer/me/github/torrust/torrust-website/node_modules/dateformat/lib/dateformat.js' implicitly has an 'any' type. Try `npm i --save-dev @types/dateformat` if it exists or add a new declaration (.d.ts) file containing `declare module 'dateformat';` (ts) import Tag from '$lib/components/atoms/Tag.svelte'; import dateformat from 'dateformat'; ==================================== svelte-check found 7 errors, 5 warnings, and 5 hints
npm run checkreturns:
svelte-check found 0 errors and 0 warnings
When you run
npm run check
you get some svelte errors: