From f1b89af5d6f36665b1f3b592ddf6d441ed81f0fa Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 19 Aug 2024 12:48:40 +0800 Subject: [PATCH] Update tsconfig --- package.json | 2 +- src/constants.js | 2 +- src/index.js | 6 +++--- tsconfig.json | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 99c1917..807aed8 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/bluwy/svelte-preprocess-import-assets.git" + "url": "git+https://github.com/bluwy/svelte-preprocess-import-assets.git" }, "bugs": { "url": "https://github.com/bluwy/svelte-preprocess-import-assets/issues" diff --git a/src/constants.js b/src/constants.js index b5fed67..4c56c43 100644 --- a/src/constants.js +++ b/src/constants.js @@ -49,7 +49,7 @@ export const ALLOWED_META_PROPERTY = [ 'vk:image', ] -/** @type {import('.').AssetSource[]} */ +/** @type {import('./index.d.ts').AssetSource[]} */ export const DEFAULT_SOURCES = [ { tag: 'audio', diff --git a/src/index.js b/src/index.js index 5f5c506..637f6c2 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ import { IGNORE_FLAG, } from './constants.js' -/** @type {import('.').importAssets} */ +/** @type {import('./index.d.ts').importAssets} */ export function importAssets(options = {}) { let { sources = DEFAULT_SOURCES, @@ -16,7 +16,7 @@ export function importAssets(options = {}) { urlFilter, } = options - /** @type {import('.').AssetSource[]} */ + /** @type {import('./index.d.ts').AssetSource[]} */ let resolvedSources let hasCustomSources = false @@ -108,7 +108,7 @@ export function importAssets(options = {}) { } for (let i = 0; i < resolvedSources.length; i++) { - /** @type {import('.').AssetSource} */ + /** @type {import('./index.d.ts').AssetSource} */ const source = resolvedSources[i] // Compare node tag match diff --git a/tsconfig.json b/tsconfig.json index 59972af..4f93707 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,10 @@ { "compilerOptions": { "allowSyntheticDefaultImports": true, + "allowJs": true, "checkJs": true, - "module": "ESNext", - "moduleResolution": "node", + "module": "Node16", + "moduleResolution": "Node16", "noEmit": true, "skipLibCheck": true, "strict": true,