Skip to content
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

docs(commonjs): Fix declaration tag @default for ignoreTryCatch + fix some typos #1370

Merged
merged 1 commit into from Dec 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions packages/commonjs/types/index.d.ts
Expand Up @@ -109,17 +109,17 @@ interface RollupCommonJSOptions {
* they should be left unconverted as it requires an optional dependency
* that may or may not be installed beside the rolled up package.
* Due to the conversion of `require` to a static `import` - the call is
* hoisted to the top of the file, outside of the `try-catch` clause.
* hoisted to the top of the file, outside the `try-catch` clause.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really a typo but, sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is picked up by Webstorm's LanguageTool and as such was underlined as a typo

*
* - `true`: All `require` calls inside a `try` will be left unconverted.
* - `true`: Default. All `require` calls inside a `try` will be left unconverted.
* - `false`: All `require` calls inside a `try` will be converted as if the
* `try-catch` clause is not there.
* - `remove`: Remove all `require` calls from inside any `try` block.
* - `string[]`: Pass an array containing the IDs to left unconverted.
* - `((id: string) => boolean|'remove')`: Pass a function that control
* - `((id: string) => boolean|'remove')`: Pass a function that controls
* individual IDs.
*
* @default false
* @default true
*/
ignoreTryCatch?:
| boolean
Expand All @@ -133,14 +133,14 @@ interface RollupCommonJSOptions {
* NodeJS where ES modules can only import a default export from a CommonJS
* dependency.
*
* If you set `esmExternals` to `true`, this plugins assumes that all
* If you set `esmExternals` to `true`, this plugin assumes that all
* external dependencies are ES modules and respect the
* `requireReturnsDefault` option. If that option is not set, they will be
* rendered as namespace imports.
*
* You can also supply an array of ids to be treated as ES modules, or a
* function that will be passed each external id to determine if it is an ES
* module.
* function that will be passed each external id to determine whether it is
* an ES module.
* @default false
*/
esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
Expand All @@ -158,7 +158,7 @@ interface RollupCommonJSOptions {
* import * as foo from 'foo';
* ```
*
* However there are some situations where this may not be desired.
* However, there are some situations where this may not be desired.
* For these situations, you can change Rollup's behaviour either globally or
* per module. To change it globally, set the `requireReturnsDefault` option
* to one of the following values:
Expand Down Expand Up @@ -208,7 +208,7 @@ interface RollupCommonJSOptions {
* Some modules contain dynamic `require` calls, or require modules that
* contain circular dependencies, which are not handled well by static
* imports. Including those modules as `dynamicRequireTargets` will simulate a
* CommonJS (NodeJS-like) environment for them with support for dynamic
* CommonJS (NodeJS-like) environment for them with support for dynamic
* dependencies. It also enables `strictRequires` for those modules.
*
* Note: In extreme cases, this feature may result in some paths being
Expand All @@ -222,7 +222,7 @@ interface RollupCommonJSOptions {
* To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
* that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
* may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
* home directory name. By default it uses the current working directory.
* home directory name. By default, it uses the current working directory.
*/
dynamicRequireRoot?: string;
}
Expand Down