Skip to content

docs: add TOML parser options to README#418

Merged
JounQin merged 8 commits intoun-ts:masterfrom
esacteksab:docs/toml-parser-options
Mar 29, 2025
Merged

docs: add TOML parser options to README#418
JounQin merged 8 commits intoun-ts:masterfrom
esacteksab:docs/toml-parser-options

Conversation

@esacteksab
Copy link
Copy Markdown
Contributor

@esacteksab esacteksab commented Mar 28, 2025

I was curious what options were available and couldn't easily finding it without digging into the source. I went looking at other plugins and there doesn't seem to be a consistent pattern, with some writing json and others choosing a <table></table>. I looked at the other packages in the repo, and you use a code fence. I followed that convention.

Hope you don't mind the PR, hopefully it will be easier for others to know what options are supported.

Thanks!

Summary by CodeRabbit

  • Documentation
    • Added a new section titled "Parser Options" detailing configuration settings for TOML file formatting options, including the PrettierOptions interface and its properties for customizing formatting behavior with sensible defaults.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 28, 2025

🦋 Changeset detected

Latest commit: a403d17

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

This PR includes changesets to release 1 package
Name Type
prettier-plugin-toml 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 Mar 28, 2025

Walkthrough

The TOML package documentation has been updated by adding a new section titled "Parser Options" in the README file. This section introduces the PrettierOptions interface, which defines several boolean properties and one integer property (allowedBlankLines) with specified default values for formatting TOML files when using the Prettier plugin. Additionally, a patch entry has been added to the changeset file to reflect this update.

Changes

File Change Summary
packages/toml/README.md Added a "Parser Options" section that introduces a new PrettierOptions interface with boolean properties and an integer property for configuration.
.changeset/forty-wasps-jam.md Added a patch entry for prettier-plugin-toml and updated documentation to include TOML parser options in the README file.

Poem

I’m a bunny hopping through the docs so neat,
Adding parse options with a rhythmic beat,
Boolean flags and numbers in a tidy stream,
Formatting magic like a rabbit’s dream,
With every change, my ears wiggle in delight! 🐰✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 65ffe46 and a403d17.

📒 Files selected for processing (1)
  • packages/toml/README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/toml/README.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Codacy Static Code Analysis

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Mar 28, 2025

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.

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 (2)
packages/toml/README.md (2)

50-51: Typo in Section Header: The header "## Parsre Options" appears to have a typographical error. It should be "## Parse Options" for clarity and consistency with the rest of the documentation.

Proposed Change:

-## Parsre Options
+## Parse Options

75-75: Type Annotation Correction: The property allowedBlankLines is declared with the type int, which is non-standard in TypeScript. Typically, numeric values are annotated with the type number.

Proposed Change:

-  allowedBlankLines: int // default `1`
+  allowedBlankLines: number // default `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 82835c7 and 82f88b3.

📒 Files selected for processing (1)
  • packages/toml/README.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
packages/toml/README.md (1)

50-77: Overall Documentation Enhancement: The addition of the prettierOptions interface effectively details the available configuration options for the TOML parser. This section significantly improves the readability and usability of the documentation.

@esacteksab
Copy link
Copy Markdown
Contributor Author

Actionable comments posted: 0
🧹 Nitpick comments (2)

packages/toml/README.md (2)> 50-51: Typo in Section Header: The header "## Parsre Options" appears to have a typographical error. It should be "## Parse Options" for clarity and consistency with the rest of the documentation.

Proposed Change:

-## Parsre Options
+## Parse Options

75-75: Type Annotation Correction: The property allowedBlankLines is declared with the type int, which is non-standard in TypeScript. Typically, numeric values are annotated with the type number.
Proposed Change:

-  allowedBlankLines: int // default `1`
+  allowedBlankLines: number // default `1`

📜 Review details

Fixed the spelling mistake. With regards to int vs number, I simply took the value from options.ts. Happy to change it.

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)
packages/toml/README.md (1)

50-79: Enhance Type Annotations & Naming Consistency

The new "Parse Options" section with the prettierOptions interface is well documented and clearly communicates the available TOML parser options. I have a couple of suggestions for improvement:

  • Type Correction: In TypeScript, numeric types should be declared as number rather than int. Consider updating:

    -  allowedBlankLines: int // default `1`
    +  allowedBlankLines: number // default `1`
  • Naming Convention: To align with common TypeScript practices, it’s conventional to name interfaces with PascalCase. You may want to rename prettierOptions to PrettierOptions:

    -interface prettierOptions {
    +interface PrettierOptions {

These changes will ensure consistency with TypeScript standards and improve the clarity of the documentation.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 82f88b3 and 1380bc2.

📒 Files selected for processing (1)
  • packages/toml/README.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis

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)
packages/toml/README.md (1)

78-78: Type Annotation Update for allowedBlankLines
To align with standard TypeScript conventions, please update the type of allowedBlankLines from int to number.

Apply the following diff:

-  allowedBlankLines: int // default `1`
+  allowedBlankLines: number // default `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 1380bc2 and 1407c64.

📒 Files selected for processing (1)
  • packages/toml/README.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
packages/toml/README.md (2)

50-50: Header Correctness Check
The header "## Parse Options" is now correctly spelled and conforms with the repository’s documentation style.


52-80: Useful Addition of Configuration Documentation
The introduction of the PrettierOptions interface clearly documents the available TOML formatting options, which should improve discoverability for users.

Comment thread packages/toml/README.md Outdated
@JounQin JounQin force-pushed the docs/toml-parser-options branch from 2e3cce2 to f001fbb Compare March 29, 2025 01:48
Comment thread packages/toml/README.md Outdated
@JounQin JounQin changed the title docs: Adding TOML parser options to README docs: add TOML parser options to README Mar 29, 2025
@JounQin JounQin changed the title docs: add TOML parser options to README docs: add TOML parser options to README Mar 29, 2025
Comment thread packages/toml/README.md Outdated
@JounQin JounQin merged commit 4716026 into un-ts:master Mar 29, 2025
18 checks passed
@JounQin
Copy link
Copy Markdown
Member

JounQin commented Mar 29, 2025

@esacteksab Thanks for catching up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants