* `var mod = require('mod');` => - if `mod` is callable then `import mod from 'mod'` - else `mod` is not callable the `import { a, b } from "mod"` and replace `mod.a` and `mod.b` - namespace import should ever be used? * `var mod= require('mod').a;` => `import { a } from "mod"`; * `const { a } = require('mod');` => `import { a } from "mod"`; * `if (__DEV__) { var warning = require('warning'); }` - disallowed? - have two actions? one sync and one async? * `function f() { var warning = require('warning'); }` => `async function f() { var warning = await import('warning'); }` - maybe do nothing here as well * `module.exports = EventPlugin;` => `export default EventPlugin;` - fix imports in other files - should we also fix `require("mod")` to `require("mod").default`? * `module.exports.blah = 0` => `export const blah = 0` - should we support this too ``` var myModule = module.exports = exports = {}; myModule.a = 0; ``` - this is another common pattern in CJS modules that we should consider supporting - we already have handling for this in the binder in .js files * `module.exports = require('mod');` => `export * from 'mod';` * `module.exports = {foo: function () { } ... }` => `export function foo() {}` ? - is this even common enough to support?
var mod = require('mod');=>modis callable thenimport mod from 'mod'modis not callable theimport { a, b } from "mod"and replacemod.aandmod.bvar mod= require('mod').a;=>import { a } from "mod";const { a } = require('mod');=>import { a } from "mod";if (__DEV__) { var warning = require('warning'); }function f() { var warning = require('warning'); }=>async function f() { var warning = await import('warning'); }module.exports = EventPlugin;=>export default EventPlugin;require("mod")torequire("mod").default?module.exports.blah = 0=>export const blah = 0module.exports = require('mod');=>export * from 'mod';module.exports = {foo: function () { } ... }=>export function foo() {}?