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
Support ESM config (.eslintrc.mjs) #13440
Comments
Now that we have an asynchronous API, I believe that supporting |
Would you like to create an RFC for adding support for |
@kaicataldo Oh, wow—I thought this was already on the roadmap based on all of the discussion around it. I’ll take a look at the RFC process. Does it require having any knowledge of ESLint’s internal API (not user API)? |
The RFC template is a section for outlining what kind of changes would be required to implement it, which is really useful both for evaluating trade offs as well as for whoever ends up implementing the accepted RFC. This is definitely something we want to do, but I do think it makes sense to go through this process to make sure we approach it thoughtfully. |
@kaicataldo I looked and I don't think I have enough knowledge about ESLint internals to provide implementation details. Is there an RFC for an RFC 😄? |
Ha! My personal take is that this is something we’re going to have to implement eventually anyway, if you’re willing to wait :) In the meantime, it should be possible to use a |
Sure—I just didn't see a place to track ESM configs specifically, so I created this issue. |
@kaicataldo I would like to try to solve this issue :) |
@Rishabh-malhotraa Great! As mentioned above, the next step is create an RFC for this so that we can decide how this should be implemented. |
Given that we are moving forward with a different config system, I think any changes should be proposed for the new system rather than continuing to modify the current system. |
@nzakas I thought it was just an RFC at this point. Especially in consideration of the statement in your most recent message, isn’t it prudent to support ESM in the current system? |
The RFC was accepted several months ago and will be the new config system for ESLint. There were some outstanding questions that had to be answered so I kept iterating until we got most of them ironed out. It will be formally merged this week with development starting next week. I don’t see a scenario where it makes sense to update the eslintrc config system to support ESM. The simple config system actually makes supporting ESM super easy, though I’m not sure I’d want to support the .mjs extension as I think that will be a relic in the next couple years. However, we could support ESM in simple config files relatively easily. |
@nzakas i'm not sure why it'd be a relic; it'll be supported by node for the foreseeable future, and is the best way to avoid ambiguity about what |
@ljharb I just don't foresee people using it much after the transition period from CJS to ESM. Right now, it's a stopgap for needing to support both in Node.js packages, but eventually (and probably sooner than we realize), no one is going to be writing CJS, so I'm not sure it's worth adding in support for a stopgap measure that eventually won't be used. |
imo that's entirely false :-) people are still writing ES5, and sloppy code, and Scripts, and I think CJS will be around for effectively ever. Obv we don't have to agree here, but the node modules group is expecting a minimum of 10 years before it'd even be remotely possible to consider deprecating any CJS features. |
Here's the nice thing about my approach: if I'm wrong, we can always add support for |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
As a final note here: ESM config will be part of the eslint/rfcs#9 implementation. |
Well yes, but only sort of. I just tried to use a dynamit |
Search terms used:
is:issue is:open mjs OR esm OR "es module"
cf. #12593, which was auto-closed. All of the issues/RFCs mentioned as blockers in that issue are now closed/merged.
What is the status of ES module support for config files? In the form of
.eslintrc.mjs
or.eslintrc.js
where the nearestpackage.json
includes"type": "module"
The text was updated successfully, but these errors were encountered: