Update: support .eslintrc.cjs (refs eslint/rfcs#43) #12321
In ES module packages w/ "type": "module" defined treat all .js files as ES modules. Since
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?
After searching through the source, I didn't see any tests that cover this code. Is there an existing test I need to add/update to cover this functionality?
Also, what section of the docs should ES module usage be documented?
Thanks for the PR. We ask that changes to core go through the RFC process outlined here. Do you mind doing that?
Incidentally, I don't think we should consider this a bug fix. It would be an enhancement because it would be adding support for an experimental Node feature.
Speaking from experience, any conversation discussing modules + node has a tendency to fall down the rabbit hole. I posted this PR so there's an actual concrete example to look at.
I don't expect this PR to land quickly, if at all.
Not at all, it'll take me a bit to gather and record my thoughts
Of course. The initial issue said 'bug' so I followed that workflow. I'll fix it once I get a feel for the process.
As far as the time schedule goes -- if nothing major has or will change between now and then -- modules will be officially released (ie unflagged) on 20 October. There's still time to discuss, bike shed, shave a few yaks, and decide the best approach for ESLint specifically.
platinumazure left a comment •
This looks good to me at first glance (so far).
I'm a bit surprised there aren't any tests. I guess I would like to see if we could add a new test for the CJS case at least, to avoid regressions.
No need to make any immediate changes, as the RFC is still being discussed. This is just a preliminary review from me.
I added test cases to:
And added the test:
As well as the fixture: