Skip to content

fix: export entry regression#1182

Merged
JounQin merged 3 commits intomasterfrom
fix/regression
Apr 18, 2025
Merged

fix: export entry regression#1182
JounQin merged 3 commits intomasterfrom
fix/regression

Conversation

@JounQin
Copy link
Copy Markdown
Member

@JounQin JounQin commented Apr 18, 2025

close #1181


Important

Fixes export entry regression by changing default export to format and updating related configurations and tests.

  • Behavior:
    • Changed default export in index.js to only export format function.
    • Added named exports for format and analyze in index.js.
    • Updated index.d.ts to reflect new export structure with PrettierESLint interface.
  • Chores:
    • Updated .prettierignore to exclude test/fixtures.
    • Removed unused build artifacts and type declaration files from lib.
    • Updated package.json to reflect new main and types entry points.
  • Tests:
    • Updated tests in index.spec.ts to reflect changes in export structure, removing tests for analyze function.
    • Simplified test suite to focus on format function.

This description was created by Ellipsis for c009bb6. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • Chores

    • Updated ignore files to reorganize entries, add the lib directory, and generalize cache file patterns.
    • Updated formatting ignore rules to exclude the test/fixtures directory.
    • Removed unused build artifacts and type declaration files from the lib directory.
    • Updated scripts and dependencies in project configuration, removing Babel and ESLint-related packages, and revising available scripts.
  • New Features

    • Changed the default export to provide only the format function.
    • Introduced new module entry points exporting format as default and named exports including analyze.
    • Added a new TypeScript interface combining format and analyze functions for improved typing.
  • Tests

    • Simplified the test suite to reflect the updated export, removing tests for the analyze function.

@JounQin JounQin requested a review from Copilot April 18, 2025 06:16
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 18, 2025

🦋 Changeset detected

Latest commit: c009bb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
prettier-eslint Patch

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 18, 2025

Warning

Rate limit exceeded

@JounQin has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5b8c4af and c009bb6.

📒 Files selected for processing (6)
  • __mocks__/eslint.ts (1 hunks)
  • __mocks__/prettier.ts (0 hunks)
  • eslint.config.mjs (1 hunks)
  • index.d.ts (1 hunks)
  • mock.d.ts (2 hunks)
  • package.json (2 hunks)

Walkthrough

This change performs a comprehensive cleanup of unused files and development dependencies. Several files in the lib directory, including JavaScript, TypeScript declaration, and utility files, as well as build artifacts, were deleted. The package.json was updated to remove Babel and ESLint-related development dependencies and to revise scripts for formatting and linting. Ignore files were updated to reflect new patterns and directories. The default export in the main source file was simplified to export only the format function, and related tests were adjusted accordingly.

Changes

File(s) Change Summary
.gitignore, .prettierignore Updated ignore patterns: removed/added directories and generalized cache ignores; added test/fixtures to Prettier ignore.
lib/index.d.ts, lib/index.js, lib/tsconfig.tsbuildinfo, lib/types.d.ts, lib/types.js, lib/utils.d.ts, lib/utils.js Deleted all files: removed type declarations, main logic, utilities, and build artifacts from the lib directory.
package.json Removed Babel and ESLint dev dependencies, updated scripts for formatting/linting, removed obsolete "fix" script.
src/index.ts Changed default export from an object with format and analyze to exporting only the format function.
test/index.spec.ts Simplified test: removed test for analyze export, updated assertion for default export to be just format.
index.js, index.d.ts Added new entry point files exporting and typing format and analyze functions from ./lib/index.js.
.changeset/perfect-carrots-repair.md Added a new changeset file recording a patch-level fix for export entry regression.

Assessment against linked issues

Objective Addressed Explanation
Remove lib/index.d.ts, lib/index.js, lib/index.js.map, lib/tsconfig.tsbuildinfo, lib/types.d.ts, lib/types.js, lib/types.js.map, lib/utils.d.ts, lib/utils.js, lib/utils.js.map (#1181)
Remove @babel/cli, @babel/core, @babel/preset-env, eslint-config-kentcdodds from devDependencies (#1181)
Update code to use prettierEslint.format as default export and update tests accordingly (#1181)
Update ignore patterns and clean up project configuration as described (#1181)

Possibly related PRs

Poem

A rabbit hopped through code so neat,
Sweeping files with nimble feet.
Out went Babel, types, and more,
Leaving just what we adore.
Now "format" stands alone—how sweet!
With scripts and tests all trim and fleet,
This cleanup’s done—let’s thump and eat! 🥕✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5335c10) to head (c009bb6).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1182   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          304       304           
  Branches        78        79    +1     
=========================================
  Hits           304       304           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Copilot AI left a 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 addresses the export entry regression by changing the default export to return only the format function. Key changes include updating the test expectation in test/index.spec.ts, modifying src/index.ts to export default format, and removing legacy lib files.

Reviewed Changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.

File Description
test/index.spec.ts Updated tests to expect the default export to equal format and removed the analyze export test.
src/index.ts Changed the default export from an object with format and analyze to only the format function.
lib/utils.js / lib/types.js / lib/index.js Removed legacy build artifacts, likely to be regenerated by updated build scripts.
Files not reviewed (3)
  • .prettierignore: Language not supported
  • lib/tsconfig.tsbuildinfo: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (2)

test/index.spec.ts:32

  • The test for verifying the export of the analyze function was removed. If this change is intentional, please update the documentation or add separate tests to ensure that analyze is still exported as a named export.
expect(prettierESLint).toBe(format);

lib/index.js:1

  • The removal of the files in the lib/ directory represents a significant change in the output of the build process. Please verify that the build scripts are updated accordingly and that no consumers rely directly on these files.
// entire file removed

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to a537bcb in 46 seconds

More details
  • Looked at 719 lines of code in 14 files
  • Skipped 2 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. src/index.ts:426
  • Draft comment:
    Changing the default export to only export the format function is intentional, but please ensure that documentation and examples are updated accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to ensure that documentation and examples are updated, which violates the rule against asking the author to ensure things are done. It does not provide a specific suggestion or ask for a specific test to be written.
2. package.json:18
  • Draft comment:
    The 'main' and 'types' fields still point to lib/index.js and lib/index.d.ts which are now deleted. Please ensure the build system regenerates these files appropriately or update these entries.
  • 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.
3. test/index.spec.ts:30
  • Draft comment:
    Test updated to check default export equals format; verify that removal of analyze export from default export does not affect users needing analyze as a named export.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. .prettierignore:2
  • Draft comment:
    Adding 'test/fixtures' to .prettierignore is fine, but ensure that this exclusion doesn't hide intentional formatting tests.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. .prettierignore:2
  • Draft comment:
    Adding 'test/fixtures' to the ignore list prevents accidental formatting of fixture files. This is appropriate.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is purely informative and does not provide any actionable feedback or suggestions. It simply states a fact about the change, which violates the rule against making purely informative comments.
6. package.json:31
  • Draft comment:
    Renaming the 'fix' script to separate 'format' and 'lint' commands and removing unused devDependencies (Babel packages and eslint-config-kentcdodds) cleans up the project. Ensure users update any CI or developer scripts accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is informative and suggests ensuring that users update their CI or developer scripts, which is not allowed. It doesn't provide a specific code suggestion or ask for a specific test to be written.
7. src/index.ts:426
  • Draft comment:
    Default export now returns only the 'format' function, which fixes the regression. Users needing 'analyze' should import it as a named export.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is purely informative, explaining a change in the export structure of a module. It doesn't provide a suggestion, ask for confirmation, or highlight a potential issue. It simply states what the change is and how users should adapt to it.
8. test/index.spec.ts:31
  • Draft comment:
    The test now confirms that the default export equals the 'format' function. This aligns with the intended export change.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is purely informative, as it simply states that the test confirms the intended export change. It does not provide any actionable feedback or suggestions for improvement.
9. src/index.ts:42
  • Draft comment:
    Typo: In the docstring for the analyze function (line 42), it currently says "To options parameter". Please change 'To' to 'The' for correctness.
  • 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_EjQEDUfOoalF65YD


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a 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)
package.json (1)

33-34: Verify existence and documentation of new scripts

You’ve introduced format and lint scripts invoking yarn start format and yarn start lint.

  1. Confirm that format and lint tasks are properly defined in package-scripts.cjs.
  2. Update your README or contributing guide to document these new commands so contributors can easily run them.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5335c10 and a537bcb.

⛔ Files ignored due to path filters (4)
  • lib/index.js.map is excluded by !**/*.map
  • lib/types.js.map is excluded by !**/*.map
  • lib/utils.js.map is excluded by !**/*.map
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • .gitignore (1 hunks)
  • .prettierignore (1 hunks)
  • lib/index.d.ts (0 hunks)
  • lib/index.js (0 hunks)
  • lib/tsconfig.tsbuildinfo (0 hunks)
  • lib/types.d.ts (0 hunks)
  • lib/types.js (0 hunks)
  • lib/utils.d.ts (0 hunks)
  • lib/utils.js (0 hunks)
  • package.json (1 hunks)
  • src/index.ts (1 hunks)
  • test/index.spec.ts (1 hunks)
💤 Files with no reviewable changes (7)
  • lib/types.js
  • lib/tsconfig.tsbuildinfo
  • lib/index.d.ts
  • lib/utils.d.ts
  • lib/types.d.ts
  • lib/index.js
  • lib/utils.js
🔇 Additional comments (5)
.gitignore (1)

2-5: Looks good: Reorganized .gitignore entries.

The changes properly reorganize the ignore patterns and add the lib directory to the ignore list, which aligns with the removal of the lib directory's source and declaration files in this PR. The more generic .*cache pattern is also a good improvement over the specific .eslintcache.

.prettierignore (1)

2-2: LGTM: Added test/fixtures to prettierignore.

Adding the test/fixtures directory to the ignore list is appropriate, as test fixtures often contain intentionally formatted code that shouldn't be modified by Prettier.

src/index.ts (1)

426-426:

Details

✅ Verification successful

Simplified module export to directly expose format function.

This change correctly addresses the regression by simplifying the default export to only expose the format function directly, rather than an object containing both format and analyze. This matches the PR objective to fix the export entry regression.


🏁 Script executed:

#!/bin/bash
# Verify how the module is imported in the project and downstream dependencies

# Check for imports in the test files to see if they've been updated
grep -r "from 'prettier-eslint'" --include="*.ts" --include="*.js" ./test

Length of output: 225


🏁 Script executed:

#!/bin/bash
# Display the first 200 lines of test/index.spec.ts to inspect import usage
sed -n '1,200p' test/index.spec.ts

# Display the first 200 lines of test/utils.spec.ts to inspect import usage
sed -n '1,200p' test/utils.spec.ts

Length of output: 10579


🏁 Script executed:

#!/bin/bash
# Verify named exports and default export in src/index.ts
rg -n "export .*analyze" src/index.ts
rg -n "export default" src/index.ts | head -n 20

Length of output: 185


Default export now correctly exposes format

The module’s default export in src/index.ts has been simplified to point directly at the format function. Named exports such as analyze remain untouched, and the tests in test/index.spec.ts confirm that the default import (prettierESLint) equals format. No further changes are required.

test/index.spec.ts (2)

32-32: Updated test to match new export structure.

The test has been correctly updated to verify that prettierESLint is now directly the format function, rather than an object with a format property. This change properly aligns with the updated export in src/index.ts.


34-34: Removed redundant closing brace.

The closing brace of the test block has been adjusted to match the removal of the test for the analyze function export, which is consistent with the simplification of the module's exports.

Signed-off-by: JounQin <admin@1stg.me>
Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 413afd2 in 1 minute and 32 seconds

More details
  • Looked at 736 lines of code in 16 files
  • Skipped 2 files when reviewing.
  • Skipped posting 11 drafted comments based on config settings.
1. index.d.ts:3
  • Draft comment:
    The interface still extends typeof format and includes both format and analyze, although the default export is now just format. Consider clarifying/documenting this discrepancy or possibly updating the interface to reflect the new export pattern.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    Since this is a new file, all code is changed code. The comment points out a potential design issue in the type definitions. However, without seeing the actual implementation and export patterns in the referenced files, I can't verify if this is actually a problem or if it's intentionally designed this way. The comment is speculative and asks for clarification rather than pointing out a definite issue.
    I might be too quick to dismiss this - there could be a real type safety issue here that needs addressing. The interface structure does look unusual.
    While the structure is unusual, without seeing the implementation files, we can't know if this is actually incorrect. The comment is asking for clarification rather than pointing out a definite problem.
    Delete the comment because it's speculative and asks for clarification rather than identifying a clear issue that needs fixing.
2. index.js:1
  • Draft comment:
    Default export now directly returns the format function. This change is consistent with the fix but make sure the documentation clearly states that only format is exported as default.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is informative and suggests ensuring documentation clarity, which is not allowed. It doesn't provide a specific code suggestion or ask for a test to be written.
3. package.json:18
  • Draft comment:
    Updated main and types to the new entry points (index.js/index.d.ts) is good. Ensure that downstream consumers are aware of the breaking change in the default export.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is asking the PR author to ensure that downstream consumers are aware of a breaking change. It doesn't provide a specific code suggestion or ask for a specific test to be written. It seems to be more of a reminder or a caution, which violates the rule against asking the author to ensure something is tested or verified.
4. src/index.ts:426
  • Draft comment:
    The default export now exports only the format function. This aligns with the intended fix. Double-check that the removal of analyze from the default export is clearly noted in the changelog.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to double-check that a change is noted in the changelog, which violates the rule against asking the author to double-check things. The first part of the comment is purely informative, stating what the default export now does. Overall, this comment should be removed.
5. test/index.spec.ts:31
  • Draft comment:
    Test now expects the default export to be the format function. Verify that all tests remain valid with the updated export for both default and named exports.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to verify that all tests remain valid with the updated export. This falls under the rule of not asking the author to ensure the behavior is intended or to make sure their change is tested. Therefore, this comment should be removed.
6. src/index.ts:329
  • Draft comment:
    Consider using the nullish coalescing operator (??) instead of || for boolean options in getESLintApiOptions to avoid overriding explicit false values.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. test/index.spec.ts:357
  • Draft comment:
    Pass the promise returned by format() directly to rejects.toThrow instead of wrapping it in a function.
  • 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/index.spec.ts:382
  • Draft comment:
    Similarly, use the promise from format() directly with rejects.toThrow for the prettier module error test.
  • 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. index.d.ts:1
  • Draft comment:
    Verify that the PrettierESLint interface accurately reflects the public API now that the default export is just the format function with attached properties.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to verify the accuracy of the PrettierESLint interface after a change in the default export. This falls under asking the author to confirm or verify something, which is against the rules.
10. package.json:11
  • Draft comment:
    The maintainer entry 'JounQin admin@1stg.me (https://www.1stG.me)' appears to have inconsistent capitalization (e.g. 'JounQin' and the URL '1stG.me' vs the email domain '1stg.me'). Please double-check if this is intentional or a typographical error.
  • 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. src/index.ts:42
  • Draft comment:
    Typographical error: Replace 'To options parameter of format' with 'The options parameter of format'.
  • 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_2LOb6WtE6ut77Tgb


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a537bcb and 5b8c4af.

⛔ Files ignored due to path filters (4)
  • lib/index.js.map is excluded by !**/*.map
  • lib/types.js.map is excluded by !**/*.map
  • lib/utils.js.map is excluded by !**/*.map
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • .changeset/perfect-carrots-repair.md (1 hunks)
  • .gitignore (1 hunks)
  • .prettierignore (1 hunks)
  • index.d.ts (1 hunks)
  • index.js (1 hunks)
  • lib/index.d.ts (0 hunks)
  • lib/index.js (0 hunks)
  • lib/tsconfig.tsbuildinfo (0 hunks)
  • lib/types.d.ts (0 hunks)
  • lib/types.js (0 hunks)
  • lib/utils.d.ts (0 hunks)
  • lib/utils.js (0 hunks)
  • package.json (2 hunks)
  • src/index.ts (1 hunks)
  • test/index.spec.ts (1 hunks)
💤 Files with no reviewable changes (7)
  • lib/types.js
  • lib/index.d.ts
  • lib/tsconfig.tsbuildinfo
  • lib/types.d.ts
  • lib/index.js
  • lib/utils.js
  • lib/utils.d.ts
✅ Files skipped from review due to trivial changes (3)
  • .changeset/perfect-carrots-repair.md
  • index.js
  • package.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • .prettierignore
  • .gitignore
  • test/index.spec.ts
  • src/index.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
index.d.ts (1)
src/index.ts (2)
  • format (30-33)
  • analyze (48-151)
🪛 Biome (1.9.4)
index.d.ts

[error] 3-3: 'extends' list cannot be empty.

(parse)


[error] 3-3: Expected a parameter but instead found 'typeof'.

Expected a parameter here.

(parse)


[error] 3-3: expected , but instead found format

Remove format

(parse)


[error] 3-3: ';' expected'

An explicit or implicit semicolon is expected here...

(parse)

🪛 ESLint
index.d.ts

[error] 1-1: Unable to resolve path to module './lib/index.js'.

(import-x/no-unresolved)

🔇 Additional comments (1)
index.d.ts (1)

1-1: Verify import path and module resolution
The import statement

import {analyze, format} from './lib/index.js'

must resolve correctly in both TS and at runtime. Please confirm that:

  1. lib/index.js (and its accompanying .d.ts) will be included in the published package.
  2. Your tsconfig.json (e.g., moduleResolution, allowJs, resolveJsonModule) supports importing .js files from a .d.ts.
🧰 Tools
🪛 ESLint

[error] 1-1: Unable to resolve path to module './lib/index.js'.

(import-x/no-unresolved)

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 8a970f7 in 1 minute and 41 seconds

More details
  • Looked at 59 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. index.d.ts:5
  • Draft comment:
    The interface extends the Format type and then redefines both 'analyze' and 'format'. Confirm this duplication is intended.
  • 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%
    The comment is technically correct - there is duplication since Format (typeof format) is being extended and format is also explicitly declared. However, this appears to be intentional TypeScript type definition structure, possibly for better type documentation or IDE support. The comment just asks for confirmation without suggesting a clear improvement.
    The duplication might serve a purpose in TypeScript type definitions that I'm not aware of. Maybe it's a common pattern.
    Even if the duplication serves a purpose, the comment doesn't suggest any concrete improvement - it just asks for confirmation, which violates our rules.
    Delete the comment because it merely asks for confirmation without suggesting a clear improvement, which violates our commenting rules.
2. mock.d.ts:6
  • Draft comment:
    Using type aliases (like 'Fs' and 'Prettier') improves clarity. Verify that these aliases match all expected fs and prettier members in downstream tests.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None
3. package.json:21
  • Draft comment:
    The order in the 'files' array changed with 'index.d.ts' now preceding 'index.js'. Confirm that this reordering aligns with intended packaging behavior.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None
4. index.d.ts:5
  • Draft comment:
    Confirm that extending 'Format' and then re-declaring 'format' is intended for a callable export with extra properties.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. mock.d.ts:6
  • Draft comment:
    Using a type alias for 'fs' (as 'Fs') improves consistency; consider a similar approach for ESLint in ESLintMock if desired.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
6. package.json:21
  • Draft comment:
    The ordering in the 'files' array has been changed (index.d.ts now comes before index.js). Confirm that this ordering meets the intended export resolution.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None

Workflow ID: wflow_GT64yVK6CpiVw2ol


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on c333477 in 56 seconds

More details
  • Looked at 65 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. index.d.ts:6
  • Draft comment:
    The interface extends 'Format' (a callable) and then declares a 'format' property. Ensure this duplication is intentional to support both call signature and property access.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
2. mock.d.ts:6
  • Draft comment:
    Using type alias (Fs) for node:fs clarifies this extension. Confirm consistency with other similar type definitions in the project.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50%
    None
3. package.json:20
  • Draft comment:
    The reordering in the 'files' array is minor. Verify that changing the order of 'index.d.ts' and 'index.js' is intentional and doesn't affect packaging.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50%
    None
4. index.d.ts:3
  • Draft comment:
    The namespace 'prettierESLint' is used to contain the callable interface and is later re-exported with the same name. While this pattern is valid, sharing the same name for both the namespace and the exported constant could be confusing for consumers. Consider clarifying with documentation or using a distinct namespace name.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. mock.d.ts:6
  • Draft comment:
    Using type aliases (e.g. 'type Fs = typeof fs' and 'type Prettier = typeof prettier') improves readability compared to inline '(typeof X)'. Removal of the 'prettier-ignore' comments suggests improved formatting. Ensure this aligns with your project’s style guidelines.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. package.json:21
  • Draft comment:
    The order of file entries in the 'files' array has been altered (swapping 'index.js' and 'index.d.ts'). Although order typically does not affect published files, verify that this reordering is intentional and does not impact any downstream tooling in your build/publishing process.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None

Workflow ID: wflow_Ve49sbnUkO9h62YF


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on fe51b81 in 45 seconds

More details
  • Looked at 65 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 10 drafted comments based on config settings.
1. index.d.ts:6
  • Draft comment:
    Extending a function type via alias 'Format' is unusual. Confirm that creating the interface this way preserves expected callable behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50%
    The comment is asking the author to confirm that the behavior is preserved, which is against the rules. However, it also points out an unusual practice, which could be useful for the author to reconsider their approach. The comment could be rephrased to suggest a review of the approach without asking for confirmation.
2. index.d.ts:12
  • Draft comment:
    Use of 'export =' for CommonJS export is correct, but double-check that namespace merging and consumer syntax remain unaffected.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to double-check the effects of using export = on namespace merging and consumer syntax. This falls under the rule of not asking the author to double-check things or ensure behavior is intended. Therefore, this comment should be removed.
3. mock.d.ts:6
  • Draft comment:
    Explicitly creating the type alias 'Fs' improves clarity—ensure consistency with other similar type aliases in the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. package.json:21
  • Draft comment:
    Reordering files (index.d.ts before index.js) is minor but verify that module resolution in consuming projects remains unaffected.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None
5. index.d.ts:3
  • Draft comment:
    Namespace 'prettierESLint' now wraps the export types. Confirm that this structure mirrors the runtime export.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. index.d.ts:6
  • Draft comment:
    Interface 'PrettierESLint' extends the function type correctly. Consider adding brief JSDoc for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
7. mock.d.ts:6
  • Draft comment:
    Using a type alias ('Fs') for 'typeof fs' improves clarity in FsMock. This refactor enhances maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
8. mock.d.ts:39
  • Draft comment:
    Consistent use of the type alias ('Prettier') for PrettierMock improves readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
9. package.json:21
  • Draft comment:
    The order of entries in the 'files' array has been changed. Confirm that this reordering is intentional and does not affect package consumers.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
10. package.json:11
  • Draft comment:
    There appears to be a potential typographical error in the maintainer's name on line 11: "JounQin admin@1stg.me (https://www.1stG.me)". Please confirm if the name is spelled correctly or if it should be adjusted.
  • 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_QezUAq99h4lEfu3g


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on c009bb6 in 54 seconds

More details
  • Looked at 104 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 13 drafted comments based on config settings.
1. __mocks__/eslint.ts:1
  • Draft comment:
    Simplified comment note; ensure removal of the '.ts' note does not affect downstream docs.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. __mocks__/prettier.ts:1
  • Draft comment:
    Removal of the comment block is acceptable; verify the jest.requireActual typing remains correct.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. eslint.config.mjs:33
  • Draft comment:
    Changed file glob pattern to only '*.ts' in mocks; ensure JS mocks are not needed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. index.d.ts:3
  • Draft comment:
    Namespace interface export correctly exposes a callable function with attached properties; verify this pattern meets consumer expectations.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
5. mock.d.ts:9
  • Draft comment:
    Using a type alias for 'Fs' and similar patterns appears consistent; no changes required.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. package.json:20
  • Draft comment:
    Reordering in the 'files' array is non-functional but ensure packaging behavior remains as expected.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
7. __mocks__/eslint.ts:1
  • Draft comment:
    The detailed comment was shortened (removed reference to using '.ts'). Ensure that the rationale for not using .ts (due to test fixture requirements) is documented elsewhere if needed.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
8. __mocks__/prettier.ts:1
  • Draft comment:
    The block comment was removed from the top. Confirm that any important context regarding file extension restrictions is preserved in documentation if still relevant.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
9. eslint.config.mjs:33
  • Draft comment:
    The 'files' pattern was changed from '/*.{js,ts}' to '/*.ts'. Verify that this change does not exclude any necessary JavaScript mocks.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 40% <= threshold 50%
    The comment is asking the author to verify that the change does not exclude necessary JavaScript mocks. This is a request for confirmation, which violates the rules. However, it does point out a specific change in the file pattern that could potentially lead to issues if not intentional. The comment could be rephrased to suggest checking for missing JavaScript mocks without asking for verification.
10. index.d.ts:3
  • Draft comment:
    The namespace export now extends the function type (format) with additional properties, modeling the default export as a callable function. Ensure that this structure aligns with intended API usage and resolves the export regression.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to ensure that the structure aligns with intended API usage and resolves the export regression. This falls under asking the author to confirm their intention or ensure behavior, which is against the rules.
11. mock.d.ts:8
  • Draft comment:
    Refactoring the type extensions (using type aliases for Fs and Prettier) improves clarity. Confirm that these changes don’t impact type compatibility in consuming code.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is asking the PR author to confirm that the refactoring doesn't impact type compatibility, which is against the rules. It doesn't provide a specific suggestion or point out a specific issue with the code.
12. package.json:21
  • Draft comment:
    The reordering of the 'files' array does not affect functionality, but double-check that all intended build artifacts are correctly included/excluded.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is asking the PR author to double-check something, which is against the rules. It doesn't provide a specific suggestion or point out a potential issue with the code itself.
13. package.json:11
  • Draft comment:
    The maintainer name 'JounQin' appears with an unusual capitalization. Please verify if this is the intended spelling or if it should be adjusted 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.

Workflow ID: wflow_5WRkVG27X8RC8QAs


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@JounQin JounQin merged commit 53735a1 into master Apr 18, 2025
10 checks passed
@JounQin JounQin deleted the fix/regression branch April 18, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants