Rule proposal: `prefer-module`
See original GitHub issueShould fail on all legacy commonjs stuff.
Fail
const foo = require('./foo');
const foo = path.join(__dirname, './foo.js');
module.exports = {};
exports.foo = {};
Pass
export default foo;
const foo = path.join(path.dirname(url.fileURLToPath(import.meta.url)), './foo.js');
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:25 (16 by maintainers)
Top Results From Across the Web
Proposed rule: Order Competition Rule - SEC.gov
proposed rule would prohibit a restricted competition trading center from internally executing certain orders of individual investors at a ...
Read more >eslint-plugin-unicorn/prefer-module.md at main - GitHub
Prefer JavaScript modules (ESM) over CommonJS. This rule is enabled in the ✓ recommended config. This rule is automatically fixable by the --fix ......
Read more >Rule proposal: `prefer-module` #1067 - Issuehunt
Rule proposal : `prefer-module` #1067 ... 1️⃣ Explain here why this rule would be beneficial --> ... How about just prefer-module or prefer-modules...
Read more >The Most Curious Rule Proposal in Securities and Exchange ...
I write this post in response to the release (the “Proposing Release”) regarding proposed rules (the “Proposed Rules”) under the Investment ...
Read more >Google JavaScript Style Guide
6 Naming: 6.1 Rules common to all identifiers: 6.2 Rules by identifier type: 6.3 Camel ... Where it does not interfere with readability,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just want to point out that:
could be simplified to:
and in many cases you could just do this as
fs
methods supportURL
:We should note this in the docs.
How about just
prefer-module
orprefer-modules
? Alternatively,prefer-js-module
.