-
-
Notifications
You must be signed in to change notification settings - Fork 4
fix: PRETTIER_EXPERIMENTAL_CLI env is already supported by prettier itself
#386
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: 5ead429 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
WalkthroughThis update removes the Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant nano-staged/base.js
participant config/index.js
Developer->>nano-staged/base.js: Runs Prettier command
nano-staged/base.js->>config/index.js: (Old) Import prettierCli
config/index.js-->>nano-staged/base.js: (Old) Return dynamic CLI string
nano-staged/base.js-->>Developer: (Now) Use 'prettier --write' directly
Possibly related PRs
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/nano-staged/base.jsOops! Something went wrong! :( ESLint: 9.29.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'typescript-eslint' imported from /eslint.config.js ✨ 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 (
|
Signed-off-by: JounQin <[email protected]>
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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 removes the custom prettierCli override (since Prettier now supports the PRETTIER_EXPERIMENTAL_CLI env itself) and bumps several dependencies.
- Bump
prettier-plugin-shto v0.18.0 - Remove
prettierCliexport and usage, hardcodingprettier --writein nano-staged hooks - Bump
eslint-import-resolver-typescriptand Angular devDependencies
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/prettier-config/package.json | Updated prettier-plugin-sh version to ^0.18.0 |
| packages/nano-staged/base.js | Removed dynamic prettierCli, now uses prettier --write |
| packages/eslint-config/package.json | Updated eslint-import-resolver-typescript to ^4.4.4 |
| packages/config/index.js | Removed prettierCli export |
| package.json | Bumped Angular devDependencies to 20.0.5 |
| .changeset/thin-dolls-tap.md | Added changeset for prettier-plugin-sh bump |
| .changeset/proud-clowns-check.md | Added changeset for removing PRETTIER_EXPERIMENTAL_CLI logic |
Comments suppressed due to low confidence (2)
packages/config/index.js:45
- Update project documentation (e.g., README or docs site) to remove references to the
PRETTIER_EXPERIMENTAL_CLIenvironment variable and note its native support in Prettier.
export const preferPrettier = isEnvEnabled('CONFIG_PREFER_PRETTIER')
.changeset/proud-clowns-check.md:6
- [nitpick] Clarify this changeset description to mention the removal of the
prettierClioverride and deprecation of thePRETTIER_EXPERIMENTAL_CLIflag for clearer release notes.
fix: `PRETTIER_EXPERIMENTAL_CLI` env is already supported in prettier itself
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
@1stg/app-config
@1stg/babel-preset
@1stg/browserslist-config
@1stg/commitlint-config
@1stg/common-config
@1stg/config
@1stg/eslint-config
@1stg/markuplint-config
@1stg/nano-staged
@1stg/postcss-config
@1stg/prettier-config
@1stg/remark-preset
@1stg/simple-git-hooks
@1stg/stylelint-config
@1stg/tsconfig
commit: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #386 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 39 39
Lines 281 278 -3
Branches 131 129 -2
======================================
+ Misses 281 278 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/nano-staged/base.js (1)
23-24: Duplicate literal'prettier --write'– extract to a constant for maintainability.The same string appears three times; if the invocation ever changes (flags, path, quoted for Windows, etc.) it must be updated in multiple places.
+const PRETTIER_CMD = 'prettier --write' ... - [files]: 'prettier --write', + [files]: PRETTIER_CMD, ... - ...(useEslintPrettier ? [] : ['prettier --write']), + ...(useEslintPrettier ? [] : [PRETTIER_CMD]), ... - ...(useStylelintPrettier ? [] : ['prettier --write']), + ...(useStylelintPrettier ? [] : [PRETTIER_CMD]),A small refactor, but it removes duplication and makes future tweaks safer.
Also applies to: 32-33, 40-41
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (8)
.changeset/proud-clowns-check.md(1 hunks).changeset/thin-dolls-tap.md(1 hunks)package.json(1 hunks)packages/config/index.d.ts(0 hunks)packages/config/index.js(0 hunks)packages/eslint-config/package.json(1 hunks)packages/nano-staged/base.js(2 hunks)packages/prettier-config/package.json(1 hunks)
💤 Files with no reviewable changes (2)
- packages/config/index.d.ts
- packages/config/index.js
🧰 Additional context used
🪛 GitHub Check: codecov/patch
packages/nano-staged/base.js
[warning] 32-32: packages/nano-staged/base.js#L32
Added line #L32 was not covered by tests
[warning] 40-40: packages/nano-staged/base.js#L40
Added line #L40 was not covered by tests
🔇 Additional comments (6)
packages/eslint-config/package.json (1)
80-80: Verify resolver release notes & peer-dependency alignment
eslint-import-resolver-typescriptwas bumped to^4.4.4. This package occasionally tightens its requiredtypescriptrange. Please make sure the repo’s pinnedtypescript(rootdevDependencies) satisfies the new resolver’s peer range and thateslint --print-configstill resolvesparserOptions.projectcorrectly in CI.package.json (1)
28-30: Patch-level Angular bump looks safe; double-check lock-file andangular-eslintcoupling
Going from20.0.4→20.0.5should be non-breaking, yet the monorepo uses[email protected]. Confirm that the minor patch does not require anangular-eslintupgrade and that your lock-file regenerated cleanly (yarn install --immutable).packages/prettier-config/package.json (1)
41-41: 👍 Upgrade to[email protected]
No breaking changes reported in the changelog; the bump aligns with Prettier 3.6.1. Formatting CI should cover any regressions..changeset/thin-dolls-tap.md (1)
1-6: Changeset correctly reflects the dependency bump
File is well-formed and uses patch release as expected..changeset/proud-clowns-check.md (1)
1-7: Changeset message mirrors code removal ofprettierCli
Documentation and versioning metadata look good.packages/nano-staged/base.js (1)
1-1:prettierCliimport clean-up looks good, but double-check for stragglers.The explicit removal of
prettierClikeeps the dependency surface smaller and avoids dead code.
Please run a quick repo-wide search to ensure no stale references slipped through.#!/bin/bash # Verify that prettierCli is no longer referenced anywhere. rg --line-number --word-regexp 'prettierCli'
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 491c1f2 in 10 minutes and 20 seconds. Click for details.
- Reviewed
117lines of code in8files - Skipped
1files when reviewing. - Skipped posting
8draft 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. .changeset/proud-clowns-check.md:6
- Draft comment:
Changelog message is clear; ensure it follows our conventions. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. .changeset/thin-dolls-tap.md:5
- Draft comment:
Dependency bump for prettier-plugin-sh logged correctly. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. package.json:28
- Draft comment:
Angular packages updated to 20.0.5; ensure these patch updates are compatible with consumers. - Reason this comment was not posted:
Confidence changes required:10%<= threshold50%None
4. packages/config/index.d.ts:7
- Draft comment:
Removed 'prettierCli' export from type definitions; ensure consumers update their imports accordingly. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is purely informative, reminding the PR author to ensure consumers update their imports. It doesn't provide a specific code suggestion or ask for a test to be written.
5. packages/config/index.js:44
- Draft comment:
Removed 'prettierCli' export since Prettier now natively supports the experimental CLI flag. Verify that dependent code uses the default 'prettier' command. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to verify that dependent code uses the default 'prettier' command after removing 'prettierCli' export. This is asking the author to double-check something, which violates the rules.
6. packages/eslint-config/package.json:78
- Draft comment:
Bumped eslint-import-resolver-typescript to ^4.4.4; double-check compatibility with the ESLint setup. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. packages/nano-staged/base.js:1
- Draft comment:
Removed 'prettierCli' import and now using hardcoded 'prettier --write'. Confirm this change is intentional since it removes dynamic CLI behavior based on env. - Reason this comment was not posted:
Comment looked like it was already resolved.
8. packages/prettier-config/package.json:41
- Draft comment:
Updated prettier-plugin-sh to ^0.18.0; verify that this update doesn't introduce breaking changes. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_CnXBxfLB9L9zSaq5
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
prettier/prettier#17669
Important
Remove
prettierCliexport and update dependencies for Prettier and Angular support.prettierCliexport fromindex.jsandindex.d.tsinpackages/config.nano-staged/base.jsto useprettier --writedirectly instead ofprettierCli.@angular/compiler,@angular/compiler-cli, and@angular/coreto^20.0.5inpackage.json.eslint-import-resolver-typescriptto^4.4.4inpackages/eslint-config/package.json.prettier-plugin-shto^0.18.0inpackages/prettier-config/package.json.This description was created by
for 491c1f2. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Bug Fixes
Chores
Refactor