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

Convert Node scripts to module scripts #1507

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

robertknight
Copy link
Member

This reduces the need for variation in eg. linting rules by making all JS files modules where possible. Note that Karma does not support this. See karma-runner/karma#3677.

@robertknight robertknight requested a review from acelaya April 15, 2024 11:01
@@ -5,10 +5,11 @@
* file and the package environment.
*/

'use strict';
import * as fs from 'node:fs';
import * as path from 'node:path';
Copy link
Member Author

Choose a reason for hiding this comment

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

While writing this I realized we didn't have a convention about whether to use the node: prefix or not and whether it was considered preferred practice. nodejs/node#38343 suggests that using the prefix for built-in modules is preferred.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the prefix makes sense.

This reduces the need for variation in eg. linting rules by making all JS files
modules where possible. Note that Karma does not support this. See
karma-runner/karma#3677.
@@ -5,10 +5,11 @@
* file and the package environment.
*/

'use strict';
import * as fs from 'node:fs';
import * as path from 'node:path';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the prefix makes sense.

@robertknight robertknight merged commit 8e6edc9 into main Apr 15, 2024
2 checks passed
@robertknight robertknight deleted the use-module-scripts branch April 15, 2024 12:48
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.

2 participants