diff --git a/packages/kit/src/core/adapt/test/index.js b/packages/kit/src/core/adapt/test/index.js index 8650927a4093..574a35a79414 100644 --- a/packages/kit/src/core/adapt/test/index.js +++ b/packages/kit/src/core/adapt/test/index.js @@ -30,7 +30,7 @@ suite('copy files', () => { /** @type {import('types/config').ValidatedConfig} */ const config = { kit: { - // @ts-ignore + // @ts-expect-error files: { assets: join(__dirname, 'fixtures/basic/static') }, @@ -76,13 +76,13 @@ suite('prerender', async () => { const config = { extensions: ['.svelte'], kit: { - // @ts-ignore + // @ts-expect-error files: { assets: join(__dirname, 'fixtures/prerender/static'), routes: join(__dirname, 'fixtures/prerender/src/routes') }, appDir: '_app', - // @ts-ignore + // @ts-expect-error prerender: { pages: ['*'], enabled: true diff --git a/packages/kit/src/core/build/index.js b/packages/kit/src/core/build/index.js index f432c71e1c47..b960d3f14cdf 100644 --- a/packages/kit/src/core/build/index.js +++ b/packages/kit/src/core/build/index.js @@ -468,7 +468,6 @@ async function build_server( // this API is marked as @alpha https://github.com/vitejs/vite/blob/27785f7fcc5b45987b5f0bf308137ddbdd9f79ea/packages/vite/src/node/config.ts#L129 // it's not exposed in the typescript definitions as a result // so we need to ignore the fact that it's missing - // @ts-ignore ssr: { // note to self: this _might_ need to be ['svelte', '@sveltejs/kit', ...get_no_external()] // but I'm honestly not sure. roll with this for now and see if it's ok diff --git a/packages/kit/src/core/config/index.spec.js b/packages/kit/src/core/config/index.spec.js index a2f863ba2115..f0954248b95d 100644 --- a/packages/kit/src/core/config/index.spec.js +++ b/packages/kit/src/core/config/index.spec.js @@ -5,7 +5,7 @@ import { deep_merge, validate_config } from './index.js'; test('fills in defaults', () => { const validated = validate_config({}); - // @ts-ignore + // @ts-expect-error delete validated.kit.vite; assert.equal(validated, { @@ -66,7 +66,7 @@ test('errors on invalid values', () => { assert.throws(() => { validate_config({ kit: { - // @ts-ignore + // @ts-expect-error target: 42 } }); @@ -78,7 +78,7 @@ test('errors on invalid nested values', () => { validate_config({ kit: { files: { - // @ts-ignore + // @ts-expect-error potato: 'blah' } } @@ -105,7 +105,7 @@ test('fills in partial blanks', () => { assert.equal(validated.kit.vite(), {}); - // @ts-ignore + // @ts-expect-error delete validated.kit.vite; assert.equal(validated, { @@ -248,7 +248,6 @@ function validate_paths(name, input, output) { assert.equal( validate_config({ kit: { - // @ts-ignore paths: input } }).kit.paths, diff --git a/packages/kit/src/core/config/test/index.js b/packages/kit/src/core/config/test/index.js index 614cefbb6e45..daa1c8b400b7 100644 --- a/packages/kit/src/core/config/test/index.js +++ b/packages/kit/src/core/config/test/index.js @@ -15,7 +15,7 @@ async function testLoadDefaultConfig(path) { const config = await load_config({ cwd }); - // @ts-ignore + // @ts-expect-error delete config.kit.vite; // can't test equality of a function assert.equal(config, { diff --git a/packages/kit/src/core/create_manifest_data/index.js b/packages/kit/src/core/create_manifest_data/index.js index 1a8a2f7b04da..211047451b4a 100644 --- a/packages/kit/src/core/create_manifest_data/index.js +++ b/packages/kit/src/core/create_manifest_data/index.js @@ -247,11 +247,11 @@ export default function create_manifest_data({ config, output, cwd = process.cwd type: 'page', pattern, params, - // @ts-ignore + // @ts-expect-error path, - // @ts-ignore + // @ts-expect-error a, - // @ts-ignore + // @ts-expect-error b }); } else { diff --git a/packages/kit/src/core/create_manifest_data/index.spec.js b/packages/kit/src/core/create_manifest_data/index.spec.js index bd07cbc93826..bec3a6155aa9 100644 --- a/packages/kit/src/core/create_manifest_data/index.spec.js +++ b/packages/kit/src/core/create_manifest_data/index.spec.js @@ -16,7 +16,7 @@ const create = (dir, extensions = ['.svelte']) => { config: { extensions, kit: { - // @ts-ignore + // @ts-expect-error files: { assets: path.resolve(cwd, 'static'), routes: path.resolve(cwd, dir) diff --git a/packages/kit/src/core/server/cert.js b/packages/kit/src/core/server/cert.js index b49b30103fcf..dc447bbdc57d 100644 --- a/packages/kit/src/core/server/cert.js +++ b/packages/kit/src/core/server/cert.js @@ -1,4 +1,4 @@ -// @ts-ignore +// @ts-expect-error import { generate } from 'selfsigned'; /** diff --git a/packages/kit/src/runtime/app/navigation.js b/packages/kit/src/runtime/app/navigation.js index e3e4ba049bd0..9443b71f08cd 100644 --- a/packages/kit/src/runtime/app/navigation.js +++ b/packages/kit/src/runtime/app/navigation.js @@ -19,7 +19,7 @@ export const prefetchRoutes = import.meta.env.SSR ? guard('prefetchRoutes') : pr * @type {import('$app/navigation').goto} */ async function goto_(href, opts) { - // @ts-ignore + // @ts-expect-error return router.goto(href, opts, []); } @@ -28,7 +28,7 @@ async function goto_(href, opts) { */ async function invalidate_(resource) { const { href } = new URL(resource, location.href); - // @ts-ignore + // @ts-expect-error return router.renderer.invalidate(href); } @@ -36,7 +36,7 @@ async function invalidate_(resource) { * @type {import('$app/navigation').prefetch} */ function prefetch_(href) { - // @ts-ignore + // @ts-expect-error return router.prefetch(new URL(href, get_base_uri(document))); } @@ -45,14 +45,14 @@ function prefetch_(href) { */ async function prefetchRoutes_(pathnames) { const matching = pathnames - ? // @ts-ignore + ? // @ts-expect-error router.routes.filter((route) => pathnames.some((pathname) => route[0].test(pathname))) - : // @ts-ignore + : // @ts-expect-error router.routes; const promises = matching .filter((r) => r && r.length > 1) - // @ts-ignore + // @ts-expect-error .map((r) => Promise.all(r[1].map((load) => load()))); await Promise.all(promises); diff --git a/packages/kit/src/runtime/app/stores.js b/packages/kit/src/runtime/app/stores.js index e33ebb3f4c91..096368a97ec6 100644 --- a/packages/kit/src/runtime/app/stores.js +++ b/packages/kit/src/runtime/app/stores.js @@ -26,7 +26,7 @@ export const getStores = () => { navigating: { subscribe: stores.navigating.subscribe }, - // @ts-ignore - deprecated, not part of type definitions, but still callable + // @ts-expect-error - deprecated, not part of type definitions, but still callable get preloading() { console.error('stores.preloading is deprecated; use stores.navigating instead'); return { diff --git a/packages/kit/src/runtime/client/renderer.js b/packages/kit/src/runtime/client/renderer.js index 8f3b9abfa43d..d555743ca08d 100644 --- a/packages/kit/src/runtime/client/renderer.js +++ b/packages/kit/src/runtime/client/renderer.js @@ -82,9 +82,9 @@ export class Renderer { /** @type {import('./types').NavigationState} */ this.current = { - // @ts-ignore + // @ts-expect-error page: null, - // @ts-ignore + // @ts-expect-error session_id: null, branch: [] }; @@ -198,7 +198,7 @@ export class Renderer { dispatchEvent(new CustomEvent('sveltekit:navigation-start')); if (this.started) { - // @ts-ignore + // @ts-expect-error this.stores.navigating.set({ from: { path: this.current.page.path, @@ -327,7 +327,7 @@ export class Renderer { */ async _get_navigation_result(info, no_cache) { if (this.loading.id === info.id) { - // @ts-ignore if the id is defined then the promise is too + // @ts-expect-error if the id is defined then the promise is too return this.loading.promise; } @@ -544,7 +544,7 @@ export class Renderer { } const [pattern, a, b, get_params] = route; - // @ts-ignore - the pattern is for the route which we've already matched to this path + // @ts-expect-error - the pattern is for the route which we've already matched to this path const params = get_params ? get_params(pattern.exec(path)) : {}; const changed = this.current.page && { diff --git a/packages/kit/src/runtime/client/router.js b/packages/kit/src/runtime/client/router.js index d72d367ba939..c4afc0a2d179 100644 --- a/packages/kit/src/runtime/client/router.js +++ b/packages/kit/src/runtime/client/router.js @@ -221,7 +221,7 @@ export class Router { throw new Error('Attempted to prefetch a URL that does not belong to this app'); } - // @ts-ignore + // @ts-expect-error return this.renderer.load(info); } @@ -255,13 +255,13 @@ export class Router { } } - // @ts-ignore6 + // @ts-expect-error this.renderer.notify({ path: info.path, query: info.query }); - // @ts-ignore + // @ts-expect-error await this.renderer.update(info, chain, false); if (!keepfocus) { diff --git a/packages/kit/src/runtime/client/start.js b/packages/kit/src/runtime/client/start.js index e88bfbf6fb47..1983f0f5b05d 100644 --- a/packages/kit/src/runtime/client/start.js +++ b/packages/kit/src/runtime/client/start.js @@ -1,6 +1,6 @@ -// @ts-ignore +// @ts-expect-error import Root from 'ROOT'; // eslint-disable-line import/no-unresolved -// @ts-ignore +// @ts-expect-error import { routes, fallback } from 'MANIFEST'; // eslint-disable-line import/no-unresolved import { Router } from './router.js'; import { Renderer } from './renderer.js'; diff --git a/packages/kit/src/runtime/server/page/respond.js b/packages/kit/src/runtime/server/page/respond.js index c1f7913c74a8..59a2a361c6a2 100644 --- a/packages/kit/src/runtime/server/page/respond.js +++ b/packages/kit/src/runtime/server/page/respond.js @@ -17,7 +17,7 @@ import { coalesce_to_error } from '../utils.js'; */ export async function respond({ request, options, state, $session, route }) { const match = route.pattern.exec(request.path); - // @ts-ignore we already know there's a match + // @ts-expect-error we already know there's a match const params = route.params(match); const page = { diff --git a/packages/kit/test/apps/basics/src/routes/caching/private/uses-fetch.svelte b/packages/kit/test/apps/basics/src/routes/caching/private/uses-fetch.svelte index d8159d28ca61..5dcb8acaa5f4 100644 --- a/packages/kit/test/apps/basics/src/routes/caching/private/uses-fetch.svelte +++ b/packages/kit/test/apps/basics/src/routes/caching/private/uses-fetch.svelte @@ -2,7 +2,7 @@ /** @type {import('@sveltejs/kit').Load} */ export async function load({ page, fetch }) { const res = await fetch('/caching/private/uses-fetch.json', { - // @ts-ignore + // @ts-expect-error credentials: page.query.get('credentials') }); diff --git a/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-client.svelte b/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-client.svelte index 4e1101a8d6d7..ffaca25e8e69 100644 --- a/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-client.svelte +++ b/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-client.svelte @@ -2,7 +2,7 @@ /** @type {import('@sveltejs/kit').Load} */ export async function load() { if (typeof window !== 'undefined') { - // @ts-ignore + // @ts-expect-error return { status: 555, error: {} }; } diff --git a/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-server.svelte b/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-server.svelte index b092d678ddb0..ad4abb3bed98 100644 --- a/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-server.svelte +++ b/packages/kit/test/apps/basics/src/routes/errors/load-error-malformed-server.svelte @@ -1,7 +1,7 @@ diff --git a/packages/kit/test/apps/basics/src/routes/load/fetch-request.svelte b/packages/kit/test/apps/basics/src/routes/load/fetch-request.svelte index 5db47178c264..5b9931cf65b9 100644 --- a/packages/kit/test/apps/basics/src/routes/load/fetch-request.svelte +++ b/packages/kit/test/apps/basics/src/routes/load/fetch-request.svelte @@ -8,7 +8,7 @@ // this is contrived, but saves us faffing about with node-fetch here const resource = browser ? new Request(url) : { url }; - // @ts-ignore + // @ts-expect-error const res = await fetch(resource); const { answer } = await res.json(); @@ -23,4 +23,4 @@ export let answer; -