Skip to content

Update: allow empty string toml config#7418

Merged
mischnic merged 4 commits into
parcel-bundler:v2from
Shinyaigeek:update/allow-empty-string-toml-config
Dec 11, 2021
Merged

Update: allow empty string toml config#7418
mischnic merged 4 commits into
parcel-bundler:v2from
Shinyaigeek:update/allow-empty-string-toml-config

Conversation

@Shinyaigeek

@Shinyaigeek Shinyaigeek commented Dec 8, 2021

Copy link
Copy Markdown
Contributor

↪️ 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

height Bot commented Dec 8, 2021

Copy link
Copy Markdown

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.

@mischnic mischnic left a comment

Copy link
Copy Markdown
Member

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