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
Remove the inputFile
option
#656
Comments
On one hand, it would be nice to remove the redundancy, on the other hand, it's also kinda annoying that we need the Some potential solutions:
This issue only exists because JS is so weakly typed. In Swift and many other languages, |
Yes, this makes lots of sense. Thanks a lot for sharing this feedback @sindresorhus, that's super helpful! Other options include:
Please note that this issue is not limited to However, I think it's safe to close this issue when it comes to the |
Maybe we should require this regardless (while still keeping |
Yes, this sounds good. Opened #667 for it. |
The
inputFile
option is now redundant with thestdin
option.The
inputFile
option has one pro: relative file paths do not need to start with.
. This is easily fixed by using URLs, absolute file paths (path.resolve()
), or directly prepending./
to the file paths.However, it has multiple cons:
stdin
(for example{ stdin: ['./path.txt', 'inherit'] }
)Having two almost redundant options complicates the API, so I suggest we remove the
inputFile
option in favor of thestdin
option.Unlike the
input
option, theinputFile
option is a fairly recent feature (from March 2023, release7.1.0
), so it should be a breaking change for only few users.What do you think @sindresorhus?
The text was updated successfully, but these errors were encountered: