Skip to content
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

Update: allow empty string toml config #7418

Merged

Conversation

Shinyaigeek
Copy link
Contributor

@Shinyaigeek Shinyaigeek commented Dec 8, 2021

↪️ Pull Request

Fixes: #7371

Hi! team 👋
Currently, loadConfig module early returns null when configuration file is an empty string. However, some files such as .toml and .yaml allow an empty string file, so loadConfig should not early return null when the config file is an empty string.

I fixed this behavior to parse also empty string files (, and a file parser throws an error when a file parser such as JSON does not allow empty string).

💻 Examples

with empty json

スクリーンショット 2021-12-09 1 23 29

🚨 Test instructions

  • parse a valid JSON config file
  • loadConfig should throw an error with the invalid empty string JSON
  • loadConfig can load a valid empty string toml

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@height
Copy link

height bot commented Dec 8, 2021

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link
Member

@mischnic mischnic left a comment

Choose a reason for hiding this comment

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

Thanks!

@mischnic mischnic merged commit b27515e into parcel-bundler:v2 Dec 11, 2021
bhovhannes pushed a commit to bhovhannes/parcel that referenced this pull request Dec 23, 2021
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.

getConfig returns null for empty config file
3 participants