-
Notifications
You must be signed in to change notification settings - Fork 15
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
An exception for cjs config files in a ES modules environment #80
Comments
Just another pedantic note: I am building on windows and to ensure cross-platform compatibility I need to detect the OS and configure things accordingly (e.g. on Windows a linter must accept only CRLF but on other platforms only LF). Using a static |
See also nodejs/modules#389 for ES modules team discussion on this. FYI the current version of eslint supports loading For many tools supporting |
Additionally see cosmiconfig/cosmiconfig#224 as this is likely to cover many tools. |
You can "ditch CJS" by using |
The dream would be to use ES modules with
"type": "modules"
for everything in my project, allowing one to go cold turkey on cjs. However, a number of tools, such as, ESLint require cjs config files. This results in the annoying situation where either:or
.js
file with cjs syntax will throw when"type": "modules"
is enabled..cjs
extension by default.This imho just another form of unnecessary noise due to a absence of conventions and the painful transition process.
The simplest solution, though not ideal, is to relax ES module requirements when running a tool through npx. In the mean time, this group may be able to convince major tools to move to ES6 config files and/or read '.cjs' config by default.
The text was updated successfully, but these errors were encountered: