Skip to content

Latest commit

 

History

History

plugin-convert-commonjs-to-esm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@putout/plugin-convert-commonjs-to-esm NPM version Dependency Status

putout plugin adds ability to convert Commonjs to ESM.

Install

npm i @putout/plugin-convert-commonjs-to-esm -D

Rule

{
    "rules": {
        "convert-commonjs-to-esm": "on"
    }
}

❌ Incorrect code example

const {join} = require('path');

module.exports = () => {
};

✅ Correct code Example

import {join} from 'path';

export default () => {
};

License

MIT