From ac308e0f899c92172e5dea54db228535b66cbd60 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Tue, 10 Sep 2024 15:14:45 +0800 Subject: [PATCH] feat: Allow `import('$:/core/modules/...')` instead of `import('../../core/modules/...')`. Only works inside this project. --- core/modules/parsers/wikiparser/rules/codeblock.js | 4 +--- core/modules/parsers/wikiparser/try.js | 2 +- tsconfig.json | 7 ++++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/modules/parsers/wikiparser/rules/codeblock.js b/core/modules/parsers/wikiparser/rules/codeblock.js index 74b67e751..507ca424f 100644 --- a/core/modules/parsers/wikiparser/rules/codeblock.js +++ b/core/modules/parsers/wikiparser/rules/codeblock.js @@ -1,4 +1,4 @@ -/** +/*\ title: $:/core/modules/parsers/wikiparser/rules/codeblock.js type: application/javascript module-type: wikirule @@ -11,8 +11,6 @@ Wiki text rule for code blocks. For example: ``` ``` -@module $:/core/modules/parsers/wikiparser/rules/codeblock.js - \*/ /** diff --git a/core/modules/parsers/wikiparser/try.js b/core/modules/parsers/wikiparser/try.js index 459c7b074..535cc9598 100644 --- a/core/modules/parsers/wikiparser/try.js +++ b/core/modules/parsers/wikiparser/try.js @@ -1,5 +1,5 @@ /** - * @typedef {import('./rules/codeblock').CodeblockNode} CodeblockNode + * @typedef {import('$:/core/modules/parsers/wikiparser/rules/codeblock.js').CodeblockNode} CodeblockNode */ /** diff --git a/tsconfig.json b/tsconfig.json index 852b30491..378247231 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "paths": { // Add paths + "paths": { + // Allow `import('$:/core/modules/...')` instead of `import('../../core/modules/...')`. Only works inside this project. "$:/core/*": ["./core/*"] }, "noImplicitAny": false, @@ -12,10 +13,10 @@ "declaration": true, "declarationDir": "types", "declarationMap": true, - "emitDeclarationOnly": false, + "emitDeclarationOnly": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "Node16", - "outDir": "silences wrong TS error, we don't compile, we only typecheck", + "outDir": "types", "rootDir": "core", "skipLibCheck": true, "target": "ESNext"