-
-
Notifications
You must be signed in to change notification settings - Fork 70
feat!: bump prettier-eslint to support ESLint v9 flat config
#460
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: 2a03d6d 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 |
WalkthroughThis update modernizes project tooling, dependencies, and configuration files. It upgrades Node.js and dependency versions, migrates ESLint and Yarn configurations to new formats, and removes obsolete or redundant files. The codebase is refactored for formatting consistency, and scripts are updated to support new workflows and compatibility with ESLint 9 flat config. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant ESLint Flat Config
participant Prettier-ESLint Formatter
User->>CLI: Run prettier-eslint-cli with files/globs
CLI->>ESLint Flat Config: Load configuration (v9+)
CLI->>Prettier-ESLint Formatter: Format files using config
Prettier-ESLint Formatter-->>CLI: Return formatted results
CLI-->>User: Output success/failure/unchanged messages
Assessment against linked issues
Poem
✨ 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 (
|
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 bumps the version of prettier-eslint to support ESLint v9 flat config while updating dependencies, scripts, and configuration files to align with newer versions and practices. Key changes include updates to package.json (dependency versions, scripts, and metadata), the introduction of a new ESLint flat configuration in eslint.config.mjs replacing the old .eslintrc.js, and the removal of legacy documentation files.
Reviewed Changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated dependency versions and Node engine constraints; refined scripts and metadata |
| package-scripts.js | Updated glob patterns in the format script |
| other/manual-releases.md, other/EXAMPLES.md | Removed legacy documentation files |
| eslint.config.mjs | Introduced new ESLint flat config using modern spread syntax |
| babel.config.js | Minor configuration tweaks |
| mocks/*.js | Various mock updates with consistent syntax adjustments |
| .yarnrc.yml, .yarn/plugins/* | New Yarn configuration and plugin included |
| .npmrc | Legacy NPM configuration removed |
| .github/FUNDING.yml | Updated funding URLs |
| .eslintrc.js | Removed in favor of new ESLint flat config |
| .eslintignore | Removed as ESLint ignore patterns are expected to be handled via flat config |
| .codesandbox/ci.json | Updated Node version for CI |
| .changeset/* | New changeset files to drive the release process |
Comments suppressed due to low confidence (2)
.eslintignore:1
- The removal of .eslintignore implies that ESLint ignore patterns should now be handled through the new ESLint flat configuration. Please ensure that all necessary ignore patterns have been migrated appropriately.
node_modules
.eslintrc.js:1
- The .eslintrc.js file has been removed in favor of the new eslint.config.mjs. It would be beneficial to update the documentation to guide users through this migration and any potential differences in configuration.
const config = {
|
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.
Caution
Changes requested ❌
Reviewed everything up to 4094f31 in 2 minutes and 50 seconds. Click for details.
- Reviewed
1861lines of code in34files - Skipped
3files when reviewing. - Skipped posting
15draft 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. src/format-files.js:18
- Draft comment:
Nice use of a dedicated INDENT_COUNT constant for error messages. This improves consistency. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. src/format-files.js:20
- Draft comment:
Renaming LINE_SEPERATOR_REGEX to LINE_SEPARATOR_REGEX fixes a typo. - Reason this comment was not posted:
Comment looked like it was already resolved.
3. package.json:16
- Draft comment:
The updated node engine version range is clear; verify that this bump preserves backward compatibility if needed. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. src/prettier-eslint.js:15
- Draft comment:
Ensure the fallback to '@prettier/eslint' is intentional and documented for users who haven't installed prettier-eslint manually. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the author to ensure that a fallback behavior is intentional and documented. This is a request for confirmation and documentation, which violates the rules against asking for confirmation or documentation updates.
5. src/parser.js:29
- Draft comment:
Consistent use of oneLine/stripIndent for help text improves readability. Good pattern! - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. src/format-files.js:18
- Draft comment:
Nice improvement: using the INDENT_COUNT constant consolidates the indentation value and improves maintainability in error logging. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. src/prettier-eslint.js:16
- Draft comment:
Ensure that the fallback using '@prettier/eslint' is intended and provides the expected ESLint v9 flat config compatibility. - 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.
8. test/tests/cli.spec.js:189
- Draft comment:
Consider relying on process exit codes (or more explicit checks) rather than only inspecting stderr contents to determine success in the CLI runner. This can make error handling more robust. - 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.
9. .github/FUNDING.yml:5
- Draft comment:
Typographical inconsistency: 'rx-ts' (line 5) does not match the variant 'rxts' used in the custom section (line 12). If these are meant to be the same entity, please update them for consistency. - 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.
10. .github/FUNDING.yml:6
- Draft comment:
Typographical inconsistency: 'un-ts' (line 6) differs from 'unts' in the custom section (line 13). If these represent the same identifier, consider unifying the naming. - 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.
11. CODE_OF_CONDUCT.md:6
- Draft comment:
Typographical suggestion: In line 6, consider changing 'pledge to making participation' to 'pledge to make participation' for improved grammatical clarity. - 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.
12. ROADMAP.md:20
- Draft comment:
It looks like there's a typographical error on line 20. "Wont do" should probably be "Won't do" with an apostrophe. Could you please update it? - 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.
13. src/format-files.spec.js:47
- Draft comment:
Typographical error: In the test description on line 47, 'inclues' should be corrected to 'includes'. - 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.
14. src/prettier-eslint.js:12
- Draft comment:
It might be clearer to say "You can installprettier-eslintas a dependency..." instead of "as dependency". This small change improves the grammar. - Reason this comment was not posted:
Comment was on unchanged code.
15. test/tests/cli.spec.js:44
- Draft comment:
Typo: The term 'undeterministic' is unusual. Consider replacing it with 'non-deterministic' for better clarity. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_qU4wT2ipcrt6U28S
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/dry-cobras-fold.md (1)
5-5: Clarify changeset description.
Consider expanding the summary to guide users through migrating to ESLint v9’s flat config (e.g., mention updating.eslintrc.js→eslint.config.mjs).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
.yarn/plugins/plugin-prepare-lifecycle.cjsis excluded by!**/.yarn/**.yarn/releases/yarn-4.9.1.cjsis excluded by!**/.yarn/**src/__snapshots__/uncaught-exception-handler.spec.js.snapis excluded by!**/*.snapyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (31)
.changeset/dry-cobras-fold.md(1 hunks).changeset/pre.json(1 hunks).codesandbox/ci.json(1 hunks).eslintignore(0 hunks).eslintrc.js(0 hunks).github/FUNDING.yml(1 hunks).gitignore(1 hunks).npmrc(0 hunks).yarnrc.yml(1 hunks)__mocks__/fs.js(1 hunks)__mocks__/glob.js(5 hunks)__mocks__/prettier-eslint.js(1 hunks)babel.config.js(1 hunks)eslint.config.mjs(1 hunks)jest.config.js(2 hunks)other/EXAMPLES.md(0 hunks)other/manual-releases.md(0 hunks)package-scripts.js(1 hunks)package.json(2 hunks)src/argv.js(1 hunks)src/format-files.js(14 hunks)src/format-files.spec.js(15 hunks)src/index.js(1 hunks)src/message.spec.js(1 hunks)src/messages.js(1 hunks)src/parser.js(12 hunks)src/prettier-eslint.js(1 hunks)src/uncaught-exception-handler.js(1 hunks)src/uncaught-exception-handler.spec.js(3 hunks)test/override-config.js(1 hunks)test/tests/cli.spec.js(10 hunks)
💤 Files with no reviewable changes (5)
- other/EXAMPLES.md
- .eslintignore
- .npmrc
- other/manual-releases.md
- .eslintrc.js
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/uncaught-exception-handler.js (4)
src/index.js (1)
logger(11-11)src/prettier-eslint.js (1)
logger(3-3)src/uncaught-exception-handler.spec.js (3)
logger(6-6)logger(31-31)logger(40-40)src/format-files.js (1)
logger(35-35)
src/format-files.spec.js (1)
src/format-files.js (1)
globOptions(219-219)
🔇 Additional comments (73)
.github/FUNDING.yml (1)
15-15: Approve updated custom funding URL
The custom URL for JounQin has been correctly updated to the new afdian link. No further changes needed.test/override-config.js (1)
3-4: Approve addition of trailing commas
Adding trailing commas in thequotesarray and closing brace improves formatting consistency without altering behavior..changeset/pre.json (1)
1-8: Approve new pre-release configuration
The.changeset/pre.jsonfile correctly initializes the pre-release mode with tag “alpha” and version “8.0.1”. This complements the major bump for ESLint v9 support.babel.config.js (1)
7-13: Approve trailing commas in Babel config
Trailing commas have been added for consistent object and array literal formatting; there’s no functional impact.src/argv.js (1)
6-8: Approve formatting change in normalize initializer
A trailing comma was added after the reducer’s initial value. This is purely stylistic and safe.🧰 Tools
🪛 Biome (1.9.4)
[error] 6-6: Avoid the use of spread (
...) syntax on accumulators.Spread syntax should be avoided on accumulators (like those in
.reduce) because it causes a time complexity ofO(n^2).
Consider methods such as .splice or .push instead.(lint/performance/noAccumulatingSpread)
.codesandbox/ci.json (1)
2-2: Approve Node.js version bump.
Updating from Node 16 to 18 aligns with thepackage.jsonengines field (^18.18.0 || ^20.9.0 || >=21.1.0)..changeset/dry-cobras-fold.md (1)
1-3: Validate changeset metadata.
The YAML front-matter correctly declares a major bump forprettier-eslint-cli.__mocks__/prettier-eslint.js (1)
1-7: Removal ofrequire-awaitdisable is acceptable.
Theformatmock returns Promises viaPromise.resolveand throws synchronously—no async/await is used, so dropping the ESLint rule override poses no risk.src/uncaught-exception-handler.js (2)
32-32: Consistent trailing comma in array literal.
Adding a trailing comma after the template literal inresolutionStepsis a no-op for logic and improves diff cleanliness.
39-39: Trailing comma in function call is valid.
The extra comma in thelogger.errorargument list is supported in Node 18+ and aligns with the project’s style guidelines.src/messages.js (3)
5-5: Reorder export declarations.
Switching toexport { failure, success, unchanged }is semantically neutral, but verify no downstream modules rely on the previous export order (though named exports are order-agnostic).
10-10: Add trailing comma for consistency.
Including a trailing comma after the template string inmf.compile()improves formatting uniformity.
17-17: Add trailing comma for consistency.
Same stylistic update as above; valid and enhances diff readability..yarnrc.yml (1)
1-10: LGTM: Proper Yarn Berry configuration addedThis new configuration file sets up Yarn Berry (v4) with appropriate settings for the project:
- Disables telemetry for privacy
- Uses node-modules linker for compatibility
- Adds the prepare-lifecycle plugin (important for npm scripts compatibility)
- Pins to a specific Yarn version for consistency
This aligns with the PR's goal of modernizing the tooling to support ESLint v9 flat config.
src/index.js (1)
3-9: Import ordering improvedThe changes reorganize imports while maintaining the critical order of the exception handler (which needs to be first). This improves code organization by grouping related imports together.
src/prettier-eslint.js (2)
8-8: Simplified error handlingRemoved the unused error parameter in the catch block since it wasn't being utilized.
12-12: Style consistency improvementAdded trailing comma to maintain consistent formatting with modern JavaScript style conventions.
__mocks__/glob.js (9)
8-8: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
17-17: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
25-25: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
45-45: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
54-54: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
63-63: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
71-71: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
78-78: Style consistency: Added trailing commaAdded trailing comma to array elements for consistent code style.
84-84: Style consistency: Added trailing commaAdded trailing comma to string concatenation in error message for consistent code style.
src/uncaught-exception-handler.spec.js (3)
2-2: Improved code organizationAdded blank line after the first import for better visual separation and readability.
20-20: Style consistency: Added trailing commaAdded trailing comma to the mocked logger methods for consistent code style.
56-56: Simplified error handlingRemoved the unused error parameter in the catch block since it wasn't being utilized, improving code clarity.
src/message.spec.js (3)
1-1: Updated ESLint directive for v9 compatibilityThe ESLint directive has been updated from
import/namespacetoimport-x/namespaceto maintain compatibility with ESLint v9's flat config format.
9-10: Added trailing commas for better formatting consistencyAdding trailing commas to arrays and objects is a good practice that improves consistency, makes future additions easier, and produces cleaner git diffs.
Also applies to: 13-14, 19-20, 23-24, 29-30, 33-35
38-44: Modernized iteration with for...of loopsReplacing nested
forEachloops withfor...ofloops improves code readability and performance by using modern JavaScript iteration patterns.package-scripts.js (1)
55-55: Updated format script to support ESLint v9 flat configThe format script glob pattern now includes
.mjsfiles and no longer explicitly mentions.eslintrc.js, aligning with the migration to ESLint v9's flat config format.__mocks__/fs.js (3)
9-9: Updated mock to support ESLint v9 flat configThe file check now uses the more modern
.includes()method and properly handles both legacy.eslintrcfiles and the neweslint.config.*files used by ESLint v9's flat config.
13-15: Modernized string checks and improved error handlingReplaced
indexOfwith the more readableincludes()method for string checks and simplified error handling logic.Also applies to: 17-20
23-23: Simplified readdirSync mock implementationThe mock for
readdirSynchas been simplified to a concise arrow function that always returns an empty array..gitignore (1)
5-10: Updated .gitignore patterns for modern toolingThe .gitignore file has been updated with:
- A more general
.*cachepattern to catch all cache files- Proper configuration for Yarn 2+ (berry) by ignoring
.yarn/*except for.yarn/releasesand.yarn/pluginsThese changes align with the PR's overall modernization of the project's tooling and workflow.
src/parser.js (3)
1-1: Approve update to use explicit Node.js module specifier.The change from
'path'to'node:path'follows the recommended Node.js best practice for importing core modules, making the module source explicit.
4-5: Approve import statement cleanup.The import is now properly formatted with destructuring to import only the specific functions needed from the common-tags package.
23-24: Approve formatting consistency improvements.The addition of trailing commas to object properties and standardization of multiline template literals improves code consistency and makes future changes easier by reducing git diff noise.
Also applies to: 28-29, 32-33, 41-42, 50-51, 58-59, 65-66, 70-71, 75-76, 80-81, 92-93, 98-99, 103-104, 108-109, 112-113, 116-117, 128-129, 140-141, 148-149, 152-153, 167-168, 172-173, 183-184, 194-195, 207-208, 225-226
jest.config.js (2)
4-5: Approve JSDoc type annotation simplification.The JSDoc type annotation has been simplified to directly import
Configfrom Jest, improving type clarity while maintaining the same functionality.
18-20: Approve consistent formatting.Added trailing commas and adjusted indentation in the coverageThreshold configuration object for better code consistency.
src/format-files.spec.js (7)
1-3: Approve explicit import naming for mocked filesystem.Renamed import to
mockFswhich better reflects its role as a mocked module and makes the test code more readable.
6-7: Approve updated import syntax.Updated the glob import to use the named import syntax which aligns with the package's current export style.
14-15: Approve workaround for mocking node:fs module.The added comment and mock for 'node:fs' is necessary because of the transition to explicit Node.js module specifiers elsewhere in the codebase.
22-24: Approve consistent mock naming.Updated references from the previous naming to the more explicitly named
mockFsfor better code consistency.
40-42: Approve regex pattern improvements for output matching.Updated regex patterns to include Unicode line terminators (
\u2028,\u2029) which makes the tests more robust against different types of line breaks.Also applies to: 96-98, 126-131, 222-224, 236-238, 256-258, 270-272
280-286: Approve improved promise assertion syntax.Updated to use modern async/await pattern with
expect(...).resolves.not.toThrow()which provides clearer test assertions and better error messages.
332-333: Approve ESLint 9 flat config file support.Updated the test to use
eslint.config.mjsinstead of the legacy.eslintrc, which aligns with ESLint v9's new flat configuration format that this PR is supporting.test/tests/cli.spec.js (6)
2-5: Approve use of explicit Node.js module specifiers.Updated imports to use the
node:prefix for core modules and consolidated imports from 'common-tags', improving code clarity and maintainability.
14-14: Approve numeric separator for improved readability.Using
20_000instead of20000makes the timeout value more readable while maintaining the same numeric value.
37-38: Approve consistent formatting with trailing commas.Added trailing commas to function calls, object literals, and array literals to maintain consistent formatting across the codebase.
Also applies to: 46-47, 58-60, 69-71, 78-79, 90-92, 99-100, 124-125, 130-134, 137-140
108-108: Approve use of globalThis instead of window.Changed from
window.baztoglobalThis.bazwhich is a more environment-agnostic approach that works in both browser and Node.js environments.
149-152: Approve improved error handling.Updated error variable name from
stderrtoerrorto better represent what's being caught, improving code clarity.
200-203: Approve use of replaceAll for string replacement.Changed from regex-based
replacetoreplaceAllwhich is more readable and potentially more efficient for replacing all occurrences of a string.eslint.config.mjs (5)
1-7: Well-structured ESLint v9 flat config importsThe file correctly implements ESLint v9's flat config format with appropriate imports, including the essential
typescript-eslintpackage for config generation. The Node.js-style imports follow modern conventions.
8-13: Good configuration structure with proper ignore patternsThe configuration extends base configs and correctly sets ignore patterns. The pattern
'!test/fixtures/paths/node_modules/**/*.js'is a well-crafted negative pattern to selectively include specific files that would otherwise be ignored.
14-35: Comprehensive rule configuration aligned with project needsThe rules configuration disables formatting-related rules that would conflict with Prettier while maintaining important code quality rules. The settings for function spacing, quotes, and unused variables are appropriate for the project style.
36-45: Appropriate test file overridesThe configuration correctly overrides settings for test files by including Jest globals and disabling rules that are too restrictive for test code, such as
no-magic-numbersandsonarjs/slow-regex.
46-52: File-specific rule override for hashbangThe configuration correctly disables the
n/hashbangrule specifically forsrc/index.js, which likely contains a CLI entry point that needs a hashbang.src/format-files.js (7)
1-5: Modern import statements with appropriate package replacementsThe imports now use explicit
node:protocol prefixes for Node.js built-ins, which is a recommended practice. The replacements ofindent-stringwith@esm2cjs/indent-stringandchalkwithchalk-cjsaddress ESM compatibility issues in a CommonJS codebase.
12-14: Improved RxJS imports organizationThe RxJS imports are now better organized, with base imports separated from operators, which improves code readability and maintainability.
18-20: Good constant extraction for consistent indentationExtracting
INDENT_COUNTas a constant ensures consistent indentation throughout error messages and improves maintainability. TheLINE_SEPARATOR_REGEXpattern is also improved for better handling of different line endings.
73-74: Updated ESLint v9 configuration propertyThe property
overrideConfigFileis correctly used for ESLint v9 configuration, replacing the deprecated property that would have been used with older ESLint versions.
91-108: Modern async/await syntax for stdin handlingThe refactoring to use async/await for stdin handling improves code readability and maintainability compared to the previous approach. The function now properly returns the stdin value on error, which is a good error handling pattern.
225-237: Improved code formatting for file filtering logicThe refactoring of the file filtering logic improves readability with better indentation and a more concise boolean expression for determining whether to filter out files based on ignore patterns.
346-354: Updated line separator handlingThe function now correctly uses the improved
LINE_SEPARATOR_REGEXfor splitting file content, ensuring consistent handling of different line ending formats.package.json (6)
4-17: Updated package metadata and Node.js requirementsThe package now correctly specifies:
"type": "commonjs"to ensure Node.js treats the codebase as CommonJS- Expanded metadata fields for better discoverability
- Yarn 4.9.1 as the package manager
- Updated Node.js engine requirements that align with current LTS versions
These changes provide better clarity for users and contributors.
28-35: Enhanced script commands for modern workflowsThe updated scripts add a dedicated
formatcommand and enhance theprepareandversionscripts to include additional tooling likeyarn-berry-deduplicate. These changes improve the development workflow and ensure consistency.
46-63: Updated dependencies to support ESLint v9The dependencies have been properly updated to support ESLint v9 with flat config:
- ESLint is updated to v9.26.0
- Prettier-eslint is updated to v17.0.0-alpha.0
- ESM packages have been replaced with CJS-compatible alternatives
- Other dependencies are updated to their latest compatible versions
These updates align directly with the PR objective.
66-91: Comprehensive development dependencies updateThe dev dependencies have been thoroughly updated to support the modernized toolchain:
- Added ESLint and Prettier configs from @1stG
- Added typescript-eslint for ESLint v9 flat config support
- Added testing types and updated testing tools
- Added yarn-berry-deduplicate for dependency management
These changes ensure the development environment supports the updated dependencies.
92-98: Updated linting and formatting configurationThe configuration has been updated to:
- Replace lint-staged with nano-staged
- Use an external Prettier configuration
- Update the pre-commit hook to work with the new tools
These changes align with modern JavaScript tooling practices and ensure consistent code quality.
47-49:Details
✅ Verification successful
Verify compatibility with alpha version dependency
The PR uses
prettier-eslint@^17.0.0-alpha.0, which is an alpha version. While this is needed to support ESLint v9 flat config, alpha versions can introduce instability.
🏁 Script executed:
#!/bin/bash # Check if there are any issues reported for the alpha version echo "Checking for issues with prettier-eslint@17.0.0-alpha.0" gh issue list --repo prettier/prettier-eslint --search "in:title,body 17.0.0-alpha" --state all # Check if there are any newer versions available echo "Checking for newer versions" npm view prettier-eslint versions --json | grep -o '"17[^"]*"' | sort -VLength of output: 375
No issues found with prettier-eslint@17.0.0-alpha.0
Verification shows:
- No open or closed issues related to
17.0.0-alpha.0in the prettier-eslint repo.- No newer alpha or beta releases past
17.0.0-alpha.0.Since this alpha is required for ESLint v9 flat‐config support and there are no known blocking issues, it’s safe to proceed. Please remember to upgrade to a stable release when one becomes available.
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.
Caution
Changes requested ❌
Reviewed de8aaa1 in 2 minutes and 32 seconds. Click for details.
- Reviewed
1837lines of code in31files - Skipped
1files when reviewing. - Skipped posting
36draft 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/dry-cobras-fold.md:5
- Draft comment:
Ensure the breaking change note clearly explains removal of legacy ESLint configs. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
2. eslint.config.mjs:8
- Draft comment:
Confirm that the flat config setup with tseslint.config meets ESLint v9 requirements. - Reason this comment was not posted:
Confidence changes required:40%<= threshold50%None
3. package.json:15
- Draft comment:
Verify that the new Node engine requirements are communicated clearly in release notes. - Reason this comment was not posted:
Confidence changes required:30%<= threshold50%None
4. src/format-files.js:102
- Draft comment:
Using INDENT_COUNT consistently is good; confirm error formatting meets expectations. - Reason this comment was not posted:
Confidence changes required:10%<= threshold50%None
5. src/format-files.spec.js:40
- Draft comment:
Regex patterns for snapshot matching are complex—ensure they are stable across environments. - Reason this comment was not posted:
Confidence changes required:30%<= threshold50%None
6. src/prettier-eslint.js:15
- Draft comment:
Fallback to '@prettier/eslint' is acceptable, but consider documenting differences from user-installed version. - Reason this comment was not posted:
Confidence changes required:30%<= threshold50%None
7. .changeset/dry-cobras-fold.md:1
- Draft comment:
Changelog entry clearly mentions the bump for ESLint v9 flat config support. Ensure that if needed, additional details about breaking changes and new behavior are provided. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is asking the PR author to ensure that the changelog entry provides additional details. This falls under the rule of not asking the PR author to update the PR description or similar documentation. Therefore, this comment should be removed.
8. .changeset/pre.json:1
- Draft comment:
Pre-release configuration is set with mode 'pre' and tag 'alpha', which is appropriate for this major bump. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it simply states that the pre-release configuration is appropriate. It doesn't provide any actionable feedback or suggestions for improvement.
9. .codesandbox/ci.json:1
- Draft comment:
Node version bumped to 18 in the CI config. Verify that the sandbox environments fully support Node 18. - 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 compatibility with Node 18 in sandbox environments. This falls under the rule of not asking the author to ensure compatibility or verify behavior, which is not allowed.
10. .github/FUNDING.yml:15
- Draft comment:
Funding URL updated from afdian.net to afdian.com. Confirm that all funding links are correct and resolve as intended. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to confirm that all funding links are correct and resolve as intended. This falls under the rule of not asking the author to confirm or ensure behavior is intended.
11. .yarn/plugins/plugin-prepare-lifecycle.cjs:1
- Draft comment:
The new Yarn plugin for preparing the lifecycle is concise. Consider adding inline comments if future maintainers need context on its execution flow. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the code is somewhat dense without comments, it's a very small and straightforward plugin with clear purpose. The code follows a standard Yarn plugin pattern. The suggestion is more of a style preference than a critical issue. Adding comments would be nice-to-have but not essential for understanding the code. The code could become more complex in the future, making comments more valuable. Some developers might struggle with the compressed format. The code is extremely simple - just one line that follows a standard plugin pattern. Any Yarn plugin developer would understand this format. This comment should be deleted as it's more of a style suggestion than a critical issue, and the code is simple enough to understand without comments.
12. .yarnrc.yml:1
- Draft comment:
Yarn configuration now includes plugin details and a specific yarnPath; the settings look correct. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it only states that the Yarn configuration looks correct. It doesn't provide any actionable feedback or suggestions for improvement.
13. __mocks__/fs.js:9
- Draft comment:
Using 'includes' instead of 'indexOf' for detecting '.eslintrc' or 'eslint.config.' improves readability and reliability in the mock. - Reason this comment was not posted:
Comment looked like it was already resolved.
14. __mocks__/glob.js:3
- Draft comment:
Trailing commas added in returned arrays ensure consistent code style without affecting functionality. - 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.
15. __mocks__/prettier-eslint.js:8
- Draft comment:
The mock for prettier-eslint correctly returns mocked outputs or throws errors for specific inputs. This keeps tests isolated. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it only praises the current implementation without suggesting any changes or improvements. It doesn't provide any actionable feedback or raise any concerns.
16. babel.config.js:4
- Draft comment:
Babel configuration now includes trailing commas for improved formatting consistency; no semantic changes. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, stating that the Babel configuration now includes trailing commas for formatting consistency. It does not provide a suggestion, ask for confirmation of intent, or point out a potential issue. According to the rules, purely informative comments should be removed.
17. eslint.config.mjs:8
- Draft comment:
The new ESLint flat config using tseslint.config effectively merges multiple configurations to support ESLint v9 flat settings. Ensure that the merge order meets your linting requirements. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and suggests ensuring that the merge order meets linting requirements, which violates the rule against asking the PR author to ensure behavior is intended or tested.
18. jest.config.js:1
- Draft comment:
Jest configuration appears solid with strict coverage thresholds. The 100% thresholds might be strict but seem intentional for this project. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it only states that the Jest configuration appears solid and that the thresholds seem intentional. It doesn't provide any actionable feedback or suggestions for improvement.
19. package-scripts.js:54
- Draft comment:
The format script has been updated to include the 'mjs' extension in its glob pattern, ensuring modern JS module files are formatted. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, explaining a change that was made without suggesting any action or asking for clarification. It doesn't align with the rules for useful comments.
20. package.json:15
- Draft comment:
package.json reflects updated dependencies, Node engine requirements, and peer dependency settings for ESLint v9 support. Verify that the fallback module for prettier-eslint is consistent with the peer version. - 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 consistency between the fallback module and the peer version, which is not allowed according to the rules. It is related to dependencies, which should not be commented on unless it's a specific suggestion or issue.
21. src/argv.js:1
- Draft comment:
The normalize function properly filters out keys containing dashes. Its use of Object.entries and reduce is clear and concise. - 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.
22. src/format-files.js:1
- Draft comment:
Refactoring in format-files.js is solid: use of 'node:' built-in modules, introduction of INDENT_COUNT, renaming of LINE_SEPARATOR_REGEX, and improved error logging all enhance readability and consistency. The memoization for ignore file lookups appears correct. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and does not provide any actionable feedback or suggestions for improvement. It simply praises the changes made in the code without offering any constructive criticism or questions.
23. src/format-files.spec.js:1
- Draft comment:
Test specifications have been updated to use the mocked 'node:fs' module consistently. The tests cover various outcomes (write, listDifferent, ignore behavior) and use snapshots to verify output. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it only praises the updates made to the test specifications without providing any actionable feedback or suggestions for improvement.
24. src/index.js:1
- Draft comment:
The entry point imports the exception handler first, then gets and normalizes CLI arguments before invoking formatFiles. The ordering and use of imports ensure that any early exceptions are caught. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and does not provide any actionable feedback or suggestions for improvement. It simply describes what the code is doing, which violates the rule against making purely informative comments.
25. src/message.spec.js:1
- Draft comment:
Message tests accurately verify the output of success, failure, and unchanged messages using MessageFormat. The test structure is clear. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it only praises the existing test structure without providing any actionable feedback or suggestions for improvement.
26. src/messages.js:1
- Draft comment:
Message functions are implemented using MessageFormat and handle pluralization correctly. The templates clearly differentiate between singular and plural cases. - 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.
27. src/parser.js:1
- Draft comment:
The parser configuration using yargs is comprehensive and includes detailed option descriptions. The use of coercePath ensures relative paths are handled properly. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, praising the use ofyargsandcoercePath. It doesn't provide any actionable feedback or suggestions for improvement.
28. src/prettier-eslint.js:5
- Draft comment:
The fallback mechanism in prettier-eslint.js attempts to require the user-installed 'prettier-eslint', and if unavailable, falls back to '@prettier/eslint'. This supports ESLint v9 flat config. Logging informs the user of the fallback. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, explaining the fallback mechanism in the code without suggesting any changes or asking for confirmation on specific code behavior. It doesn't align with the rules for useful comments.
29. src/uncaught-exception-handler.js:1
- Draft comment:
The uncaught exception handler logs detailed resolution steps and uses oneLine templates for clarity. It rethrows the error after logging, which is the expected behavior. - 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.
30. src/uncaught-exception-handler.spec.js:1
- Draft comment:
The tests for the uncaught exception handler effectively verify that errors are logged (including trace markers) and rethrown. The mock reset ensures proper isolation between tests. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, praising the tests for their effectiveness. It doesn't provide any actionable feedback or suggestions for improvement.
31. test/override-config.js:1
- Draft comment:
The override config sets the quotes rule to use double quotes; this simple configuration is clear and effective. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, praising the configuration without providing any actionable feedback or suggestions. It doesn't align with the rules for useful comments.
32. test/tests/cli.spec.js:1
- Draft comment:
The CLI tests thoroughly cover various scenarios—from help output and file formatting to handling stdin and listing differences. Notably, the expectation change from 'window.baz' to 'globalThis.baz' is intentional for Node environments. Ensure documentation reflects this change if applicable. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a test file, not production code. The change from window to globalThis appears to be an implementation detail of how the formatter handles global object references. The comment is asking for documentation updates but this seems like an internal test detail that doesn't warrant user-facing documentation. Maybe this is an important API change that users of the library need to know about? The change from window to globalThis could affect how their code gets formatted. While the formatting behavior changed, this appears to be an internal implementation detail in a test file. If this was an important API change, it should be documented where the change was made, not in the test file. Delete the comment. It's asking for documentation updates based on a test implementation detail, and starts with "Ensure that..." which violates our rules.
33. src/format-files.spec.js:47
- Draft comment:
Typo: 'inclues' in the test name should be corrected to 'includes'. - 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.
34. src/parser.js:213
- Draft comment:
Minor typographical note: In the prose-wrap option description, consider revising 'BitBucket' to 'Bitbucket' to adhere to the standard capitalization for the service. - 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.
35. src/prettier-eslint.js:12
- Draft comment:
Typographical error: Consider updating the message on line 12 to 'You can installprettier-eslintas a dependency to skip this message.' for improved clarity. - Reason this comment was not posted:
Comment was on unchanged code.
36. test/tests/cli.spec.js:43
- Draft comment:
The term 'undeterministic' appears multiple times in this file. For clarity and consistency, consider replacing it with 'nondeterministic'. This will help future readers of the code understand that the order is not deterministic. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_66KW4Z9TVxFoKbJm
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.
Important
Looks good to me! 👍
Reviewed f1cdffc in 54 seconds. Click for details.
- Reviewed
273lines of code in7files - Skipped
0files when reviewing. - Skipped posting
14draft 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. .github/workflows/autofix.yml:1
- Draft comment:
Workflow looks good. Pinning commit hashes helps reproducibility. No changes needed. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. .github/workflows/ci.yml:24
- Draft comment:
CI workflow updated to use newer Node versions and pinned action commits. Looks fine. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. .github/workflows/pkg-pr-new.yml:16
- Draft comment:
Publish workflow uses yarn and pinned versions; configuration appears correct. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. .github/workflows/release.yml:27
- Draft comment:
Release workflow includes appropriate permissions and uses changesets. Everything looks good. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. .github/workflows/stale.yml:21
- Draft comment:
Stale issues workflow configuration is clear and correctly implemented. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. package.json:25
- Draft comment:
Keywords and scripts updated; version script now uses 'nps test.update' which is consistent with changes. Looks good. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. src/format-files.js:20
- Draft comment:
Changed LINE_SEPARATOR_REGEX to non-capturing form. This simplifies splitting without unnecessary capture groups. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
8. .github/workflows/autofix.yml:1
- Draft comment:
Workflow name is set to 'autofix.ci' as required for security, and action versions are pinned. Looks good. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
9. .github/workflows/ci.yml:17
- Draft comment:
CI workflow uses an updated Node.js matrix (18, 20, 22, 24) with Yarn caching and pinned actions; configuration appears consistent. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
10. .github/workflows/pkg-pr-new.yml:15
- Draft comment:
Publish workflow is correctly configured with Yarn LTS and pinned action versions; no issues found. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
11. .github/workflows/release.yml:38
- Draft comment:
Release workflow now uses Yarn commands ('yarn release' and 'yarn run version') with proper environment settings; ensure this aligns with your release process. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
12. .github/workflows/stale.yml:1
- Draft comment:
Stale issues workflow is properly set up with scheduling, concurrency, and required permissions; it looks correct. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
13. package.json:25
- Draft comment:
Keywords and scripts have been updated for better discoverability and consistent Yarn usage (e.g., in 'release' and 'version' scripts); verify these align with your CI/CD expectations. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
14. src/format-files.js:20
- Draft comment:
The LINE_SEPARATOR_REGEX no longer uses a capturing group, which simplifies splitting logic in getIsIgnored; this change is appropriate. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_C2RaZ2lrRcDieKul
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
package.json (1)
16-16: Confirmed Node.js engine compatibility
The"node"range mirrors ESLint’s supported versions.
🧹 Nitpick comments (2)
package.json (2)
34-40: Streamline scripts with Yarn-centric workflows
- Added
formatscript via nps.preparescript now runspatch-package,simple-git-hooks, and deduplication; note that|| exit 0will swallow errors—consider capturing failures explicitly if required.- Updated
release,test, andversionscripts to integrate with Changesets and Yarn.
97-99: Configurenano-stagedhook execution
The glob pattern and command (node ./dist --write) look correct but consider narrowing globs to excludenode_modulesand limit to source files.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.github/workflows/autofix.yml(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/pkg-pr-new.yml(1 hunks).github/workflows/release.yml(1 hunks).github/workflows/stale.yml(1 hunks)package.json(2 hunks)src/format-files.js(14 hunks)
✅ Files skipped from review due to trivial changes (3)
- .github/workflows/autofix.yml
- .github/workflows/pkg-pr-new.yml
- .github/workflows/stale.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- src/format-files.js
🔇 Additional comments (21)
.github/workflows/release.yml (7)
8-10: Effective concurrency control
Theconcurrencyblock correctly ensures only one release workflow per branch runs at a time, preventing overlapping deployments.
12-15: Explicit minimal permissions
Grantingcontents: write,id-token: write, andpull-requests: writealigns with least privilege for release tasks.
23-23: Pin checkout action to commit
Lockingactions/checkoutto a specific SHA guarantees reproducible CI behavior.
28-28: Pin setup-node action to commit
Using a fixed commit foractions/setup-nodeensures CI stability against upstream changes.
33-33: Useyarn --immutablefor reproducible installs
Switching to Yarn’s immutable install enforces lockfile consistency.
36-36: Standardized build step
Runningyarn buildaligns with the project’s Yarn-centric workflow.
43-47:Details
❓ Verification inconclusive
Update Changesets action for Yarn workflows
Usingyarn releaseandyarn run versionintegrates Changesets with Yarn scripts. AddingNPM_CONFIG_PROVENANCE=trueis a good step toward reproducible metadata, but please verify that this env var is honored in Yarn v4.
🏁 Script executed:
#!/bin/bash # Verify that Yarn v4 recognizes the npmConfigProvenance setting yarn config get npmConfigProvenanceLength of output: 176
Verify Yarn v4 honors NPM_CONFIG_PROVENANCE
You’ve addedNPM_CONFIG_PROVENANCE=truefor reproducible metadata, butyarn config get npmConfigProvenancedidn’t report a value (Yarn v4 doesn’t expose env-only configs viaconfig get). Please manually confirm that your release artifacts include the provenance metadata when running under Yarn v4. For example:
- Run
NPM_CONFIG_PROVENANCE=true yarn run version && yarn release --dry-run- Inspect the generated package metadata (e.g., the
.npmrcor provenance section) to ensure the setting was applied..github/workflows/ci.yml (7)
7-9: Apply concurrency control to CI runs
Ensures that only one CI workflow per branch/ref is active and stale runs are canceled.
17-21: Expand Node.js matrix to match engines
Testing against Node 18, 20, 22, and 24 aligns with the updatedpackage.jsonengines.
24-25: Pin checkout action for CI
Lockingactions/checkoutto a specific SHA enhances reproducibility.
27-31: Pin setup-node and enable Yarn caching
The pinnedactions/setup-nodeversion andcache: yarnsetting will speed up installs and avoid upstream surprises.
34-34: Reproducible install step
Usingyarn --immutableenforces lockfile integrity in CI.
37-37: Consolidated lint/test/build command
Switching fromnpm start validatetoyarn start validatekeeps scripts consistent.
40-42: Pin Codecov action and require token
Updating tocodecov-action@v5.4.2and explicitly providingCODECOV_TOKENimproves security and reliability.package.json (7)
4-14: Enhance project metadata and package format
Adding"type": "commonjs", expandedrepository,homepage,author,maintainers,license, andpackageManagerfields modernizes the package manifest.
21-31: Define published files and keywords
Setting"main": "dist/no-main.js","files": ["dist"], and an explicit"keywords"list ensures correct package contents and discoverability.
51-60: Upgrade and alias core dependencies
Introducing packages like@esm2cjs/indent-string,@prettier/eslintalias, and upgradingeslintto^9.26.0aligns this CLI with modern tooling.
71-79: Adopt standardized ESLint and Prettier configs
Adding@1stg/eslint-configand@1stg/prettier-configwith Jest plugins ensures consistent linting across the codebase.
85-85: Introduce build and release tooling
Addingnano-staged,prettier@^3.5.3,rimraf,simple-git-hooks,typescript-eslint, andyarn-berry-deduplicatemodernizes the pre-commit and build processes.Also applies to: 90-95
102-103: Update pre-commit hook to usenano-staged
Thepre-commithook runsyarn nano-staged && yarn start validate, matching the new linting flow.
100-100:Details
❓ Verification inconclusive
Centralize Prettier config
Pointing"prettier"to@1stg/prettier-config/semisimplifies formatting rules. Please verify that Prettier picks up this external preset.
🏁 Script executed:
#!/bin/bash # Verify Prettier finds the external config prettier --find-config-path .Length of output: 130
Centralize Prettier config
You’ve updated theprettierfield in package.json to point at@1stg/prettier-config/semi. To ensure Prettier picks up this external preset, please verify:
@1stg/prettier-configappears under devDependencies in package.json.- After running your install command (e.g.
npm install), execute:and confirm it returns the path tonpx prettier --find-config-path .
node_modules/@1stg/prettier-config/semi(notnull).- If it doesn’t resolve, inspect the package’s
package.json(its"main"or"exports") to ensure thesemipreset is correctly exported.File: package.json
Lines: 100"prettier": "@1stg/prettier-config/semi",
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #460 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 166 162 -4
Branches 29 25 -4
=========================================
- Hits 166 162 -4 ☔ 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.
Important
Looks good to me! 👍
Reviewed 49b88a9 in 1 minute and 11 seconds. Click for details.
- Reviewed
47lines of code in2files - Skipped
1files when reviewing. - Skipped posting
9draft 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. package.json:51
- Draft comment:
Removed dependencies 'arrify' and 'boolify'. Confirm they're no longer used elsewhere. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to confirm that the removed dependencies are no longer used elsewhere. This falls under the rule of not asking the author to confirm or double-check things. Therefore, this comment should be removed.
2. package.json:59
- Draft comment:
Downgraded 'get-stdin' from ^9.0.0 to ^8.0.0. Verify this change doesn't affect functionality. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is asking the PR author to verify that a downgrade in a dependency doesn't affect functionality. This falls under the rule of not asking the author to ensure behavior is intended or tested. The comment doesn't provide a specific suggestion or point out a specific issue with the code.
3. src/parser.js:6
- Draft comment:
Inline arrify function replicates the external module's behavior. Consider adding a brief comment for clarity. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. src/parser.js:243
- Draft comment:
Helper function 'coercePath' is declared after export. For clarity, consider moving it above the export statement. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
5. package.json:53
- Draft comment:
Remove 'arrify' dependency; replaced by inline implementation in src/parser.js. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, stating that a dependency has been removed and replaced by an inline implementation. It does not provide any actionable feedback or suggestions for improvement.
6. package.json:54
- Draft comment:
Remove unused 'boolify' dependency. - Reason this comment was not posted:
Comment looked like it was already resolved.
7. package.json:59
- Draft comment:
Downgrade 'get-stdin' to ^8.0.0; ensure API compatibility remains intact. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is about a dependency change, specifically downgrading a package version. The comment suggests ensuring API compatibility, which is a form of asking the author to double-check something. This violates the rules against commenting on dependency changes and asking for confirmation of intentions.
8. src/parser.js:6
- Draft comment:
Replace imported 'arrify' with an inline implementation; verify behavior matches the original module. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =30%<= threshold50%The comment suggests replacing an imported module with an inline implementation and asks to verify behavior. This violates the rule against asking the PR author to verify behavior. The suggestion to replace with an inline implementation could be useful, but the verification request is not allowed.
9. package.json:11
- Draft comment:
There is an unusual capitalization in the maintainer name "JounQin". Please confirm if this is the intended spelling or if it should be normalized (e.g., "Jounqin"). It might be a typo. - 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_slTBBCHPMbDJgfbB
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.
Important
Looks good to me! 👍
Reviewed 79672a6 in 36 seconds. Click for details.
- Reviewed
42lines of code in3files - Skipped
0files when reviewing. - Skipped posting
6draft 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. .github/workflows/autofix.yml:14
- Draft comment:
Correctly granting write permissions for contents in autofix workflow, matching security requirements. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. .github/workflows/ci.yml:11
- Draft comment:
Setting contents permission to read in CI workflow ensures minimal access; looks good. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. .github/workflows/pkg-pr-new.yml:11
- Draft comment:
Appropriate read permissions provided for publish workflow. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. .github/workflows/autofix.yml:14
- Draft comment:
Good: Explicit 'permissions: contents: write' is added as required for the autofix workflow. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. .github/workflows/ci.yml:11
- Draft comment:
Good: 'permissions: contents: read' is explicitly set, enforcing least privilege in the CI workflow. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. .github/workflows/pkg-pr-new.yml:11
- Draft comment:
Good: 'permissions: contents: read' is defined, aligning with best security practices in the publish workflow. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_hM0bj31lt7e8eJtM
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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 bfe1847 in 40 seconds. Click for details.
- Reviewed
27lines of code in3files - Skipped
0files when reviewing. - Skipped posting
6draft 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. .gitattributes:1
- Draft comment:
Explicitly enforcing LF line endings with 'eol=lf' is acceptable, but ensure this change doesn't impact any non-UNIX environments. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. .nvmrc:1
- Draft comment:
Updated Node version to 22.15.0 meets the requirement for Node 18+. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. .prettierignore:1
- Draft comment:
Review the changes to ignored paths; removal of node_modules, coverage, etc. is intentional and won't affect Prettier's behavior. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. .gitattributes:1
- Draft comment:
Combined rule now forces LF for all files. Confirm that applying eol=lf universally (instead of only for .js files) is intentional. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
5. .nvmrc:1
- Draft comment:
Node version bumped to 22.15.0. Verify that this higher version (beyond the stated 18+) meets project compatibility requirements. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
6. .prettierignore:1
- Draft comment:
Updated ignore patterns: removal of node_modules, .nyc_output, coverage, and dist; addition of .yarn. Confirm this aligns with the intended project structure and that no essential folders are now skipped. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_Ek25FXq2OrCSMwUE
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.
Important
Looks good to me! 👍
Reviewed ab24813 in 1 minute and 32 seconds. Click for details.
- Reviewed
97lines of code in5files - Skipped
0files when reviewing. - Skipped posting
14draft 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. .gitattributes:1
- Draft comment:
Consider confirming that forcing LF endings on all text files (* text=auto eol=lf) won't disrupt developers on Windows. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
2. .nvmrc:1
- Draft comment:
Bumping Node version to 22.15.0 is consistent with requiring Node 18+; ensure this matches your CI and documentation. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. .prettierignore:1
- Draft comment:
Removing common directories (node_modules, .nyc_output, coverage, dist) from the prettier ignore list may impact users with these files; confirm this change is intended. - Reason this comment was not posted:
Comment looked like it was already resolved.
4. CONTRIBUTING.md:11
- Draft comment:
Good update switching from npm to yarn commands; ensure all internal references and scripts align with Yarn usage. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. README.md:15
- Draft comment:
Removal of the Examples badge and updating LICENSE and CODE_OF_CONDUCT links appear correct. Verify that this removal is intentional and that corresponding documentation elsewhere is updated. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
6. .gitattributes:1
- Draft comment:
The consolidated setting '* text=auto eol=lf' now applies to all files. Please double‐check that removing the explicit '*.js' rule doesn’t inadvertently affect file types (e.g. binary or generated files) that might need different handling. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to double-check the impact of a change, which violates the rule against asking for confirmation or double-checking. It does not provide a specific suggestion or point out a clear issue.
7. .nvmrc:1
- Draft comment:
Bumping the Node version from 16.20.2 to 22.15.0 is a significant change. Make sure this upgrade is intentional and that the documentation and contributor guidelines reflect the new Node requirement. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is related to a dependency change, specifically the Node version. The comment asks the author to ensure the upgrade is intentional and to update documentation and guidelines, which violates the rules against asking for confirmation or updates to documentation.
8. .prettierignore:1
- Draft comment:
The ignore patterns have been revised—removing directories like 'node_modules', '.nyc_output', 'coverage', and 'dist' while adding '.yarn' and 'test/fixtures'. Confirm that these changes are intentional and won’t cause unintended formatting of generated or dependency files. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
9. CONTRIBUTING.md:11
- Draft comment:
The instructions have been updated from npm to yarn commands, which is clear and consistent. Please ensure that all referenced scripts (e.g. 'yarn start validate', 'yarn start test.update', etc.) are correctly defined in the project configuration. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
10. README.md:314
- Draft comment:
The links for LICENSE, Code of Conduct, and Roadmap have been updated and the Examples badge removed. Verify that removing the Examples section is intentional and that no essential documentation has been lost. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
11. CONTRIBUTING.md:61
- Draft comment:
Typographical error: Consider changing 'on you pull request' to 'on your pull request' for correct grammar. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and focuses on a typographical error, which does not impact the functionality or logic of the code. It does not provide a code suggestion or address a potential issue in the code itself.
12. CONTRIBUTING.md:74
- Draft comment:
Typographical error: 'Please checkout the [the open issues]' contains a duplicated 'the'. Consider removing one for clarity. - 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.
13. README.md:229
- Draft comment:
Typo: In the heading '### Knowed integrated package helpers', 'Knowed' should be corrected to 'Known'. - 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.
14. README.md:173
- Draft comment:
Typo: The word 'usefull' should be corrected to 'useful'. - 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_pcz02KAqDf0ckxez
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.
Important
Looks good to me! 👍
Reviewed ff202c9 in 1 minute and 58 seconds. Click for details.
- Reviewed
117lines of code in6files - Skipped
1files when reviewing. - Skipped posting
17draft 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. .gitattributes:1
- Draft comment:
Ensure adding 'eol=lf' globally won’t affect files with intentional CRLF. Usually ok, but consider verifying on Windows. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
2. .nvmrc:1
- Draft comment:
Updated Node version to 22.15.0; verify that other tooling supports this version. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
3. .prettierignore:1
- Draft comment:
Review removal of common ignores (node_modules, nyc_output, coverage, dist). Confirm this change is intentional since now only '.yarn' and 'test/fixtures' are ignored. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This comment violates several rules. It's asking for confirmation of intention ("Confirm this change is intentional"). It's also speculative - it's not pointing out a definite issue, just asking if the author meant to do this. The author clearly made these changes deliberately, and if there are issues it would show up in the build or formatting checks. Maybe removing these common ignores could cause real formatting issues in the codebase that should be flagged? If removing these ignores caused actual problems, it would be caught by the build process when Prettier runs. We don't need to speculatively ask about it. Delete this comment as it's asking for confirmation of intention and making speculative concerns rather than pointing out a definite issue.
4. CONTRIBUTING.md:11
- Draft comment:
Updated instructions from npm to yarn commands; please double-check that all commands (including test updates and contributor scripts) work as expected. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
5. README.md:313
- Draft comment:
Links to LICENSE, CODE_OF_CONDUCT, and ROADMAP have been updated. Confirm that these updated paths reflect the repository structure. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
6. package.json:75
- Draft comment:
Replacing 'patch-package' with '@unts/patch-package' in devDependencies is noted. Please verify that the prepare script’s call to 'patch-package' still correctly resolves to the new package’s binary. - 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 a script still works after a dependency change. This falls under asking the author to double-check things, which is against the rules.
7. .gitattributes:1
- Draft comment:
Good consolidation of text settings; adding 'yarn.lock -diff' is a neat way to suppress diff noise for lock files. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
8. .nvmrc:1
- Draft comment:
Bumping the Node version from 16.20.2 to 22.15.0 aligns with the new engine requirements in package.json. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
9. .prettierignore:1
- Draft comment:
The ignore list is now limited to '.yarn' and 'test/fixtures'. Confirm that removal of common directories (like node_modules, coverage, and dist) is intentional to avoid formatting build or dependency files. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This comment violates several rules. It's asking for confirmation/verification rather than pointing out a clear issue. It's also about dependency/build related files which we're told to ignore. The author likely had a good reason for changing these patterns. The removal of node_modules could lead to performance issues with Prettier trying to format dependency files. Maybe this is a legitimate concern? Per the rules, we should not comment on dependency-related changes, and we should not ask for confirmations. The author must have intentionally made this change. This comment should be deleted as it violates rules about asking for confirmations and commenting on dependency/build related changes.
10. CONTRIBUTING.md:10
- Draft comment:
Updated commands from npm to yarn, which aligns with the updated project tooling. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
11. README.md:312
- Draft comment:
Updated link references for LICENSE and CODE_OF_CONDUCT (and removal of the Examples badge) make the docs cleaner and more accurate. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
12. package.json:75
- Draft comment:
The dependency switch from 'patch-package' to '@unts/patch-package' should be verified to ensure compatibility with existing patches. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
13. CONTRIBUTING.md:61
- Draft comment:
Typographical error: 'on you pull request' should be corrected to 'on your pull request'. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and focuses on a typographical error in a non-code part of the pull request. It doesn't provide any code suggestions or improvements.
14. CONTRIBUTING.md:74
- Draft comment:
Typographical error: Duplicate article in 'checkout the [the open issues]'. Consider revising to 'checkout the [open issues]'. - 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.
15. README.md:173
- Draft comment:
Typo: 'usefull' should be corrected to 'useful'. - 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.
16. README.md:230
- Draft comment:
Typographical error: 'Knowed integrated package helpers' should be 'Known integrated package helpers'. - 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.
17. package.json:78
- Draft comment:
The dependency '@unts/patch-package' appears to be a potential typo. Please double-check if this is the intended package name, or if it should instead be 'patch-package' (as was previously used). - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is asking the PR author to double-check the dependency name, which is not allowed according to the rules. It is not making a specific code suggestion or asking for a test to be written. Therefore, it should be removed.
Workflow ID: wflow_UrHLMMLhS1TQNJ2A
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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: 2
♻️ Duplicate comments (3)
__mocks__/fs.js (1)
21-21: Better error message formatting with template literalsThe change to use template literals for the error message improves readability and is consistent with modern JavaScript practices.
jest.config.js (1)
4-5: Non-standard JSDoc import syntax.The JSDoc block uses
@import { Config } from 'jest'which is non-standard syntax for type imports in JSDoc. Consider revising this to a more conventional format.Replace with one of these standard approaches:
- @type {Config} - @import { Config } from 'jest' + @type {import('jest').Config}Or:
- @type {Config} - @import { Config } from 'jest' + @typedef {import('jest').Config} Config + @type {Config}src/message.spec.js (1)
1-1:⚠️ Potential issueFix typographical error in ESLint directive
The ESLint directive appears to contain a typographical error:
import-x/namespaceshould likely beimport/namespace, which is the standard ESLint rule name for this purpose.-/* eslint import-x/namespace: [2, { allowComputed: true }] */ +/* eslint import/namespace: [2, { allowComputed: true }] */
🧹 Nitpick comments (2)
babel.config.js (1)
7-7: Update Node.js target in Babel configurationSince the project is being updated to require Node.js 18+ (as seen in
.nvmrcand PR objectives), consider updating the Babel target from Node 12 to at least Node 18 to maintain consistency.- node: '12', + node: '18',.github/workflows/pkg-pr-new.yml (1)
3-5: Consider refining workflow triggers to avoid duplicate runsThis workflow is configured to run on both
pushandpull_requestevents, which could lead to duplicate runs when a PR is created or updated (as both events would trigger). Consider using more specific event triggers or conditions to prevent unnecessary workflow executions.on: - - push - - pull_request + push: + branches: + - main + pull_request: + types: [opened, synchronize]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
.yarn/plugins/plugin-prepare-lifecycle.cjsis excluded by!**/.yarn/**.yarn/releases/yarn-4.9.1.cjsis excluded by!**/.yarn/**src/__snapshots__/uncaught-exception-handler.spec.js.snapis excluded by!**/*.snapyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (41)
.changeset/dry-cobras-fold.md(1 hunks).changeset/pre.json(1 hunks).codesandbox/ci.json(1 hunks).eslintignore(0 hunks).eslintrc.js(0 hunks).gitattributes(1 hunks).github/FUNDING.yml(1 hunks).github/workflows/autofix.yml(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/pkg-pr-new.yml(1 hunks).github/workflows/release.yml(1 hunks).github/workflows/stale.yml(1 hunks).gitignore(1 hunks).npmrc(0 hunks).nvmrc(1 hunks).prettierignore(1 hunks).yarnrc.yml(1 hunks)CONTRIBUTING.md(3 hunks)README.md(1 hunks)__mocks__/fs.js(1 hunks)__mocks__/glob.js(5 hunks)__mocks__/prettier-eslint.js(1 hunks)babel.config.js(1 hunks)eslint.config.mjs(1 hunks)jest.config.js(2 hunks)other/EXAMPLES.md(0 hunks)other/manual-releases.md(0 hunks)package-scripts.js(1 hunks)package.json(2 hunks)src/argv.js(1 hunks)src/format-files.js(14 hunks)src/format-files.spec.js(15 hunks)src/index.js(1 hunks)src/message.spec.js(1 hunks)src/messages.js(1 hunks)src/parser.js(12 hunks)src/prettier-eslint.js(1 hunks)src/uncaught-exception-handler.js(1 hunks)src/uncaught-exception-handler.spec.js(3 hunks)test/override-config.js(1 hunks)test/tests/cli.spec.js(10 hunks)
💤 Files with no reviewable changes (5)
- other/EXAMPLES.md
- .eslintignore
- other/manual-releases.md
- .npmrc
- .eslintrc.js
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/uncaught-exception-handler.js (4)
src/index.js (1)
logger(11-11)src/prettier-eslint.js (1)
logger(3-3)src/format-files.js (1)
logger(35-35)src/uncaught-exception-handler.spec.js (3)
logger(6-6)logger(31-31)logger(40-40)
src/format-files.spec.js (1)
src/format-files.js (1)
globOptions(219-219)
src/format-files.js (3)
__mocks__/prettier-eslint.js (1)
format(8-17)src/index.js (1)
logger(11-11)src/prettier-eslint.js (1)
logger(3-3)
🔇 Additional comments (91)
README.md (3)
316-316: Update license link path
Removed theother/prefix so that the[license]badge points toLICENSEat the repository root.
322-322: Update Code of Conduct link path
Removed theother/prefix so that the[coc]badge now links toCODE_OF_CONDUCT.mdat the repository root.
324-324: Update Roadmap link path
Removed theother/prefix so that the[roadmap]badge now referencesROADMAP.mdat the repository root..github/FUNDING.yml (1)
15-15:Details
✅ Verification successful
Verify updated Afdian funding URL.
The custom funding link for
JounQinwas changed tohttps://afdian.com/a/JounQin. Please confirm this URL is correct, reachable, and directs to the intended sponsorship page.
🏁 Script executed:
#!/bin/bash # Verify the Afdian URL returns HTTP 200 curl -s -o /dev/null -w "%{http_code}" https://afdian.com/a/JounQinLength of output: 73
Afdian funding URL verified and reachable
The URL
https://afdian.com/a/JounQinreturns HTTP 200, confirming it’s accessible and directs to the intended sponsorship page. No further action required.
File:.github/FUNDING.yml(Line 15).nvmrc (1)
1-1: Node.js version updated to 22.15.0This upgrade aligns with the PR objective to require Node.js version 18+ and modernize the project's tooling environment.
babel.config.js (1)
10-13: LGTM: Improved code formatting with trailing commasThe addition of trailing commas improves code consistency and aligns with modern JavaScript style practices.
src/uncaught-exception-handler.js (1)
32-32: LGTM: Improved code formatting with trailing commasThe addition of trailing commas improves code consistency and aligns with modern JavaScript style practices.
Also applies to: 39-39
.gitattributes (1)
1-2: LGTM: Git attributes correctly configured for cross-platform developmentThe changes properly configure:
- Consistent line endings (LF) across all text files
- Disabled diff generation for yarn.lock to reduce noise in PRs
These changes align with the project's transition to Yarn and modern development practices.
__mocks__/prettier-eslint.js (1)
7-7: Whitespace change looks goodThis is a minor formatting adjustment that improves code readability without changing functionality, consistent with the PR's goal of enhancing code consistency.
src/argv.js (1)
7-7: Trailing comma addition looks goodAdding the trailing comma follows modern JavaScript conventions and improves consistency in the codebase. This change has no functional impact but makes future diffs cleaner.
src/uncaught-exception-handler.spec.js (3)
2-2: Improved import organizationAdding a blank line between import groups improves readability by visually separating different types of imports.
20-20: Trailing comma addition is goodAdding the trailing comma follows modern JavaScript conventions and improves consistency in the codebase.
56-56: Good removal of unused error variableRemoving the unused
evariable in the catch block is a good practice that aligns with modern JavaScript and linting standards. Empty catch blocks with no reference to the error are cleaner when you're intentionally ignoring the error.__mocks__/fs.js (3)
9-9: Good addition of ESLint flat config supportThe change to include
eslint.config.in the file path check ensures that the fs mock correctly handles both traditional.eslintrcfiles and the new ESLint v9 flat configuration files. This directly supports the PR's main objective.Using
includes()instead ofindexOf() !== -1also improves code readability.
13-13: Improved string checking with includes()Replacing
indexOf() !== -1withincludes()is a good modernization that makes the code more readable while maintaining the same functionality.Also applies to: 17-17
24-24: Simplified readdirSync mockThe concise arrow function implementation is cleaner and maintains the same functionality. This is a good simplification.
jest.config.js (1)
18-20: LGTM: Improved formatting with trailing commas.Adding trailing commas improves consistency and makes future changes cleaner in version control.
.codesandbox/ci.json (1)
2-2: LGTM: Node.js version updated to 18.This update aligns with the project-wide Node.js version upgrade and ensures compatibility with ESLint v9 and other updated dependencies.
.prettierignore (2)
1-1: LGTM: Added .yarn to ignore list.Adding
.yarnto the ignore list aligns with the new Yarn 4 configuration.
1-3:Details
❓ Verification inconclusive
Verify removal of standard ignore directories.
Common directories like
node_modules,coverage, anddisthave been removed from the ignore list. Please confirm this is intentional as these are typically excluded from Prettier formatting.
🏁 Script executed:
#!/bin/bash # Check if other configuration files might be handling these ignore patterns echo "Checking .gitignore for common ignore patterns:" if [ -f .gitignore ]; then grep -E "node_modules|coverage|dist|.nyc_output" .gitignore fi echo -e "\nChecking for eslint.config.mjs ignore patterns:" if [ -f eslint.config.mjs ]; then grep -E "ignores|ignorePath|ignorePatterns" eslint.config.mjs fi echo -e "\nChecking package.json for prettier configuration:" if [ -f package.json ]; then grep -A 10 "prettier" package.json fiLength of output: 3200
.prettierignore missing standard ignore patterns
The
.prettierignorefile now only excludes:.yarn test/fixtures—but no longer ignores the usual directories (
node_modules,coverage,dist) that are still listed in.gitignore. This may cause Prettier to format files in those folders.Please confirm whether dropping these patterns was intentional. If not, consider restoring them, e.g.:
.yarn test/fixtures +node_modules +coverage +distFiles to review:
- .prettierignore (lines 1–3)
- .gitignore (to see existing ignore patterns)
test/override-config.js (1)
3-4: LGTM: Added trailing commas for consistent formatting.Adding trailing commas improves maintainability and makes future changes cleaner in version control by reducing diff noise.
.changeset/pre.json (1)
1-8: Changeset pre-release configuration is correctly setupThe configuration properly sets up an alpha pre-release track for the
prettier-eslint-clipackage with version 8.0.1 as the starting point, which aligns with the major version bump specified in the changeset file..changeset/dry-cobras-fold.md (1)
1-5: Major version bump is appropriately documentedThe changeset correctly specifies a major version bump with the conventional commit syntax "feat!" indicating a breaking change for ESLint v9 flat config support. This is consistent with the project objectives.
CONTRIBUTING.md (5)
11-11: Package manager migration: npm to yarnThe replacement of npm commands with yarn commands is consistent with the project's migration to Yarn as the primary package manager.
12-12: Package manager command updated consistentlyChanged npm start validate to yarn start validate, maintaining the same functionality while updating to the new package manager.
15-15: Updated nps command referenceThe help command reference is properly updated to use yarn while maintaining the same nps functionality.
41-41: Contributors command updatedThe all-contributors command is correctly updated to use yarn instead of npm.
58-58: Test update command migrated to yarnThe snapshot test update command is properly converted to use yarn while preserving the same functionality.
src/messages.js (3)
5-5: Export order changed for alphabetizationThe export order has been changed to alphabetical order (
failure,success,unchanged). This is a style improvement that makes exports easier to locate and is consistent with common JavaScript conventions.
10-10: Added trailing comma for better maintainabilityAdding a trailing comma in the template string argument improves git diff readability for future changes and is consistent with modern JavaScript style conventions.
17-17: Consistent trailing comma style appliedSimilarly to line 10, a trailing comma has been added here for consistency and to improve future diff readability.
.yarnrc.yml (1)
1-10:Details
✅ Verification successful
Yarn configuration aligns with project modernization
The new Yarn configuration file correctly sets up the modern Yarn environment with appropriate settings:
- Telemetry disabled for privacy
- Node modules linking strategy specified
- Prepare lifecycle plugin properly configured with security checksum
- Specific Yarn version pinned for consistency
It's good practice to verify the plugin checksum. Run this script to validate the plugin file against its expected checksum:
🏁 Script executed:
#!/bin/bash # Verify the checksum of the Yarn plugin if [ -f ".yarn/plugins/plugin-prepare-lifecycle.cjs" ]; then echo "Calculating SHA-512 checksum of plugin file..." shasum -a 512 .yarn/plugins/plugin-prepare-lifecycle.cjs echo "Compare this with the checksum in .yarnrc.yml" else echo "Plugin file not found in .yarn/plugins/" fiLength of output: 415
Let’s compute the SHA-512 using Python (since
shasumisn’t available):
🏁 Script executed:
#!/bin/bash # Verify SHA-512 checksum of the Yarn plugin via Python if [ -f ".yarn/plugins/plugin-prepare-lifecycle.cjs" ]; then echo "Calculating SHA-512 checksum of plugin file via Python..." python3 - << 'EOF' import hashlib with open('.yarn/plugins/plugin-prepare-lifecycle.cjs','rb') as f: h = hashlib.sha512() for chunk in iter(lambda: f.read(8192), b''): h.update(chunk) print(h.hexdigest()) EOF echo "Compare this output with the checksum in .yarnrc.yml" else echo "Plugin file not found in .yarn/plugins/" fiLength of output: 436
✅ Plugin checksum verified and Yarn configuration approved
All settings are correct and the SHA-512 checksum of
plugin-prepare-lifecycle.cjsmatches the value in.yarnrc.yml.
- Telemetry is disabled for privacy
nodeLinker: node-modulesis specified- Prepare-lifecycle plugin is configured with a valid checksum
- Yarn version is pinned for consistency
src/prettier-eslint.js (2)
8-8: Improved catch block syntaxThe error parameter was removed from the catch block since it's not being used, which is a good practice to avoid unused variables.
12-12: Consistent trailing comma styleAdding the trailing comma to the string improves consistency with the codebase style and makes future additions cleaner.
__mocks__/glob.js (1)
8-8: Consistent trailing comma usageAll array elements and string concatenations now have trailing commas, ensuring consistent code style throughout the codebase. This improves readability and produces cleaner diffs when changes are made in the future.
Also applies to: 17-17, 25-25, 45-45, 54-54, 63-63, 71-71, 78-78, 84-84
src/index.js (2)
3-4: Removed unnecessary ESLint directiveThe ESLint directive for disabling the "import/no-unassigned-import" rule was removed as it's no longer needed with the new ESLint v9 flat configuration. This aligns with the PR's goals of modernizing the linting setup.
6-9: Optimized import orderingThe imports have been reordered to group related functionality, with formatFiles now imported before parser. This improves code organization and readability.
src/message.spec.js (2)
9-10: LGTM: Style improvements with trailing commasAdding trailing commas to the end of object properties and array elements is a good practice that minimizes diff changes in version control when new items are added later.
Also applies to: 13-14, 19-20, 23-24, 29-30, 33-35
38-44: LGTM: Improved iteration with for...of loopsRefactoring from nested
forEachcalls to nestedfor...ofloops is a good change. This approach can make debugging easier since you can usebreakandcontinuestatements if needed, and it slightly improves performance over array methods.package-scripts.js (1)
55-55: LGTM: Updated format script for ESLint v9 compatibilityThe format script has been appropriately updated to:
- Add
.mjsfile extension support, which is necessary for ESLint v9 flat config files- Remove the explicit
.eslintrc.jsreference since this file is being removed as part of migrating to ESLint's flat config formatThese changes align perfectly with the PR objective to support ESLint v9's flat configuration.
.gitignore (1)
8-10: LGTM: Yarn 2+ (Berry) specific ignore patternsThe added Yarn-specific patterns correctly follow modern Yarn 2+ practices where:
- Most of the
.yarn/directory is ignored.yarn/releasesand.yarn/pluginsare explicitly included in version controlThis is the recommended approach for Yarn 2+ projects and aligns with the PR's dependency modernization efforts.
.github/workflows/pkg-pr-new.yml (3)
11-12: LGTM: Security best practice with explicit permissionsExplicitly setting minimal permissions (
contents: read) is a security best practice for GitHub Actions workflows. This limits the scope of what the workflow can access, reducing potential security risks.
22-27: LGTM: Proper Node.js setup with cachingThe workflow correctly sets up Node.js with the latest LTS version and enables Yarn caching, which helps improve workflow performance by reusing cached dependencies across runs.
28-35: LGTM: Efficient build and publish processThe workflow efficiently handles dependencies, building, and publishing the package:
- Uses
--immutableflag for deterministic installations- Builds the project before publishing
- Uses
dlxto run the publishing tool without installing it globallyThis approach follows modern CI/CD best practices.
.github/workflows/autofix.yml (1)
1-42: Good implementation of the autofix.ci workflowThe workflow is properly configured with necessary permissions, concurrency control, and pinned action versions. The implementation follows security best practices by explicitly setting permissions and using immutable Yarn installation.
src/parser.js (3)
1-1: Good update to use explicit Node.js module specifierUsing the
node:pathformat follows current Node.js best practices for importing built-in modules.
6-16: Nice implementation of local arrify functionReplacing the external dependency with a local implementation reduces package dependencies and improves maintainability.
35-237: Good formatting and documentation improvementsThe consistent addition of trailing commas and improved documentation strings throughout the file enhances code readability and maintainability.
.github/workflows/release.yml (2)
8-16: Good workflow security improvementsThe addition of concurrency controls and explicit permissions follows GitHub Actions best practices and improves security.
23-47: Great modernization of the release processUpdating to pinned action versions and switching to Yarn with immutable installations improves reproducibility. The addition of NPM provenance is also a good security practice.
.github/workflows/stale.yml (1)
1-29: Well-configured stale issue management workflowThis workflow follows best practices for GitHub Actions with appropriate permissions, concurrency settings, and pinned action versions. The stale issue management will help maintain repository cleanliness.
src/format-files.spec.js (4)
1-16: Good mock standardization approachThe approach to standardize filesystem mocking by using the same mock for both
fsandnode:fsensures consistent behavior across the test suite.
40-42: Improved test robustness for cross-platform compatibilityThe updated regular expressions that handle Unicode line terminators improve test reliability across different platforms and environments.
Also applies to: 96-101, 126-131, 222-224, 236-238, 256-258, 270-272
280-286: Better promise handling in testsUsing
await expect(...).resolves.not.toThrow()pattern is a more robust way to test that async operations don't throw exceptions.
332-333: Updated for ESLint v9 flat configThe test has been correctly updated to use the new ESLint v9 flat config file
eslint.config.mjsinstead of the legacy.eslintrcformat..github/workflows/ci.yml (8)
7-9: Good addition of concurrency control!Adding concurrency control prevents redundant CI runs on the same branch and improves CI efficiency by canceling in-progress runs when new commits are pushed.
11-12: Explicit permissions follow security best practicesSetting explicit permissions to read-only follows the principle of least privilege, which is a security best practice for GitHub Actions workflows.
20-24: Appropriate Node.js version updatesThe updated Node.js matrix aligns with the Node.js engine requirement specified in
package.json(18.18.0+). Testing across multiple Node.js versions (18, 20, 22, 24) ensures broad compatibility.
27-28: Security improvement: Pinning action to specific commit hashPinning the checkout action to a specific commit hash rather than a version tag is a security best practice that prevents supply chain attacks.
30-34: Improved Node.js setup with Yarn cachingUsing an updated setup-node action with Yarn caching will significantly improve CI performance by avoiding redundant dependency downloads.
36-37: Migration from npm to Yarn package managerSwitching from
npm itoyarn --immutableis consistent with the project's migration to Yarn as the package manager. The--immutableflag ensures reproducible installs.
39-40: Updated script execution for better consistencyChanging from
npm start validatetoyarn start validatemaintains consistency with the package manager choice throughout the workflow.
42-45: Updated codecov action with explicit tokenUpgrading the codecov action and using an explicit token parameter from secrets follows current best practices for the codecov integration.
test/tests/cli.spec.js (7)
2-5: Improved import organization and styleThe changes use explicit
node:specifiers for Node.js core modules and consolidated imports fromcommon-tags, which improves import clarity and follows modern Node.js best practices.
14-14: Enhanced readability with numeric separatorUsing the numeric separator in
20_000for the Jest timeout improves readability while maintaining the same functionality.
46-47: Standardized formatting with trailing commaAdding trailing commas in function arguments improves consistency across the codebase and makes future diffs cleaner when adding new items to lists.
107-108: Updated test to use globalThis instead of windowThe replacement of
window.bazwithglobalThis.bazin the expected output is appropriate since Node.js doesn't have awindowobject.globalThisprovides a standardized way to reference the global this value across environments.
138-138: Simplifying error handling with a catch-all blockUsing a simpler
catchblock without explicitly naming the error is sufficient here since the error is directly passed to the snapshot assertion.
149-151: Improved error handling generalizationRemoving the specific
error.stderrreference in favor of directly using the error object makes the error handling more general and robust, especially for different types of errors that might be thrown.
200-202: Enhanced string replacement using replaceAllUsing
replaceAllinstead of regex with the global flag is a more modern and readable approach for string replacement.eslint.config.mjs (5)
1-7: Good ESLint flat config implementationThe new ESLint configuration uses the modern flat config format introduced in ESLint v9, properly importing dependencies and implementing TypeScript ESLint configuration.
8-13: Well-structured configuration with appropriate ignore patternsThe configuration extends from base configs and includes appropriate ignore patterns. The pattern
'!test/fixtures/paths/node_modules/**/*.js'correctly includes JavaScript files in nested node_modules for testing purposes while ignoring other fixtures.
14-35: Comprehensive rule configurationThe rules configuration disables conflicting rules (like
prettier/prettier), sets appropriate code style rules, and configures import and arrow function behavior consistently.
36-45: Appropriate test file overridesThe test file configuration correctly includes Jest globals and disables rules that would be problematic in test contexts, such as
no-magic-numbersandsonarjs/slow-regex.
46-51: Specific override for src/index.jsDisabling the
n/hashbangrule specifically forsrc/index.jsis appropriate since this file likely contains a shebang line for CLI execution.src/format-files.js (9)
1-5: Improved import organization with explicit Node.js specifiersUsing
node:prefixes for core modules is a best practice that makes it clear these are Node.js built-in modules and helps prevent confusion with similarly named npm packages.
4-14: Updated dependencies and import structureThe changes replace
chalkwithchalk-cjs, use@esm2cjs/indent-stringinstead ofindent-string, and reorganize RxJS imports for better clarity. These changes align with the project's dependency updates inpackage.json.
18-18: Added constant for consistent indentationAdding the
INDENT_COUNTconstant ensures consistent indentation across error messages and improves maintainability.
20-20: Improved line separator regex patternThe updated regex pattern properly handles different line ending styles (CR, LF, CRLF) without unnecessary capturing groups.
81-89: Enhanced function call formattingImproved formatting with one argument per line and consistent trailing commas makes the code more readable and leads to cleaner diffs when arguments change in the future.
91-108: Simplified async/await pattern in formatStdinThe function now properly uses async/await throughout, making the code flow more readable and consistent. The error handling maintains the same behavior while using the new
INDENT_COUNTconstant for error formatting.
232-235: Improved condition readabilityThe conditional logic was refactored to be more expressive by using a negative condition directly in the return statement, which makes the code more concise while maintaining the same behavior.
255-263: Enhanced RxJS operator formattingThe RxJS pipe operators are now consistently formatted with proper indentation, making the reactive data flow easier to understand.
349-349: Using consistent line separator for file readingThe file now uses the updated
LINE_SEPARATOR_REGEXconstant when splitting lines from ignore files, ensuring consistent handling of different line ending styles.package.json (7)
4-14: Add CommonJS module type and update project metadata
The new"type": "commonjs"and enriched metadata fields (repository, homepage, author, maintainers, license, packageManager) correctly reflect the migration to Yarn Berry and ESLint v9 flat config.
16-17: Align Node.js engine range with ESLint's requirements
Requiring Node.js^18.18.0 || ^20.9.0 || >=21.1.0follows ESLint v9’s own engine strategy and ensures compatibility across supported versions.
21-24: Reposition main field and restrict published files
Moving"main"and adding a"files": ["dist"]array cleanly scopes the package to compiled artifacts only.
25-31: Update project keywords
The expanded keyword list enhances discoverability in npm registries while remaining on-point for this CLI tool.
34-41: Modernize npm scripts for Yarn Berry workflows
Scripts (format,prepare,release,test,version) have been updated to usenps,simple-git-hooks, andyarn-berry-deduplicate. Please verify that thepatch-packageCLI is correctly resolved (especially if relying on@unts/patch-package).
51-67: Upgrade runtime dependencies
Dependencies have been bumped to support ESLint v9 flat config (e.g.,eslint@^9.26.0,@prettier/eslint@^17.0.0-alpha.0,chalk-cjs,@esm2cjs/indent-string). These changes align with the PR objectives.
95-100: Configure nano-staged and simple-git-hooks
Thenano-stagedpattern andpre-commithook (yarn nano-staged && yarn start validate) integrate formatting/validation nicely. Ensure the glob covers all relevant file types and thatvalidatemaps to a definednpstask.
Signed-off-by: JounQin <admin@1stg.me>
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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
♻️ Duplicate comments (7)
src/message.spec.js (1)
1-1: Verify the ESLint rule name.The ESLint directive has been changed from
import/namespacetoimport-x/namespace. This appears to be a typographical error, as standard ESLint plugin rules typically use the formatimport/namespace. This matches the observations from previous review comments./* eslint import/namespace: [2, { allowComputed: true }] */__mocks__/fs.js (1)
21-22: Improved error message with template literalsUsing template literals for the error message improves readability.
.gitignore (1)
5-7: Remove duplicate.*cacheentryThere's a duplicate
.*cachepattern on lines 5 and 7. Having the same pattern twice in a .gitignore file is unnecessary and should be removed.coverage dist node_modules .DS_Store .*cache *.log -.*cache .yarn/* !.yarn/releases !.yarn/pluginsjest.config.js (1)
4-5: Non-standard JSDoc import syntaxThe JSDoc block uses
@import { Config } from 'jest'which is non-standard syntax for type imports in JSDoc. Consider revising this to a more conventional format:- @type {Config} - @import { Config } from 'jest' + @type {import('jest').Config}src/format-files.js (1)
20-20: Fixed regular expression for line separationThe variable was renamed from
LINE_SEPERATOR_REGEXtoLINE_SEPARATOR_REGEX(fixing the typo) and the pattern was improved.package.json (2)
16-16: Node.js engine requirement
The Node.js engine range matches ESLint's strategy for v9 support.
69-93: Check for typos in devDependencies
Entries such as@unts/patch-packageandtypescript-eslintlikely contain typos and may cause resolution failures. Please confirm and update:- "@unts/patch-package": "^8.1.1", + "patch-package": "^8.1.1", - "typescript-eslint": "^8.32.0" + // e.g., "@typescript-eslint/parser": "^8.32.0" and/or "@typescript-eslint/eslint-plugin": "^8.32.0"
🧹 Nitpick comments (3)
.github/workflows/pkg-pr-new.yml (1)
3-5: Consider refining the workflow trigger conditions.The workflow currently runs on both
pushandpull_requestevents, which might cause duplicate runs when PRs are updated with new commits. Consider refining the triggers to avoid this overlap:on: - - push - - pull_request + push: + branches: [main] + pull_request: + branches: [main]Alternatively, you could use conditional steps to avoid duplicate operations.
.github/workflows/stale.yml (1)
25-28: Consider adding more informative stale messagesThe current stale messages are quite terse. Consider providing more context about why the item is being marked as stale and what actions users can take.
- stale-issue-message: 'Stale issue' - stale-pr-message: 'Stale pull request' + stale-issue-message: 'This issue has been automatically marked as stale due to lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' + stale-pr-message: 'This pull request has been automatically marked as stale due to lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'package.json (1)
95-97: Refactor nano-staged pattern for broader tool compatibility
Most glob libraries support brace expansion over extglob. To ensure all files match consistently, consider:- "*.+(js|json|md|mjs|yml)": "node ./dist --write" + "*.{js,json,md,mjs,yml}": "node ./dist --write"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
.yarn/plugins/plugin-prepare-lifecycle.cjsis excluded by!**/.yarn/**.yarn/releases/yarn-4.9.1.cjsis excluded by!**/.yarn/**src/__snapshots__/uncaught-exception-handler.spec.js.snapis excluded by!**/*.snapyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (41)
.changeset/dry-cobras-fold.md(1 hunks).changeset/pre.json(1 hunks).codesandbox/ci.json(1 hunks).eslintignore(0 hunks).eslintrc.js(0 hunks).gitattributes(1 hunks).github/FUNDING.yml(1 hunks).github/workflows/autofix.yml(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/pkg-pr-new.yml(1 hunks).github/workflows/release.yml(1 hunks).github/workflows/stale.yml(1 hunks).gitignore(1 hunks).npmrc(0 hunks).nvmrc(1 hunks).prettierignore(1 hunks).yarnrc.yml(1 hunks)CONTRIBUTING.md(3 hunks)README.md(1 hunks)__mocks__/fs.js(1 hunks)__mocks__/glob.js(5 hunks)__mocks__/prettier-eslint.js(1 hunks)babel.config.js(1 hunks)eslint.config.mjs(1 hunks)jest.config.js(2 hunks)other/EXAMPLES.md(0 hunks)other/manual-releases.md(0 hunks)package-scripts.js(1 hunks)package.json(2 hunks)src/argv.js(1 hunks)src/format-files.js(14 hunks)src/format-files.spec.js(15 hunks)src/index.js(1 hunks)src/message.spec.js(1 hunks)src/messages.js(1 hunks)src/parser.js(12 hunks)src/prettier-eslint.js(1 hunks)src/uncaught-exception-handler.js(1 hunks)src/uncaught-exception-handler.spec.js(3 hunks)test/override-config.js(1 hunks)test/tests/cli.spec.js(10 hunks)
💤 Files with no reviewable changes (5)
- .npmrc
- other/EXAMPLES.md
- .eslintignore
- .eslintrc.js
- other/manual-releases.md
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/format-files.spec.js (1)
src/format-files.js (1)
globOptions(219-219)
🔇 Additional comments (97)
README.md (3)
316-316: Update LICENSE link to new path
The “other/” prefix has been removed to match relocation of the LICENSE file. Please verify that the link still points to the correctLICENSEin the repository root.
322-322: Correct CODE_OF_CONDUCT link path
Removed the outdatedother/subdirectory from the CODE_OF_CONDUCT link. Ensure the file is now available at the updated location.
324-324: Adjust ROADMAP link to reflect file relocation
The “other/” prefix has been dropped for the ROADMAP link. Confirm thatROADMAP.mdexists at the new path..github/FUNDING.yml (1)
15-15: URL updated to the correct domainThe funding URL has been updated from "afdian.net/@JounQin" to "afdian.com/a/JounQin", reflecting the current valid domain and path format for this funding platform.
test/override-config.js (1)
3-4: Added trailing commas for better maintainabilityAdding trailing commas after the last items in objects and arrays is a good practice as it:
- Creates cleaner diffs when adding new items
- Reduces syntax errors during future modifications
- Aligns with modern JavaScript style conventions
This change is consistent with the formatting standards being applied across the codebase.
src/uncaught-exception-handler.js (2)
32-32: Added trailing comma in array elementAdding trailing commas in multi-line array elements improves maintainability. This change is consistent with the formatting standards being applied throughout the codebase.
39-39: Added trailing comma in function argumentsAdded trailing comma after the second argument in the logger.error call, maintaining consistent style with other similar changes in the codebase.
src/messages.js (2)
5-5: Reordered exports alphabeticallyThe exports have been reordered from
{ success, failure, unchanged }to{ failure, success, unchanged }, which appears to follow alphabetical ordering. This improves readability without affecting functionality since named exports can be imported in any order.
10-10: Added trailing commas in function argumentsAdded trailing commas after template strings passed to
mf.compile()in both thesuccessandfailurefunctions. This maintains consistent style with other similar changes in the codebase.Also applies to: 17-17
src/message.spec.js (2)
38-44: LGTM: Improved iteration with modern syntax.Replacing nested
forEachcalls withfor...ofloops improves both readability and performance, as it avoids creating closures for each callback.
9-34: LGTM: Added trailing commas for better diffs.Adding trailing commas to object properties and array elements is a good practice. It makes future diffs cleaner when new elements are added and aligns with modern JavaScript style guides.
src/uncaught-exception-handler.spec.js (2)
56-56: LGTM: Removed unused parameter.Removing the unused error parameter from the catch block is a good improvement. It eliminates an unused variable and improves code clarity.
2-2: LGTM: Style improvements.The added blank line after imports and trailing comma in the mock object definition improve code consistency and follow modern JavaScript style conventions.
Also applies to: 20-20
.codesandbox/ci.json (1)
2-2: LGTM: Updated Node.js version requirement.Updating the Node.js version from 16 to 18 in the CodeSandbox CI configuration aligns with the project's updated requirements and supports compatibility with ESLint v9.
.nvmrc (1)
1-1: Verify Node.js version consistency across configurations.The Node.js version has been updated to 22.15.0, which is significantly newer than the version 18 specified in
.codesandbox/ci.json. While both versions satisfy the minimum requirement for ESLint v9 compatibility, this inconsistency could lead to different behavior between development and CI environments.Consider either:
- Using the same Node.js version across all configuration files, or
- Ensuring that the project is tested against all supported Node.js versions, including this version 22.15.0.
.prettierignore (1)
1-1: Simplification of Prettier ignore patternsThe change to only explicitly ignore
.yarnand retaintest/fixturesis appropriate, as Prettier already handles common directories likenode_modulesby default. This change aligns with the project's migration to Yarn and modernized configuration approach..changeset/pre.json (1)
1-8: Well-structured pre-release configuration for changesetsThe changeset pre-release configuration is properly set up with "alpha" tag and initial version 8.0.1, which correctly prepares for the major version bump to support ESLint v9 flat config.
CONTRIBUTING.md (1)
11-12: Package manager commands updated to use YarnAll npm commands have been consistently replaced with their Yarn equivalents throughout the contribution guidelines, aligning with the project's migration to Yarn.
Also applies to: 15-15, 41-41, 58-58
.changeset/dry-cobras-fold.md (1)
1-5: Correctly configured changeset for major version bumpThe changeset properly marks this as a major version change using conventional commit syntax with "feat!" prefix, accurately reflecting the breaking changes introduced by supporting ESLint v9 flat config.
__mocks__/prettier-eslint.js (1)
7-7:Details
✅ Verification successful
Cleanup of unnecessary ESLint directive
The removal of the ESLint directive for disabling "require-await" is appropriate as part of the broader ESLint configuration modernization. Since the mock function is already returning promises without using async/await syntax, test functionality should remain unchanged.
🏁 Script executed:
#!/bin/bash # Check if tests that use this mock are still passing cd "$(git rev-parse --show-toplevel)" fd --type file --extension spec.js | grep -E "format|prettier-eslint" | xargs grep -l "format"Length of output: 176
I’d like to confirm how the mock is being imported and used in the spec to ensure test behavior is unaffected:
This will help verify that removing the ESLint directive doesn’t alter runtime behavior.
🏁 Script executed:
#!/bin/bash # Show imports and usage of the prettier-eslint mock in the spec grep -R -n "prettier-eslint" src/format-files.spec.js sed -n '1,200p' src/format-files.spec.jsLength of output: 7894
Let's verify that the mock isn’t using an
asyncfunction and indeed only returns promises:
🏁 Script executed:
#!/bin/bash # Inspect the mock to confirm no async/await usage cd "$(git rev-parse --show-toplevel)" grep -R -n 'async ' __mocks__/prettier-eslint.js || true sed -n '1,200p' __mocks__/prettier-eslint.jsLength of output: 902
Cleanup of unnecessary ESLint directive
Verified that
__mocks__/prettier-eslint.jscontains noasyncfunctions (it returns Promises viajest.fn) and that all tests import and exercise this mock unchanged. Removing the/* eslint-disable require-await */override has no effect on functionality or test outcomes.babel.config.js (2)
7-7: Update to Node.js 18 is appropriate for ESLint v9 compatibility.Upgrading the Node.js target from 12 to 18 aligns with the broader project modernization and is necessary for ESLint v9 compatibility, which requires Node.js 16+.
10-13: Formatting consistency with trailing commas.Adding trailing commas throughout the configuration improves code formatting consistency and aligns with modern JavaScript style conventions. This change also makes future diffs cleaner when adding new items to arrays or objects.
src/argv.js (1)
7-7: LGTM! Trailing comma added for consistent formatting.This is a non-functional change that adds a trailing comma to match the formatting style applied throughout the codebase.
.gitattributes (2)
1-1: Improved global line ending configuration.Consolidating text attribute and line ending normalization into a single global rule ensures consistent line endings across all text files, which is especially important for cross-platform development.
2-2: Good practice for yarn.lock management.Disabling diff generation for
yarn.lockwith-diffis a recommended practice when migrating to Yarn. This prevents large, automatically generated changes from cluttering PRs and code reviews.src/prettier-eslint.js (2)
8-8: Removing unused error parameter in catch block.Good cleanup of the unused error parameter in the catch block. This follows best practices for keeping code clean and avoiding unused variables. The Istanbul ignore comment is preserved to maintain coverage reporting.
12-12: Formatting consistency with trailing comma.Adding a trailing comma to the string argument maintains consistent formatting with the rest of the codebase and matches the modern JavaScript style conventions applied throughout this PR.
.yarnrc.yml (1)
1-10: Well-structured Yarn configuration that follows best practicesThe new Yarn configuration properly sets up the project with modern package management practices including security (plugin checksum), privacy (disabled telemetry), and reproducibility (pinned Yarn version).
__mocks__/glob.js (9)
8-9: Consistent code style with trailing commasAdding trailing commas improves git diff cleanliness for future changes.
17-18: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
25-26: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
45-46: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
54-55: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
63-64: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
71-72: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
78-79: Consistent code style with trailing commasAdding trailing commas follows modern JavaScript style guidelines.
84-85: Consistent code style with trailing commasAdding trailing commas in the string concatenation improves consistency with the rest of the file.
src/index.js (2)
3-4: Improved code organization by removing unnecessary ESLint directiveRemoving the ESLint disable comment aligns with the project's move to ESLint v9 flat config.
6-9: Improved import organizationReordering imports and adding consistent spacing enhances code readability.
__mocks__/fs.js (4)
9-10: Added support for ESLint v9 flat configThe condition now properly handles both traditional
.eslintrcfiles and the new flat configeslint.config.*files, which is essential for supporting ESLint v9.
13-15: Improved code readability with modern JavaScript featuresUsing
includes()instead ofindexOf() >= 0makes the code more readable and concise.
17-19: Improved code readability with modern JavaScript featuresUsing
includes()instead ofindexOf() >= 0makes the code more readable and concise.
24-25: Simplified mock implementationUsing an arrow function to return an empty array makes the mock implementation more concise.
package-scripts.js (1)
55-55: Good update to support ESLint v9 flat configuration.The format script has been correctly updated to include
.mjsfiles in the glob pattern while removing the explicit reference to.eslintrc.js. This change properly supports the migration to ESLint v9's flat configuration format..gitignore (1)
8-10: Good addition of Yarn 2+ configuration patterns.The added Yarn-specific patterns correctly follow best practices for Yarn 2+/Berry projects:
- Ignoring the
.yarn/directory contents- Preserving the
releasesandpluginssubdirectories in GitThis aligns with the PR's migration to modern tooling.
jest.config.js (1)
18-20: Good style improvement with trailing commas.Adding trailing commas to the coverage thresholds improves code consistency and makes future additions easier.
.github/workflows/pkg-pr-new.yml (4)
11-12: Good security practice with explicit permissions.Setting explicit permissions with the minimum required scope (
contents: read) follows security best practices by adhering to the principle of least privilege.
7-9: Good use of concurrency control.The concurrency configuration properly prevents redundant workflow runs and cancels in-progress runs when new commits are pushed, which saves CI resources.
28-29: Good practice using Yarn with immutable installs.Using
yarn --immutableensures reproducible builds by requiring the lockfile to match the current dependencies without modifications during installation.
20-20: Good security practice pinning action versions.Pinning the action version with a full SHA hash (
actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683) instead of just using a tag likev4is a security best practice that prevents supply chain attacks..github/workflows/autofix.yml (2)
1-42: Well-structured GitHub workflow for automated code fixes 👍This new workflow is well-configured with proper security considerations, pinned action versions, and modern CI practices.
14-16: Good security practice with explicitly defined permissionsExplicitly setting permissions to the minimum required level follows the principle of least privilege.
src/parser.js (3)
1-1: Good use of explicit Node.js built-in module specifierUsing
node:pathinstead ofpathmakes it clear this is a Node.js built-in module, which is a recommended practice for newer Node.js versions.
6-16: Nice implementation of local arrify function to reduce dependenciesReplacing the external dependency with a simple local implementation reduces the package's dependency footprint.
40-44: Consistent code formatting with trailing commasAdding trailing commas throughout the codebase makes future modifications cleaner in version control and follows modern JavaScript style conventions.
Also applies to: 52-53, 61-62, 69-70, 81-82, 91-92, 103-104, 109-110, 114-115, 119-120, 123-124, 127-128, 139-140, 151-152, 159-160, 163-164, 178-179, 183-184, 194-195, 205-206, 218-219, 236-237
.github/workflows/release.yml (5)
8-10: Good use of concurrency controlsAdding concurrency controls to prevent multiple workflow runs executing simultaneously improves CI efficiency by canceling outdated runs.
12-16: Proper explicit permission settings for GitHub ActionsSetting explicit permissions follows security best practices by limiting the access scope of the GitHub token.
23-23: Great practice pinning GitHub Actions to specific commit hashesPinning to specific commit hashes rather than just version tags prevents supply chain attacks and ensures reproducible CI builds.
Also applies to: 28-28
33-33: Consistent use of Yarn commandsReplacing npm commands with Yarn commands ensures consistency with the project's package management approach.
Also applies to: 36-36, 43-44
47-47: Enabling npm package provenance for enhanced securitySetting
NPM_CONFIG_PROVENANCE=trueenables npm's package provenance which cryptographically verifies the package's source and build environment..github/workflows/stale.yml (1)
1-29: Automated workflow for handling stale issues/PRsThis workflow helps maintain repository cleanliness by automatically identifying and handling stale issues and pull requests.
src/format-files.spec.js (5)
1-3: Good test improvements for module consistencyThe changes to import statements and mocking approach ensure that both regular and Node.js protocol imports are properly mocked, which is important for the modernized codebase.
Also applies to: 6-7, 10-11, 14-16
22-23: Consistent mock namingRenaming
fsMocktomockFsthroughout the file improves code consistency and readability.
40-42: Improved regex patterns for test output matchingThe updated regular expressions for matching console output are more robust by explicitly excluding newline characters and including Unicode line terminators.
Also applies to: 96-101, 126-131, 222-224, 236-238, 256-258, 270-272
280-286: Better Promise handling in testsUsing
await expect(...).resolves.not.toThrow()is a more modern and clearer way to test asynchronous code that's expected to resolve without errors.
332-333: Updated test to use new ESLint config filenameThe test now correctly uses
eslint.config.mjsinstead of.eslintrc, aligning with ESLint v9's flat configuration format..github/workflows/ci.yml (6)
7-9: Great addition of concurrency control!Adding concurrency settings is a best practice that prevents redundant workflow runs, saving CI resources and reducing noise in the PR timeline.
11-12: Security improvement with explicit permissionsExplicitly setting minimal permissions (read-only for contents) follows the principle of least privilege and improves security.
20-24: Appropriate Node.js version updatesThe Node.js versions now align with the project's requirement for Node.js 18+ as specified in package.json, and include testing across the current active LTS versions.
27-34: Improved action versioning and cachingPinning to specific commit hashes rather than version tags provides better security and reproducibility. The addition of Yarn caching improves workflow performance.
36-40: Consistent package manager usageSwitching from npm to yarn with immutable installs ensures consistent dependencies across different environments and aligns with the project's migration to Yarn.
42-45:Details
❓ Verification inconclusive
Updated codecov configuration
The codecov action has been updated to a newer version with proper token handling. Make sure the CODECOV_TOKEN secret is properly configured in the repository settings.
🏁 Script executed:
#!/bin/bash # Check if the CODECOV_TOKEN is configured in repository secrets gh api repos/{owner}/{repo}/actions/secrets | grep -q CODECOV_TOKEN && echo "✅ CODECOV_TOKEN is configured" || echo "❌ CODECOV_TOKEN is not configured"Length of output: 275
Verify CODECOV_TOKEN secret configuration
Please confirm that the
CODECOV_TOKENsecret is present under your repository Settings → Secrets. You can verify by running:gh secret list --repo <owner>/<repo> | grep -q CODECOV_TOKEN && echo "✅ configured" || echo "❌ missing"• File: .github/workflows/ci.yml (lines 42–45)
• Action: codecov/codecov-action@ad3126etest/tests/cli.spec.js (6)
2-4: Improved module import styleUsing the
node:prefix for built-in modules is a recommended practice that explicitly indicates these are Node.js core modules and prevents potential conflicts with similarly named modules.
5-5: Cleaner import syntaxConsolidating imports from the same package improves code readability and maintainability.
14-14: Modern numeric separator usageUsing numeric separators for the timeout value improves readability.
108-108: Environment agnostic global object referenceReplacing
window.bazwithglobalThis.bazis more appropriate for code that can run in both browser and Node.js environments, aswindowis browser-specific whileglobalThisworks across environments.
138-140: Improved error handlingCatching a generic error instead of specifically
stderrimproves error handling robustness.
200-203: Better string replacement methodUsing
replaceAllinstead ofreplacewith a global regex is cleaner and more explicit about the intent to replace all occurrences.eslint.config.mjs (5)
1-11: Well-structured ESLint flat config implementationThe new ESLint flat config properly imports and extends base configurations while utilizing TypeScript ESLint's config wrapper. This approach aligns with ESLint v9's recommended configuration pattern.
12-12: Comprehensive ignore patternsThe ignore patterns correctly exclude test fixtures while making an exception for JavaScript files in nested node_modules, which is important for testing path handling.
15-34: Well-balanced rule configurationThe rule configurations strike a good balance between code quality and practicality:
- Disabling Prettier enforcement avoids conflicts with the project's own formatting
- Setting specific spacing rules for different function types improves readability
- Arrow function parentheses and quote style rules maintain consistent code style
- SonarJS fixme/todo tags as warnings encourage addressing these markers without blocking development
These settings align with modern JavaScript development practices.
36-45: Appropriate test file overridesThe configuration correctly relaxes certain rules for test files, such as allowing magic numbers and disabling slow regex warnings, which are common in test scenarios.
46-51: File-specific rule exceptionDisabling the hashbang rule specifically for src/index.js is appropriate as this is likely an executable entry point script.
src/format-files.js (7)
1-14: Modernized imports and dependenciesThe changes make several improvements to imports:
- Using
node:prefixes for Node.js core modules- Switching to ESM-to-CJS variants of dependencies to maintain compatibility
- Improving organization and readability of imports
These changes help ensure compatibility while following modern JavaScript practices.
18-18: Good use of constant for indentationIntroducing the
INDENT_COUNTconstant improves maintainability by centralizing the indentation value used throughout the file.
78-89: Improved control flowThe conditional block has been simplified by removing an unnecessary
elseand returning directly. The code is now more concise and easier to follow.
91-94: Clearer stdin processingSeparating the
getStdin()call and trimming into two steps improves readability and makes the code's intent clearer.
170-205: More explicit array length checksChanging from truthy checks to explicit
> 0comparisons for array lengths makes the intent clearer and is more robust against potential edge cases.
226-236: Improved functional programming styleThe refactored code uses a more concise arrow function style with implicit returns and cleaner conditional logic, making the code more readable and maintainable.
256-262: Simplified conditional logicRemoving the unnecessary
elseblock and directly returning the result of the pipe operation makes the code more concise and easier to follow.package.json (7)
4-8: Metadata updates look good
The addition of"type": "commonjs"and enrichment ofrepository,homepage, andauthorfields aligns with project requirements and improves package metadata.
10-14: Maintainers, license, and package manager fields updated
Themaintainerslist andlicensedeclaration appear correct, and the explicitpackageManagerensures consistency in development environments.
21-31: Main entry and published files configuration
Definingmain,files, andkeywordsensures consumers install only the necessary output and improves discoverability.
34-41: Script commands updated for Yarn-based workflows
Switchingformattonps, enhancingprepare, and integratingyarn-berry-deduplicatealigns the scripts with the new Yarn-centric CI/CD flows.
51-67: Validate alias dependencies mapping
You've aliased@prettier/eslintvianpm:prettier-eslint@^17.0.0-alpha.0. Please verify that Yarn resolves this alias correctly and does not introduce duplicate package installs.
98-98: Verify external Prettier config resolution
Using a string to point at@1stg/prettier-config/semiis valid, but please ensure that Prettier can locate this package-based config in all environments.
100-101: Confirm existence ofvalidatecommand innpsconfig
The pre-commit hook runsyarn start validate. Please verify that yournpsconfiguration defines avalidatescript to avoid hook failures.
Signed-off-by: JounQin <admin@1stg.me>
Signed-off-by: JounQin <admin@1stg.me>
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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: 2
♻️ Duplicate comments (1)
src/format-files.js (1)
20-20: Improved line separator regex patternThe updated regex
/\r|\r?\n/properly handles all line ending types without capturing groups that get filtered out later.
🧹 Nitpick comments (5)
src/uncaught-exception-handler.js (2)
32-32: Added trailing comma for code consistency.This change adds a trailing comma at the end of the template literal in the
resolutionStepsarray, improving code style consistency throughout the project.
39-39: Added trailing comma after the second argument in the logger.error call.This change adds a trailing comma at the end of the second argument in the
logger.errorcall, maintaining consistent code style with the other trailing comma changes in the file.babel.config.js (1)
10-13: Added trailing commas for consistent formatting.Added trailing commas after the
corejs: 3property and the inner and outer array elements. This improves code consistency and follows modern JavaScript style conventions.package-scripts.js (1)
55-55: Consider adding.yamlsupport
If your repo contains.yamlfiles (e.g. CI configs), you may want to adjust the glob to**/*.{js,json,md,mjs,yml,yaml}for full coverage..gitignore (1)
3-9: Verify.yarnre-inclusion patterns
The rules
.yarn/*
!.yarn/releases
!.yarn/plugins
will ignore all of.yarnthen re-include only the empty directories. To un-ignore their contents, you may need:.yarn/* -!.yarn/releases -!.yarn/plugins +!.yarn/releases/ +!.yarn/releases/** +!.yarn/plugins/ +!.yarn/plugins/**This ensures files under those folders are tracked.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
.yarn/plugins/plugin-prepare-lifecycle.cjsis excluded by!**/.yarn/**.yarn/releases/yarn-4.9.1.cjsis excluded by!**/.yarn/**src/__snapshots__/uncaught-exception-handler.spec.js.snapis excluded by!**/*.snapyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (41)
.changeset/dry-cobras-fold.md(1 hunks).changeset/pre.json(1 hunks).codesandbox/ci.json(1 hunks).eslintignore(0 hunks).eslintrc.js(0 hunks).gitattributes(1 hunks).github/FUNDING.yml(1 hunks).github/workflows/autofix.yml(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/pkg-pr-new.yml(1 hunks).github/workflows/release.yml(1 hunks).github/workflows/stale.yml(1 hunks).gitignore(1 hunks).npmrc(0 hunks).nvmrc(1 hunks).prettierignore(1 hunks).yarnrc.yml(1 hunks)CONTRIBUTING.md(3 hunks)README.md(1 hunks)__mocks__/fs.js(1 hunks)__mocks__/glob.js(5 hunks)__mocks__/prettier-eslint.js(1 hunks)babel.config.js(1 hunks)eslint.config.mjs(1 hunks)jest.config.js(2 hunks)other/EXAMPLES.md(0 hunks)other/manual-releases.md(0 hunks)package-scripts.js(1 hunks)package.json(2 hunks)src/argv.js(1 hunks)src/format-files.js(14 hunks)src/format-files.spec.js(15 hunks)src/index.js(1 hunks)src/message.spec.js(1 hunks)src/messages.js(1 hunks)src/parser.js(12 hunks)src/prettier-eslint.js(1 hunks)src/uncaught-exception-handler.js(1 hunks)src/uncaught-exception-handler.spec.js(3 hunks)test/override-config.js(1 hunks)test/tests/cli.spec.js(10 hunks)
💤 Files with no reviewable changes (5)
- other/EXAMPLES.md
- .eslintignore
- .npmrc
- .eslintrc.js
- other/manual-releases.md
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/uncaught-exception-handler.js (4)
src/index.js (1)
logger(11-11)src/prettier-eslint.js (1)
logger(3-3)src/uncaught-exception-handler.spec.js (3)
logger(6-6)logger(31-31)logger(40-40)src/format-files.js (1)
logger(35-35)
src/format-files.spec.js (1)
src/format-files.js (1)
globOptions(219-219)
🔇 Additional comments (80)
.github/FUNDING.yml (1)
15-15: Approve updated Afdian funding URL
The custom funding link for “JounQin” has been updated to the new Afdian format (https://afdian.com/a/JounQin), which aligns with the current domain conventions.README.md (3)
316-316: Updated license badge link
The[license]reference has been corrected to point atLICENSEin the repository root (dropping the removedother/directory). This aligns with the cleanup of theother/folder.
322-322: Updated Code of Conduct badge link
The[coc]reference now points toCODE_OF_CONDUCT.mdin the repo root, matching the removal of the legacy file underother/.
324-324: Updated Roadmap badge link
The[roadmap]reference has been updated to the root-levelROADMAP.md, consistent with the directory restructuring..changeset/pre.json (1)
1-8: LGTM - Proper changesets pre-release configurationThe configuration correctly sets up an alpha pre-release mode for the prettier-eslint-cli package with version 8.0.1 as the starting point. This aligns with the PR's goal of preparing for a major version bump to support ESLint v9.
CONTRIBUTING.md (4)
11-12: LGTM - Updated npm commands to yarnCorrectly updated installation commands to use yarn instead of npm, which aligns with the project's migration to Yarn as indicated in the PR objectives.
15-15: LGTM - Updated help command referenceConsistently updated to reference yarn instead of npm while keeping the same nps functionality.
41-41: LGTM - Updated contributors commandCorrectly updated to use yarn instead of npm for the contributors script.
58-58: LGTM - Updated test commandConsistently updated to reference yarn instead of npm for the test update command.
src/argv.js (1)
7-7: LGTM - Minor formatting improvementThe change adds a trailing comma to the reduce function's initial value, which is a stylistic improvement for consistency with modern JavaScript coding standards and doesn't affect functionality.
.gitattributes (1)
1-2: LGTM - Improved Git attributes configurationThis update makes two good improvements:
- Consolidated text and line ending normalization into a single global rule
- Added the
-diffattribute for yarn.lock to prevent showing it in diffs, which is a best practice for lock files as they can be large and machine-generatedThese changes align with modern Git workflow best practices and support the project's move to Yarn.
.github/workflows/stale.yml (1)
1-29: Well-structured GitHub Action for stale issues managementThe implementation follows GitHub Actions best practices with clear scheduling, concurrency controls, and explicit permissions. The action is correctly pinned to a specific version with full commit hash for security.
.codesandbox/ci.json (1)
2-2: Node.js version update aligns with project requirementsThe update from Node 16 to 18 aligns with the broader project-wide upgrade seen in other configuration files and the requirements mentioned in the PR objectives.
.prettierignore (1)
1-2: Simplified .prettierignore with Yarn-specific additionsThe updated file removes standard directories that are now likely handled by default configurations or other mechanisms, while adding
.yarnto support the Yarn 4 configuration mentioned in the PR objectives.test/override-config.js (1)
3-4: Style improvement with trailing commasThe addition of trailing commas improves code consistency and aligns with modern JavaScript style practices. This change supports easier version control diffs when items are added to objects or arrays in the future.
.changeset/dry-cobras-fold.md (1)
1-6: Appropriate usage of changeset for breaking changes.This changeset correctly identifies this as a major version bump due to ESLint v9 flat config support, which is a breaking change. The format follows the expected changeset structure with package name, bump type, and clear description.
__mocks__/prettier-eslint.js (1)
7-7: Removed ESLint disable comment for require-await.The ESLint directive comment
/* eslint-disable require-await */has been removed. This is appropriate since the mockformatfunction appears to be synchronous in its implementation but returns Promises, meaning the rule is no longer needed or is being handled at the project configuration level with the new ESLint flat config.babel.config.js (1)
7-7: Updated Node.js target to version 18.Updated the Babel configuration to target Node.js version 18 instead of the previous version 12. This aligns with the PR objective of requiring Node.js 18 or higher and supports the modernization efforts across the project.
src/messages.js (2)
5-5: Export order change looks goodThe reordering of named exports is a style preference and doesn't affect functionality.
10-10: Style consistency improvementAdded trailing commas to template strings, which is consistent with modern JavaScript style guidelines and helps with cleaner git diffs when adding new items.
Also applies to: 17-17
src/prettier-eslint.js (2)
8-8: Improved catch block syntaxRemoved unused error parameter from the catch block, which is a good practice when the error isn't being used.
12-12: Style consistency improvementAdded trailing comma to the log message, maintaining consistent style throughout the codebase.
.yarnrc.yml (1)
1-10: Yarn configuration looks goodThe Yarn configuration is well-structured with appropriate settings:
- Telemetry disabled for privacy
- Using node-modules linker for compatibility
- Properly configured plugin with checksum verification
- Pinned to a specific Yarn version for consistency
This aligns with the PR objective of modernizing tooling and dependencies.
__mocks__/glob.js (1)
8-8: Style consistency improvement across mock dataAdded trailing commas to all array elements and string concatenations in the mock implementation. This provides:
- Consistent code style across the codebase
- Cleaner git diffs when adding new items
- Alignment with modern JavaScript style guidelines
These changes don't affect the functionality of the mock implementation.
Also applies to: 17-17, 25-25, 45-45, 54-54, 63-63, 71-71, 78-78, 84-84
__mocks__/fs.js (3)
9-9: Good update to support ESLint v9 flat configuration.The mock now correctly handles both traditional
.eslintrcand the neweslint.config.*format files, which aligns with the PR's goal to support ESLint v9 flat configuration.
21-21: Improved error message with template literals.This change addresses a previous review comment by interpolating the
filePathdirectly into the error message using template literals.
24-24: Clean simplification of the readdirSync mock.The readdirSync mock has been simplified to a more concise arrow function, which is cleaner and follows modern JavaScript patterns.
src/index.js (2)
3-4: Improved code style by removing unnecessary ESLint directive.The ESLint directive is no longer needed, which aligns with the move to the new ESLint v9 flat configuration.
7-9: Better import organization.Reordering imports for better logical grouping and consistency.
src/message.spec.js (3)
9-10: Good use of trailing commas.Adding trailing commas to objects and arrays is a good practice for cleaner version control diffs when items are added or removed.
Also applies to: 13-14, 19-20, 23-24, 29-30, 33-35
38-44: Improved test loop structure.Replacing nested
forEachloops withfor...ofloops improves readability and debugging capabilities.
1-1:Details
✅ Verification successful
Verify the ESLint directive change.
The ESLint directive was changed from
import/namespacetoimport-x/namespace, which contradicts previous review comments suggesting the opposite change. Please verify if this is intentional or a mistake.
🌐 Web query:
Is "import-x/namespace" a valid ESLint rule?💡 Result:
Yes,
import-x/namespaceis a valid ESLint rule provided by theeslint-plugin-import-xplugin. This rule ensures that all properties accessed from a namespace import are exported by the module. For example, if you haveimport * as foo from './foo';and then accessfoo.bar();, the rule will report an error ifbaris not exported by./foo. (github.com)To use this rule, you need to install the
eslint-plugin-import-xplugin and enable the rule in your ESLint configuration. Here's how you can do it:
Install the Plugin:
npm install eslint-plugin-import-x --save-devUpdate Your ESLint Configuration:
In your
.eslintrcfile, addimport-xto thepluginsarray and enable thenamespacerule:{ "plugins": ["import-x"], "rules": { "import-x/namespace": "error" } }This configuration will report an error whenever a property is accessed from a namespace import that isn't exported by the module. (github.com)
For more details on this rule and its options, you can refer to the official documentation. (github.com)
Citations:
- 1: https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md?utm_source=openai
- 2: https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md?utm_source=openai
- 3: https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md?utm_source=openai
No issues with
import-x/namespacedirectiveThe change from
import/namespacetoimport-x/namespaceis intentional and valid—this rule is provided by theeslint-plugin-import-xplugin and will correctly enforce namespace import checks. All other style and readability updates (trailing commas, blank line,for…ofloops) look good.src/uncaught-exception-handler.spec.js (2)
20-21: Consistent use of trailing commas.Adding a trailing comma after the last property in the object is consistent with modern JavaScript style and improves version control diffs.
56-56: Removed unused catch parameter.Good cleanup by removing the unused error parameter (
e) in the catch block, which avoids declaring unused variables.package-scripts.js (1)
55-55: Approve format script update for.mjsfiles
Includingmjsin the glob ensures your new ESLint flat‐config (eslint.config.mjs) is formatted alongside other sources.jest.config.js (1)
18-20: Approve added trailing commas
The extra commas in thecoverageThreshold.globalobject improve diff stability and match the project’s style conventions..github/workflows/pkg-pr-new.yml (3)
1-6: Approve workflow name and triggers
Naming the workflow “Publish Any Commit” and running on bothpushandpull_requestaligns with the intended use case.
7-10: Approve concurrency control
Using${{ github.workflow }}-${{ github.ref }}withcancel-in-progress: trueprevents duplicate runs per branch, which is a best practice.
11-13: Approve minimal permissions block
Specifyingcontents: readlimits the GITHUB_TOKEN scope to just reading repo contents—good for security..github/workflows/autofix.yml (2)
1-1: Approve workflow naming requirement
The workflow’s nameautofix.cisatisfies the security constraint of theautofix-ci/action.
14-16: Approve write permission for autofix
Grantingcontents: writeis necessary for the action to push formatting fixes back to the PR.src/parser.js (3)
1-1: Good modernization of Node.js importsUsing the explicit
node:pathimport follows Node.js best practices for built-in modules, making the code more maintainable and explicit about its dependencies.
6-16: Great replacement of external dependency with local implementationReplacing the external
arrifydependency with a local implementation reduces package dependencies while maintaining the same functionality. The implementation properly handles all edge cases (null/undefined values, arrays, and non-arrays).
103-103:Details
✅ Verification successful
Verify that all arrify calls use the local implementation
Make sure all calls to
arrifyin the codebase have been updated to use this local implementation.
🏁 Script executed:
#!/bin/bash # Search for any remaining imports of the 'arrify' package rg -l "import.*arrify" --type js # Look for direct uses of arrify that may need to be updated rg -l "\barrify\(" --type jsLength of output: 65
🏁 Script executed:
#!/bin/bash # Search for any CommonJS requires of the 'arrify' package rg -l "require\(['\"]arrify['\"]\)" --type jsLength of output: 51
All external
arrifyreferences removedNo remaining imports or requires of the external
arrifypackage were found, and there are no direct calls toarrify(in the codebase. The local implementation is now used everywhere..github/workflows/release.yml (5)
8-10: Great addition of concurrency controlsAdding concurrency settings prevents multiple release workflows from running simultaneously on the same branch, which helps avoid race conditions and ensures reliable releases.
12-15: Improved security with explicit permissionsFollowing the principle of least privilege by explicitly setting required permissions is a security best practice for GitHub Actions.
23-23: Good practice pinning GitHub Actions to specific commitsPinning to specific commit hashes rather than version tags adds security and reproducibility to your workflows.
Also applies to: 28-28
33-33: Standardized on Yarn package managerSwitching from npm to Yarn with the
--immutableflag ensures consistent and reproducible builds across environments.Also applies to: 36-36, 43-44
47-47: Enhanced security with npm provenanceAdding
NPM_CONFIG_PROVENANCE=trueimproves supply chain security by generating provenance statements that verify the package was built in this specific GitHub Actions environment.src/format-files.spec.js (4)
1-2: Improved mocking setup for Node.js module importsThe changes to explicitly mock both
fsandnode:fsimports with the same mock object ensures consistent behavior in tests when code uses either import style. The comment explaining this workaround is helpful for future maintainers.Also applies to: 14-15
40-42: Enhanced output validation with improved regular expressionsThe updated regular expressions now correctly handle all line terminator characters by explicitly excluding
\n,\r, and Unicode line terminators (\u2028\u2029). This makes the tests more robust against different output formatting scenarios.Also applies to: 96-101, 126-131, 222-224, 236-238, 256-258, 270-272
280-285: Improved async test patternUsing
await expect(...).resolves.not.toThrow()is a more explicit and clearer pattern for testing asynchronous code that should not throw exceptions, following Jest best practices.
332-332: Updated test to use ESLint's flat config formatUpdating the eslintConfigPath to use 'eslint.config.mjs' instead of '.eslintrc' correctly adapts the test to the ESLint v9 flat configuration format, which is a key part of this PR's objectives.
.github/workflows/ci.yml (5)
7-9: Great addition of concurrency controlsAdding concurrency settings prevents multiple CI workflows from running simultaneously on the same branch, optimizing CI resources and preventing potential race conditions.
11-12: Improved security with explicit permissionsExplicitly setting minimal required permissions follows security best practices for GitHub Actions.
20-24: Modernized Node.js version matrixUpdating the test matrix to use Node.js 18, 20, 22, and 24 aligns with the PR's objective to support modern Node.js versions and drops support for EOL versions.
34-34: Enabled Yarn caching for faster CI runsAdding the cache configuration for Yarn will significantly speed up CI runs by caching dependencies between workflow runs.
43-45: Updated CodeCov integrationUsing a pinned version of the codecov action and explicitly providing the token improves security and reliability of the coverage reporting.
test/tests/cli.spec.js (5)
2-3: Good use of explicit Node.js module importsUsing the
node:prefix for core Node.js modules is a best practice that helps clarify which imports are from Node.js core vs external packages.
14-14: Good use of numeric separator for improved readabilityThe numeric separator
_in20_000improves readability of the timeout value.
108-108: Appropriate replacement ofwindowwithglobalThisReplacing
window.bazwithglobalThis.bazis a good improvement as it's more environment-agnostic and will work correctly in Node.js environments.
138-138: Modern error handling pattern appliedUsing the parameter-less catch clause is a good modern JavaScript practice when you don't need to reference the error object.
200-203: Improved string replacement withreplaceAllUsing
replaceAllinstead of a regex-based replacement is cleaner and more intuitive for replacing all occurrences of a string.eslint.config.mjs (5)
1-7: Well-structured ESLint flat config importsThe imports correctly set up the necessary components for ESLint v9's flat configuration format, including the TypeScript ESLint config wrapper and other plugins.
8-13: Properly configured base and plugin extensions with ignore patternsThe configuration correctly extends the base configs and includes the recommended flat config from node-dependencies plugin. The ignore patterns are appropriately set to exclude test fixtures while allowing nested JavaScript files in node_modules for testing purposes.
14-35: Comprehensive rule customizations for project requirementsThe rule customizations appropriately disable Prettier-related rules, JSDoc validation, and other rules that conflict with the project's style. The error level settings for unused variables with parameter exceptions and space-before-function-paren are well configured for the codebase style.
36-45: Well-defined test file overridesThe file-specific overrides for test files correctly add Jest globals and disable rules that would interfere with testing patterns like magic numbers and slow regex patterns.
46-51: Targeted rule exemption for entry point fileThe specific override for src/index.js that disables the hashbang rule is appropriate for an executable entry point file.
src/format-files.js (6)
1-3: Good use of explicit Node.js module importsUsing the
node:prefix for core Node.js modules is a best practice that helps clarify which imports are from Node.js core vs external packages.
4-6: Updated dependencies to address ESM compatibilitySwitching to
@esm2cjs/indent-stringandchalk-cjsaddresses ESM/CommonJS compatibility issues, which is important for the project's type: "commonjs" configuration.
18-18: Good extraction of magic number into constantCreating the
INDENT_COUNTconstant improves code maintainability by centralizing the indentation value used across the codebase.
73-73: Updated ESLint config option nameThe property name change from likely
configFiletooverrideConfigFilereflects updates in ESLint v9 API for configuration overrides.
81-88: Improved function call formattingThe formatting changes to this function call with one parameter per line and trailing commas improve readability and make future changes less prone to git diff issues.
232-234: Simplified conditional logicThe refactored return statement using
!(condition)pattern improves readability over nested if/else conditions.package.json (6)
4-4: Important module type specificationAdding
"type": "commonjs"explicitly defines the module system, which is crucial for Node.js to correctly interpret imports/requires, especially with the move toward ESM in the ecosystem.
16-16: Updated Node.js engine requirementsThe more specific Node.js version requirement aligns with ESLint v9's requirements and follows ESLint's versioning strategy.
36-38: Modern tooling workflow setupThe updated prepare and release scripts integrate patch-package, simple-git-hooks, and yarn-berry-deduplicate, creating a comprehensive development environment setup.
95-97: Switch from lint-staged to nano-stagedReplacing lint-staged with nano-staged is a good performance improvement as nano-staged is generally faster and lighter.
98-98: Simplified Prettier configurationUsing
@1stg/prettier-config/semiinstead of inline Prettier configuration improves maintainability and ensures consistency with the organization's style guidelines.
51-59:Details
✅ Verification successful
Verify alpha dependency stability
The use of
@prettier/eslintaliased toprettier-eslint@^17.0.0-alpha.0could introduce instability. While necessary for ESLint v9 compatibility, monitor for any issues this might cause.
🏁 Script executed:
#!/bin/bash # Check if there are any recent issues or PRs related to the alpha version gh api graphql -f query=' { repository(owner: "prettier", name: "prettier-eslint") { issues(last: 5, states: OPEN) { nodes { title url createdAt } } pullRequests(last: 5, states: OPEN) { nodes { title url createdAt } } } }'Length of output: 524
Prettier-Eslint Alpha Dependency Stability Verified
A review of the last five open issues and pull requests on the prettier-eslint repo shows no reported problems with the^17.0.0-alpha.0release. The@prettier/eslintalias can remain as is—just continue to monitor upstream for any future fixes.
close #457
close #458
related prettier/prettier-eslint#1190
Important
Bump
prettier-eslintto support ESLint v9 flat config, update Node.js compatibility, and modernize dependencies and configurations.prettier-eslint-cli.This description was created by
for ff202c9. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Breaking Changes
prettier-eslint-cli.Dependency Updates
lint-stagedtonano-staged.Chores
Style
Tests
Documentation