azu / commonjs-to-es-module-codemod

Codemod that convert CommonJS(require/exports) to ES Modules(import/export) for JavaScript/TypeScript
MIT License
81 stars 15 forks source link

Wrong output code from `const fs = require('fs').promises` #3

Closed hata6502 closed 3 years ago

hata6502 commented 3 years ago

Input

const fs = require('fs').promises

Current output

import { promises } from 'fs'

Expected output

import { promises as fs } from 'fs'
azu commented 3 years ago

Yes. It is a bug.