-
-
Notifications
You must be signed in to change notification settings - Fork 436
Update docs on supported file extensions #917
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
Conversation
Thanks for the PR! LGTM, but for some reason Yarn is having troubles when running the tests (not related to this). Does our readme link to cosmiconfig's, where the extensions are listed? I think having the filenames listed in our readme could only help! |
Codecov Report
@@ Coverage Diff @@
## master #917 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 608 608
Branches 143 143
=========================================
Hits 608 608 Continue to review full report at Codecov.
|
It does link to cosmiconfig's docs, but because there is a static list of [
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.cjs`,
`${moduleName}.config.js`,
`${moduleName}.config.cjs`,
] But then you don't have as much control. I imagine that if you gave a module name of Maybe the wording should be changed where it says:
to something more like:
Since it is configured to be with a list of |
It looks like there is a prior MR doing the same thing: #909 |
I merged the other PR, but if you want still want to update the README, that would be nice. 👍 |
Thanks a lot for the PR, I appreciate it! |
🎉 This PR is included in version 10.4.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
You bet, thank you for the awesome tool :) |
This adds support for common js files using the ES Module interop spec.
This is for projects who have
"type": "module"
in theirpackage.json
, normal.js
files fail to load saying that you need to use import.json
andyaml
work just fine, but in the cases like withtypescript
where you need to runtsc
without passing in file parameters, the only way to do that is with the.js
files.Using the
.cjs
extension forces it to load as a common js file and works correctly even in es-module enabled projects.I'm also happy to update the documentation, but the documentation didn't refer to the other possible extensions mentioned in this file, so I'll wait until I hear back.