-
-
Notifications
You must be signed in to change notification settings - Fork 196
refactor: migrate worker.js
to worker.mjs
#736
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
Conversation
🦋 Changeset detectedLatest commit: 99bac6f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe changes transition the worker script for Prettier formatting from a CommonJS module ( Changes
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 4e8ef1f in 1 minute and 5 seconds. Click for details.
- Reviewed
42
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
7
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. eslint-plugin-prettier.js:175
- Draft comment:
Updated worker file reference to 'worker.mjs'. Ensure that synckit supports resolving ESM modules with require.resolve in your Node versions. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. package.json:35
- Draft comment:
Replaced 'worker.js' with 'worker.mjs' in files. This update looks correct. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
3. worker.mjs:14
- Draft comment:
Properly using ESM import for 'synckit'; code looks fine. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
4. eslint-plugin-prettier.js:175
- Draft comment:
Ensure that require.resolve('./worker.mjs') works in a CommonJS context across supported Node versions. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
5. package.json:35
- Draft comment:
The worker file reference has been updated to 'worker.mjs'. Make sure related docs/scripts are also updated. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
6. worker.mjs:42
- Draft comment:
Dynamic import of 'prettier' is used here; verify that the returned module exposes the expected named exports (e.g., format, resolveConfig) without needing destructuring. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. worker.mjs:112
- Draft comment:
Typographical issue: In the 'graphql' case, the string passed to startsWith is 'ESLintPluginGraphQLFile`' with a stray backtick at the end. Likely, this should be corrected to 'ESLintPluginGraphQLFile' (remove the trailing backtick) to avoid potential confusion. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_mYaZdH81y3yM6tWs
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the worker file from CommonJS (.js) to ES module (.mjs) and updates the import/export syntax accordingly.
- Updated worker.mjs to use ES module import syntax instead of CommonJS require.
- Modified eslint-plugin-prettier.js to reference the newly named worker.mjs.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
worker.mjs | Changed require to import for ES module compatibility. |
eslint-plugin-prettier.js | Updated worker file reference from worker.js to worker.mjs. |
Files not reviewed (1)
- package.json: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yashtech00 Thanks for your contribution first!
We can also migrate the following statement:
prettier = await import('prettier');
into:
import prettier from 'prettier';
And the related jsdoc can be removed then.
I've pushed the requested changes. Please review. 🙌 |
worker.js
to worker.mjs
Thanks @yashtech00. Please remember to use GitHub keywords like |
worker.js
to worker.mjs
worker.js
to worker.mjs
Co-authored-by: JounQin <admin@1stg.me>
| datasource | package | from | to | | ---------- | ---------------------- | ----- | ----- | | npm | eslint-plugin-prettier | 5.2.3 | 5.4.0 | ## [v5.4.0](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#540) ##### Minor Changes - [#736](prettier/eslint-plugin-prettier#736) [`59a0cae`](prettier/eslint-plugin-prettier@59a0cae) Thanks [@yashtech00](https://github.com/yashtech00)! - refactor: migrate `worker.js` to `worker.mjs` ## [v5.3.1](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#531) ##### Patch Changes - [#734](prettier/eslint-plugin-prettier#734) [`dcf2c80`](prettier/eslint-plugin-prettier@dcf2c80) Thanks [@JounQin](https://github.com/JounQin)! - ci: enable `NPM_CONFIG_PROVENANCE` env ## [v5.3.0](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#530) ##### Minor Changes - [#674](prettier/eslint-plugin-prettier#674) [`6fe0c90`](prettier/eslint-plugin-prettier@6fe0c90) Thanks [@irsooti](https://github.com/irsooti)! - feat(types): prefer `Config` over `FlatConfig` when they're equal ## [v5.2.6](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#526) ##### Patch Changes - [#723](prettier/eslint-plugin-prettier#723) [`1451176`](prettier/eslint-plugin-prettier@1451176) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): bump `synckit` to `v0.11.0` ## [v5.2.5](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#525) ##### Patch Changes - [#721](prettier/eslint-plugin-prettier#721) [`4f5513d`](prettier/eslint-plugin-prettier@4f5513d) Thanks [@JounQin](https://github.com/JounQin)! - fix: clarify correct `eslint-config-prettier` peer range ## [v5.2.4](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#524) ##### Patch Changes - [#715](prettier/eslint-plugin-prettier#715) [`b8cfe56`](prettier/eslint-plugin-prettier@b8cfe56) Thanks [@JounQin](https://github.com/JounQin)! - chore: hourcekeeping, bump all (dev) deps
| datasource | package | from | to | | ---------- | ---------------------- | ----- | ----- | | npm | eslint-plugin-prettier | 5.2.3 | 5.4.0 | ## [v5.4.0](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#540) ##### Minor Changes - [#736](prettier/eslint-plugin-prettier#736) [`59a0cae`](prettier/eslint-plugin-prettier@59a0cae) Thanks [@yashtech00](https://github.com/yashtech00)! - refactor: migrate `worker.js` to `worker.mjs` ## [v5.3.1](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#531) ##### Patch Changes - [#734](prettier/eslint-plugin-prettier#734) [`dcf2c80`](prettier/eslint-plugin-prettier@dcf2c80) Thanks [@JounQin](https://github.com/JounQin)! - ci: enable `NPM_CONFIG_PROVENANCE` env ## [v5.3.0](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#530) ##### Minor Changes - [#674](prettier/eslint-plugin-prettier#674) [`6fe0c90`](prettier/eslint-plugin-prettier@6fe0c90) Thanks [@irsooti](https://github.com/irsooti)! - feat(types): prefer `Config` over `FlatConfig` when they're equal ## [v5.2.6](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#526) ##### Patch Changes - [#723](prettier/eslint-plugin-prettier#723) [`1451176`](prettier/eslint-plugin-prettier@1451176) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): bump `synckit` to `v0.11.0` ## [v5.2.5](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#525) ##### Patch Changes - [#721](prettier/eslint-plugin-prettier#721) [`4f5513d`](prettier/eslint-plugin-prettier@4f5513d) Thanks [@JounQin](https://github.com/JounQin)! - fix: clarify correct `eslint-config-prettier` peer range ## [v5.2.4](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#524) ##### Patch Changes - [#715](prettier/eslint-plugin-prettier#715) [`b8cfe56`](prettier/eslint-plugin-prettier@b8cfe56) Thanks [@JounQin](https://github.com/JounQin)! - chore: hourcekeeping, bump all (dev) deps
| datasource | package | from | to | | ---------- | ---------------------- | ----- | ----- | | npm | eslint-plugin-prettier | 5.2.3 | 5.4.0 | ## [v5.4.0](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#540) ##### Minor Changes - [#736](prettier/eslint-plugin-prettier#736) [`59a0cae`](prettier/eslint-plugin-prettier@59a0cae) Thanks [@yashtech00](https://github.com/yashtech00)! - refactor: migrate `worker.js` to `worker.mjs` ## [v5.3.1](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#531) ##### Patch Changes - [#734](prettier/eslint-plugin-prettier#734) [`dcf2c80`](prettier/eslint-plugin-prettier@dcf2c80) Thanks [@JounQin](https://github.com/JounQin)! - ci: enable `NPM_CONFIG_PROVENANCE` env ## [v5.3.0](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#530) ##### Minor Changes - [#674](prettier/eslint-plugin-prettier#674) [`6fe0c90`](prettier/eslint-plugin-prettier@6fe0c90) Thanks [@irsooti](https://github.com/irsooti)! - feat(types): prefer `Config` over `FlatConfig` when they're equal ## [v5.2.6](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#526) ##### Patch Changes - [#723](prettier/eslint-plugin-prettier#723) [`1451176`](prettier/eslint-plugin-prettier@1451176) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): bump `synckit` to `v0.11.0` ## [v5.2.5](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#525) ##### Patch Changes - [#721](prettier/eslint-plugin-prettier#721) [`4f5513d`](prettier/eslint-plugin-prettier@4f5513d) Thanks [@JounQin](https://github.com/JounQin)! - fix: clarify correct `eslint-config-prettier` peer range ## [v5.2.4](https://github.com/prettier/eslint-plugin-prettier/blob/HEAD/CHANGELOG.md#524) ##### Patch Changes - [#715](prettier/eslint-plugin-prettier#715) [`b8cfe56`](prettier/eslint-plugin-prettier@b8cfe56) Thanks [@JounQin](https://github.com/JounQin)! - chore: hourcekeeping, bump all (dev) deps
This PR changes
worker.js
toworker.mjs
close #732
Important
Renamed
worker.js
toworker.mjs
and updated import/export syntax to ECMAScript module format.worker.js
toworker.mjs
.require
toimport
forrunAsWorker
inworker.mjs
.require.resolve('./worker')
torequire.resolve('./worker.mjs')
ineslint-plugin-prettier.js
.package.json
to includeworker.mjs
instead ofworker.js
in thefiles
array.This description was created by
for 4e8ef1f. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Summary by CodeRabbit