Skip to content

Sync with TypeScript-Website @ 910dec9d #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: v2
Choose a base branch
from
Open

Conversation

SyncDocsBot
Copy link
Contributor

合并自 https://github.com/microsoft/TypeScript-Website.git @ 910dec9
下面的文件存在冲突,请处理后合并:

不要 Squash 此 Pull Request!!!

dependabot bot and others added 6 commits March 24, 2025 21:34
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ns group (#3366)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…up (#3369)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link

vercel bot commented Apr 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ts-zh-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2025 1:29am

Copy link
Contributor

Got false positives?

Make changes to the global settings spellcheck.json in /microsoft/TypeScript-Website.

Make changes to this repo's settings in spellcheck.json.

Typos for Theory.md

Line Typo
30 browsers and in Node.js since v12. It uses dedicated import a
60 nded runtime environment—what globals are available, for example. W
60 all the information needed to analyze it:
75 "greetings" module has been analyzed, what piece of that module is
79 ike CommonJS. So runtimes and bundlers, especially those that want t
81 les. Today, some runtimes and bundlers support loading TypeScript fi
81 TypeScript-first runtimes and bundlers](#module-resolution-for-bundl
97 modules in a web browser, the behaviors TypeScript needs to model are
97 module-loading framework like RequireJS) controls what module formats
102 he browser, or CJS in Node.js v11 and earlier, for example. Nod
102 earlier, for example. Node.js v12 and later accepts both CJS an
108 the module system of Node.js v16+, which supports ES modules a
109 the module system of Node.js v18+, which adds support for impo
117 the emitted JavaScript for an all-ESM Node.js project might look id
167 y 2017, and landed in Node.js v12 in 2019. During much of this
167 aging the use of the original CommonJS-inspired import fs = require("fs") s
171 es differ between Node.js and bundlers. Consequently, the configurat
175 JS, it must be written in the CommonJS-inspired TypeScript syntax (`import fs
179 t specification, so runtimes, bundlers, and transpilers have been fr
179 ist. Today, most runtimes and bundlers broadly fall into one of thre
181 1. ESM-only. Some runtimes, like browse
182 em to CommonJS. The way these ESM-transpiled-to-CJS files interacted with hand-wr
182 -to-CJS files interacted with hand-written-CJS files implied a set of permis
182 ome the de facto standard for bundlers and transpilers.
183 3. Node.js. Until Node.js v22.12.0, Com
183 3. Node.js. Until Node.js v22.12.0, CommonJS modules could not l
183 ntly between Node.js and some bundlers.)
187 [^1]: In Node.js v22.12.0 and later, a require of an
243 solution for a wide range of [RequireJS](https://requirejs.org/docs/a
243 n old projects that don’t use RequireJS or another AMD module loader)
244 f Node.js versions older than v12, and sometimes it’s a passabl
244 ble approximation of how most bundlers do module resolution. It supp
244 e specifiers. Because Node.js v12 introduced different module r
244 d model of modern versions of Node.js. It should not be used for new
245 hat module setting. Node.js v12 and later support both ESM an
247 erence.html#bundler): Node.js v12 introduced some new module re
247 ds of package.json—and many bundlers adopted those features withou
299 think in terms of shortcuts: _"./math.mjs" refers to the i
299 or .mts when I write .mjs._ This shortcut is even how the
321 The last row expresses that non-JS files can be typed with the `
321 ule system supports importing non-JS files as JavaScript objects.
325 ### Module resolution for bundlers, TypeScript runtimes, and Nod
341 ut JS file. But what if there is no output JS file? What if yo
344 in a TypeScript runtime like Deno or Bun.
349 e module resolution host. For bundlers and the Bun runtime, it’s `bu
372 orks both in Node.js and in bundlers.
374 owing code that only works in bundlers to be produced. Likewise, `"m
374 work in other runtimes and in bundlers.

Typos for Reference.md

Line Typo
14 ed in TypeScript files and/or JSDoc comments.
18 Type aliases, interfaces, enums, and namespaces can be export
105 This is especially useful in JSDoc comments in JavaScript files,
116 Script files can use a direct analog of module.exports = ... and
208 re intended to run in Node.js v12 or later, whether they use ES
210 the latest stable versions of Node.js. The following table summarize
212 JSON imports
214
215
224 pe": "module"` to the project package.json.
233 flect the behavior of Node.js v22.12.0 and later, require can refe
281 re intended to run in Node.js v12 or later, whether they use ES
289 preserved in the output, and CommonJS-style import x = require("...") a
291 e capabilities of most modern bundlers, as well as the Bun runtime.
328 moduleResolution bundler` for bundlers, Bun, and tsx.
329 - Do not use for Node.js. Use node16, node18, or `n
329 e.json to emit ES modules for Node.js.
364 to emit CommonJS modules for Node.js.
425 - Designed for use with the [SystemJS module loader](https://github
467 Designed for AMD loaders like RequireJS.
554 n file with the same name and analagous file extension.
600 even though some runtimes and bundlers do.
624 browser before ESM existed or bundlers were widely used), it still h
642 so common for apps built with bundlers to define convenience path al
679 # paths should not point to monorepo packages or node_modules pack
679 point to monorepo packages or node_modules packages
696 s referencing each other in a monorepo. Instead of using paths to
696 com/en/docs/workspaces/), or [pnpm](https://pnpm.io/workspaces)
696 s especially important if the monorepo packages will be published to
734 ##### Fallbacks
760 node_modules` subdirectories. Bundlers conveniently adopted this beh
760 ependencies, as they would in Node.js. All of TypeScript’s `moduleRe
781 e of "exports" prevents any subpaths not explicitly listed or matc
783 ##### Example: subpaths, conditions, and extension su
879 ##### Example: subpath patterns
907 mple: "exports" block other subpaths
923 package root? No, it has a subpath dist/index.js.
926 orts"` prevents resolving any subpaths that cannot be matched throug
930 s` packages, according to the subpath being resolved. This allows p
930 ersions (through a tool like [downlevel-dts](https://github.com/sandersn/
954 4. Are we resolving a subpath after the package name? **No,
981 4. Are we resolving a subpath after the package name? **No,
989 ule specifier does not have a subpath after the package name or pac
1001 agejson-typesversions) apply, subpaths of a bare package specifier r
1014 the "exports" field of that package.json. Both of these features allow
1067 node_modules` dependency with subpath pattern
1102 esolution behavior of Node.js v12 and later. (node16 and `nod
1106 d compatibility with existing CommonJS-format type declarations):
1145 ior common to most JavaScript bundlers. In short, this means support
1145 this means supporting all the behaviors traditionally associated with
1158 n combination with --noEmitbundlers typically process raw .ts f
1187 Node.js versions earlier than v12. It should no longer be used.

Generated by 🚫 dangerJS against 910dec9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants