diff --git a/md/ts-jsdoc.md b/md/ts-jsdoc.md index 58ee899cf..ff7a76a8a 100644 --- a/md/ts-jsdoc.md +++ b/md/ts-jsdoc.md @@ -176,7 +176,7 @@ export type IntersectionType = Type1 & Type2 ```js // index.js -/** @type { import('./types').IntersectionType } */ +/** @type { import("./types.js").IntersectionType } */ const list ``` You can also organise your source types in the same way as [vendored types](#vendor-type-declarations). @@ -231,7 +231,7 @@ const fs = require('fs') * @typedef {import("interface-datastore/src/types").Batch} Batch * @typedef {import('interface-datastore/src/key')} Key * @typedef {import('interface-datastore/src/adapter').Query} Query - * @typedef {import('./types').KeyTransform} KeyTransform + * @typedef {import("./types.js").KeyTransform} KeyTransform */ ``` diff --git a/src/build/index.js b/src/build/index.js index 54537dfbb..c3837380e 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -15,8 +15,8 @@ const defaults = merge.bind({ }) /** - * @typedef {import("../types").GlobalOptions} GlobalOptions - * @typedef {import("../types").BuildOptions} BuildOptions + * @typedef {import("../types.js").GlobalOptions} GlobalOptions + * @typedef {import("../types.js").BuildOptions} BuildOptions * @typedef {import("listr").ListrTaskWrapper} Task */ diff --git a/src/clean.js b/src/clean.js index b51ce65c2..e251d81a1 100644 --- a/src/clean.js +++ b/src/clean.js @@ -4,7 +4,7 @@ import Listr from 'listr' import { rimraf } from 'rimraf' /** - * @typedef {import("./types").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions */ export default new Listr([ diff --git a/src/config/tsconfig.aegir.json b/src/config/tsconfig.aegir.json index 7b6dc9e06..2554ec5ea 100644 --- a/src/config/tsconfig.aegir.json +++ b/src/config/tsconfig.aegir.json @@ -6,7 +6,7 @@ "allowJs": true, "checkJs": true, "target": "ES2022", - "module": "ES2022", + "module": "Node16", "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/src/config/user.js b/src/config/user.js index 0f8d0cc83..0957e2e4d 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -6,7 +6,7 @@ import merge from '../utils/merge-options.js' import { isTypescript } from '../utils.js' /** - * @typedef {import("./../types").Options} Options + * @typedef {import("../types.js").Options} Options */ /** @type {Omit} */ diff --git a/src/dependency-check.js b/src/dependency-check.js index b0316e09d..c98a9aff7 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -20,8 +20,8 @@ const ignoredDevDependencies = [ /** * @typedef {import("listr").ListrTaskWrapper} Task - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").DependencyCheckOptions} DependencyCheckOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").DependencyCheckOptions} DependencyCheckOptions */ const tasks = new Listr( diff --git a/src/docs.js b/src/docs.js index e7b8caa75..c3c97d1d1 100644 --- a/src/docs.js +++ b/src/docs.js @@ -12,8 +12,8 @@ const publishPages = promisify(ghPages.publish) const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").DocsOptions} DocsOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").DocsOptions} DocsOptions * @typedef {import("listr").ListrTaskWrapper} Task */ diff --git a/src/docs/type-indexer-plugin.js b/src/docs/type-indexer-plugin.js index 7bf88fe4d..07247d5a9 100644 --- a/src/docs/type-indexer-plugin.js +++ b/src/docs/type-indexer-plugin.js @@ -51,7 +51,7 @@ export function load (app) { } /** - * @param {import("typedoc/dist/lib/output/events").RendererEvent} event + * @param {import("typedoc").RendererEvent} event */ const onRendererBegin = event => { if (!event.urls) { @@ -228,7 +228,7 @@ function onResolve (context, decl) { * For a given UrlMapping, find the nearest package.json file * and work out if a `typedoc-urls.json` should be generated. * - * @param {import("typedoc/dist/lib/models/sources/file").SourceReference} source + * @param {import("typedoc").SourceReference} source * @param {boolean} isMonorepo * @returns {ProjectContext} */ @@ -262,7 +262,7 @@ function findContext (source, isMonorepo) { } /** - * @param {import("typedoc/dist/lib/application").Application} Application + * @param {import("typedoc").Application} Application * @param {ProjectContext} context * @returns {Documentation | undefined} */ diff --git a/src/docs/unknown-symbol-resolver-plugin.js b/src/docs/unknown-symbol-resolver-plugin.js index 47411d460..8c15e2b12 100644 --- a/src/docs/unknown-symbol-resolver-plugin.js +++ b/src/docs/unknown-symbol-resolver-plugin.js @@ -41,7 +41,7 @@ const ignoreModules = [ * `typedoc-urls.json` files from the `dist` folder of types that need * documenting. See `type-indexer-plugin.cjs` for how this file is generated. * - * @param {import("typedoc/dist/lib/application").Application} app + * @param {import("typedoc").Application} app */ export function load (app) { app.converter.addUnknownSymbolResolver((ref, refl, part, symbolId) => { @@ -122,7 +122,7 @@ function loadTypedocUrls (moduleName) { } /** - * @param {import("typedoc/dist/lib/converter/comments/declarationReference").ComponentPath[] | undefined} refs + * @param {import("typedoc").ComponentPath[] | undefined} refs */ function calculateName (refs) { if (refs == null || refs.length === 0) { diff --git a/src/document-check.js b/src/document-check.js index 1885f8acd..35db9edc4 100644 --- a/src/document-check.js +++ b/src/document-check.js @@ -8,8 +8,8 @@ import { compileSnippets } from 'typescript-docs-verifier' import merge from './utils/merge-options.js' import { formatCode, formatError, fromRoot, hasTsconfig, readJson } from './utils.js' /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").DocsVerifierOptions} DocsVerifierOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").DocsVerifierOptions} DocsVerifierOptions * @typedef {import("listr").ListrTaskWrapper} Task */ @@ -51,8 +51,8 @@ const tasks = new Listr( userTSConfig, { compilerOptions: { - target: 'esnext', - module: 'esnext', + target: 'ES2022', + module: 'Node16', noImplicitAny: true, noEmit: true } diff --git a/src/exec.js b/src/exec.js index e785143ff..a0ad2ef5f 100644 --- a/src/exec.js +++ b/src/exec.js @@ -3,8 +3,8 @@ import kleur from 'kleur' import { everyMonorepoProject, pipeOutput } from './utils.js' /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").ExecOptions} ExecOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").ExecOptions} ExecOptions */ export default { diff --git a/src/index.js b/src/index.js index b576a25e5..372f5a8ab 100755 --- a/src/index.js +++ b/src/index.js @@ -23,16 +23,16 @@ import testCmd from './cmds/test.js' import { loadUserConfig } from './config/user.js' /** - * @typedef {import('./types').BuildOptions} BuildOptions - * @typedef {import('./types').DependencyCheckOptions} DependencyCheckOptions - * @typedef {import('./types').DocsOptions} DocsOptions - * @typedef {import('./types').GlobalOptions} GlobalOptions - * @typedef {import('./types').LintOptions} LintOptions - * @typedef {import('./types').Options} Options - * @typedef {import('./types').PartialOptions} PartialOptions - * @typedef {import('./types').ReleaseOptions} ReleaseOptions - * @typedef {import('./types').TSOptions} TSOptions - * @typedef {import('./types').TestOptions} TestOptions + * @typedef {import("./types.js").BuildOptions} BuildOptions + * @typedef {import("./types.js").DependencyCheckOptions} DependencyCheckOptions + * @typedef {import("./types.js").DocsOptions} DocsOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").LintOptions} LintOptions + * @typedef {import("./types.js").Options} Options + * @typedef {import("./types.js").PartialOptions} PartialOptions + * @typedef {import("./types.js").ReleaseOptions} ReleaseOptions + * @typedef {import("./types.js").TSOptions} TSOptions + * @typedef {import("./types.js").TestOptions} TestOptions */ process.on('unhandledRejection', (err) => { diff --git a/src/lint.js b/src/lint.js index f873ab283..dc878ac88 100644 --- a/src/lint.js +++ b/src/lint.js @@ -14,10 +14,10 @@ import { fromRoot, readJson, hasTsconfig, isTypescript, findBinary, hasDocCheck const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").LintOptions} LintOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").LintOptions} LintOptions * @typedef {import("listr").ListrTaskWrapper} Task - * @typedef {import("./types").TSOptions} TSOptions + * @typedef {import("./types.js").TSOptions} TSOptions */ const tasks = new Listr( diff --git a/src/release-rc.js b/src/release-rc.js index cfb39aafe..5534d5e59 100644 --- a/src/release-rc.js +++ b/src/release-rc.js @@ -8,8 +8,8 @@ import retry from 'p-retry' import { isMonorepoParent, pkg, everyMonorepoProject, pipeOutput } from './utils.js' /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").ReleaseRcOptions} ReleaseRcOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").ReleaseRcOptions} ReleaseRcOptions * @typedef {import("listr").ListrTaskWrapper} Task */ diff --git a/src/release.js b/src/release.js index 1f8764db6..183a9ca38 100644 --- a/src/release.js +++ b/src/release.js @@ -8,8 +8,8 @@ import { calculateSiblingVersion } from './check-project/utils.js' import { isMonorepoProject, hasDocs, glob } from './utils.js' /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").ReleaseOptions} ReleaseOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").ReleaseOptions} ReleaseOptions * @typedef {import("listr").ListrTaskWrapper} Task */ diff --git a/src/run.js b/src/run.js index b39462e68..cd34acd88 100644 --- a/src/run.js +++ b/src/run.js @@ -3,8 +3,8 @@ import kleur from 'kleur' import { everyMonorepoProject, pipeOutput } from './utils.js' /** - * @typedef {import("./types").GlobalOptions} GlobalOptions - * @typedef {import("./types").RunOptions} RunOptions + * @typedef {import("./types.js").GlobalOptions} GlobalOptions + * @typedef {import("./types.js").RunOptions} RunOptions */ export default { diff --git a/src/test/browser.js b/src/test/browser.js index 9302c124f..ee3fd9c48 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -8,8 +8,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** * @typedef {import("execa").Options} ExecaOptions - * @typedef {import('./../types').TestOptions} TestOptions - * @typedef {import('./../types').GlobalOptions} GlobalOptions + * @typedef {import("../types.js").TestOptions} TestOptions + * @typedef {import("../types.js").GlobalOptions} GlobalOptions */ /** diff --git a/src/test/electron.js b/src/test/electron.js index 341805730..1dc6335de 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -8,8 +8,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** * @typedef {import("execa").Options} ExecaOptions - * @typedef {import('./../types').TestOptions} TestOptions - * @typedef {import('./../types').GlobalOptions} GlobalOptions + * @typedef {import("../types.js").TestOptions} TestOptions + * @typedef {import("../types.js").GlobalOptions} GlobalOptions */ /** diff --git a/src/test/index.js b/src/test/index.js index 12760dca1..cb7c81c32 100644 --- a/src/test/index.js +++ b/src/test/index.js @@ -7,9 +7,9 @@ import rn from './react-native.js' /** * @typedef {import("execa").Options} ExecaOptions - * @typedef {import('./../types').TestOptions} TestOptions - * @typedef {import('./../types').GlobalOptions} GlobalOptions - * @typedef {import('./../types').BuildOptions} BuildOptions + * @typedef {import("../types.js").TestOptions} TestOptions + * @typedef {import("../types.js").GlobalOptions} GlobalOptions + * @typedef {import("../types.js").BuildOptions} BuildOptions */ const TASKS = [ diff --git a/src/test/node.js b/src/test/node.js index 378ec859f..8771c1ea9 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -10,8 +10,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** * @typedef {import("execa").Options} ExecaOptions - * @typedef {import('./../types').TestOptions} TestOptions - * @typedef {import('./../types').GlobalOptions} GlobalOptions + * @typedef {import("../types.js").TestOptions} TestOptions + * @typedef {import("../types.js").GlobalOptions} GlobalOptions */ /** diff --git a/src/test/react-native.js b/src/test/react-native.js index 7799ac8b7..7b99db967 100644 --- a/src/test/react-native.js +++ b/src/test/react-native.js @@ -7,8 +7,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** * @typedef {import("execa").Options} ExecaOptions - * @typedef {import('../types').TestOptions} TestOptions - * @typedef {import('../types').GlobalOptions} GlobalOptions + * @typedef {import("../types.js").TestOptions} TestOptions + * @typedef {import("../types.js").GlobalOptions} GlobalOptions */ /** diff --git a/test/fixtures/js+ts/package.json b/test/fixtures/js+ts/package.json index 71126e8a9..7c61287f9 100644 --- a/test/fixtures/js+ts/package.json +++ b/test/fixtures/js+ts/package.json @@ -1,3 +1,4 @@ { - "name": "my-project" + "name": "my-project", + "type": "module" } \ No newline at end of file diff --git a/test/fixtures/js+ts/src/another.ts b/test/fixtures/js+ts/src/another.ts index ac4b30ee6..37a13e76b 100644 --- a/test/fixtures/js+ts/src/another.ts +++ b/test/fixtures/js+ts/src/another.ts @@ -1,4 +1,4 @@ -import { hello } from './typed' +import { hello } from './typed.js' export const main = (): void => { hello('world') diff --git a/test/fixtures/js+ts/tsconfig.json b/test/fixtures/js+ts/tsconfig.json index ac19351e4..c148a7f5a 100644 --- a/test/fixtures/js+ts/tsconfig.json +++ b/test/fixtures/js+ts/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": false, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-large-monorepo/packages/a/src/index.js b/test/fixtures/projects/a-large-monorepo/packages/a/src/index.js index 58dc564eb..54a0af280 100644 --- a/test/fixtures/projects/a-large-monorepo/packages/a/src/index.js +++ b/test/fixtures/projects/a-large-monorepo/packages/a/src/index.js @@ -1,5 +1,5 @@ /** - * @typedef {import('./types').ExportedButNotInExports} ExportedButNotInExports + * @typedef {import("./types.js").ExportedButNotInExports} ExportedButNotInExports */ /** diff --git a/test/fixtures/projects/a-large-monorepo/packages/a/tsconfig.json b/test/fixtures/projects/a-large-monorepo/packages/a/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/a-large-monorepo/packages/a/tsconfig.json +++ b/test/fixtures/projects/a-large-monorepo/packages/a/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-large-monorepo/packages/b/tsconfig.json b/test/fixtures/projects/a-large-monorepo/packages/b/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/a-large-monorepo/packages/b/tsconfig.json +++ b/test/fixtures/projects/a-large-monorepo/packages/b/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-large-monorepo/packages/c/tsconfig.json b/test/fixtures/projects/a-large-monorepo/packages/c/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/a-large-monorepo/packages/c/tsconfig.json +++ b/test/fixtures/projects/a-large-monorepo/packages/c/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-large-monorepo/packages/d/tsconfig.json b/test/fixtures/projects/a-large-monorepo/packages/d/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/a-large-monorepo/packages/d/tsconfig.json +++ b/test/fixtures/projects/a-large-monorepo/packages/d/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-monorepo/packages/a-workspace-project/src/index.js b/test/fixtures/projects/a-monorepo/packages/a-workspace-project/src/index.js index 58dc564eb..54a0af280 100644 --- a/test/fixtures/projects/a-monorepo/packages/a-workspace-project/src/index.js +++ b/test/fixtures/projects/a-monorepo/packages/a-workspace-project/src/index.js @@ -1,5 +1,5 @@ /** - * @typedef {import('./types').ExportedButNotInExports} ExportedButNotInExports + * @typedef {import("./types.js").ExportedButNotInExports} ExportedButNotInExports */ /** diff --git a/test/fixtures/projects/a-monorepo/packages/a-workspace-project/tsconfig.json b/test/fixtures/projects/a-monorepo/packages/a-workspace-project/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/a-monorepo/packages/a-workspace-project/tsconfig.json +++ b/test/fixtures/projects/a-monorepo/packages/a-workspace-project/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-monorepo/packages/another-workspace-project/src/index.js b/test/fixtures/projects/a-monorepo/packages/another-workspace-project/src/index.js index 7147f8a99..a0753ecd8 100644 --- a/test/fixtures/projects/a-monorepo/packages/another-workspace-project/src/index.js +++ b/test/fixtures/projects/a-monorepo/packages/another-workspace-project/src/index.js @@ -1,5 +1,5 @@ /** - * @typedef {import('./types').ExportedButNotInExports} ExportedButNotInExports + * @typedef {import("./types.js").ExportedButNotInExports} ExportedButNotInExports */ /** diff --git a/test/fixtures/projects/a-monorepo/packages/another-workspace-project/tsconfig.json b/test/fixtures/projects/a-monorepo/packages/another-workspace-project/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/a-monorepo/packages/another-workspace-project/tsconfig.json +++ b/test/fixtures/projects/a-monorepo/packages/another-workspace-project/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/package.json b/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/package.json index e86e01db8..75a007e9a 100644 --- a/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/package.json +++ b/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "", "main": "src/index.js", - "types": "src", + "types": "src/index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/src/index.d.ts b/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/src/index.d.ts index 41469fac9..b98533c3d 100644 --- a/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/src/index.d.ts +++ b/test/fixtures/projects/a-ts-project/node_modules/a-cjs-dep/src/index.d.ts @@ -1,2 +1,2 @@ - -export default function herp(): void +declare function _exports(): void; +export = _exports; diff --git a/test/fixtures/projects/a-ts-project/node_modules/an-esm-dep/package.json b/test/fixtures/projects/a-ts-project/node_modules/an-esm-dep/package.json index 3c14ad382..348c2c6b2 100644 --- a/test/fixtures/projects/a-ts-project/node_modules/an-esm-dep/package.json +++ b/test/fixtures/projects/a-ts-project/node_modules/an-esm-dep/package.json @@ -3,7 +3,6 @@ "version": "1.0.0", "description": "", "type": "module", - "types": "src", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -11,6 +10,7 @@ "license": "ISC", "exports": { ".": { + "types": "./src/index.d.ts", "import": "./src/index.js", "require": "./src/index.cjs" } diff --git a/test/fixtures/projects/a-ts-project/package.json b/test/fixtures/projects/a-ts-project/package.json index 818f516a0..d42a90996 100644 --- a/test/fixtures/projects/a-ts-project/package.json +++ b/test/fixtures/projects/a-ts-project/package.json @@ -5,6 +5,7 @@ "homepage": "https://github.com/ipfs/aegir#readme", "exports": { ".": { + "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" } }, diff --git a/test/fixtures/projects/a-ts-project/tsconfig.json b/test/fixtures/projects/a-ts-project/tsconfig.json index ac19351e4..c148a7f5a 100644 --- a/test/fixtures/projects/a-ts-project/tsconfig.json +++ b/test/fixtures/projects/a-ts-project/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": false, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true, diff --git a/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/package.json b/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/package.json index e86e01db8..75a007e9a 100644 --- a/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/package.json +++ b/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "", "main": "src/index.js", - "types": "src", + "types": "src/index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/src/index.d.ts b/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/src/index.d.ts index 41469fac9..b98533c3d 100644 --- a/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/src/index.d.ts +++ b/test/fixtures/projects/an-esm-project/node_modules/a-cjs-dep/src/index.d.ts @@ -1,2 +1,2 @@ - -export default function herp(): void +declare function _exports(): void; +export = _exports; diff --git a/test/fixtures/projects/an-esm-project/node_modules/an-esm-dep/package.json b/test/fixtures/projects/an-esm-project/node_modules/an-esm-dep/package.json index 3c14ad382..348c2c6b2 100644 --- a/test/fixtures/projects/an-esm-project/node_modules/an-esm-dep/package.json +++ b/test/fixtures/projects/an-esm-project/node_modules/an-esm-dep/package.json @@ -3,7 +3,6 @@ "version": "1.0.0", "description": "", "type": "module", - "types": "src", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -11,6 +10,7 @@ "license": "ISC", "exports": { ".": { + "types": "./src/index.d.ts", "import": "./src/index.js", "require": "./src/index.cjs" } diff --git a/test/fixtures/projects/an-esm-project/src/index.js b/test/fixtures/projects/an-esm-project/src/index.js index b25f813e3..a0536765d 100644 --- a/test/fixtures/projects/an-esm-project/src/index.js +++ b/test/fixtures/projects/an-esm-project/src/index.js @@ -4,7 +4,7 @@ import derp from 'an-esm-dep' export { garply } from './dir/index.js' /** - * @typedef {import('./types').ExportedButNotInExports} ExportedButNotInExports + * @typedef {import('./types.js').ExportedButNotInExports} ExportedButNotInExports */ /** @@ -21,7 +21,7 @@ export const useDerp = () => { } /** - * @type {import('./types').UsedButNotExported} + * @type {import('./types.js').UsedButNotExported} */ export const usesInternalType = { aMethod: function () { diff --git a/test/fixtures/projects/an-esm-project/tsconfig.json b/test/fixtures/projects/an-esm-project/tsconfig.json index 6ddff411a..6aed773b6 100644 --- a/test/fixtures/projects/an-esm-project/tsconfig.json +++ b/test/fixtures/projects/an-esm-project/tsconfig.json @@ -5,9 +5,9 @@ "outDir": "dist", "allowJs": true, "checkJs": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"], + "target": "ES2022", + "module": "Node16", + "lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"], "noEmit": false, "noEmitOnError": true, "emitDeclarationOnly": true, @@ -20,7 +20,7 @@ "sourceMap": true, // module resolution "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node16", // linter checks "noImplicitReturns": false, "noFallthroughCasesInSwitch": true,