babel-plugin-transform-remove-funcall
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

babel-plugin-transform-remove-funcall

npm version npm downloads bundle JSDocs License

A babel plugin that removes certain function calls from your code. For example:

// input
console.log('hello')
Logger.debug('123')
Logger(123)
Logger.log('123')

// output
console.log('hello')

Install

# npm
npm i babel-plugin-transform-remove-funcall
# yarn
yarn add babel-plugin-transform-remove-funcall
# pnpm
pnpm i babel-plugin-transform-remove-funcall

Usage

// .babelrc.js or babel.config.js
module.exports = {
  plugins: [
    ['transform-remove-funcall', { callChains: ['Logger', 'debug', 'log'] }]
    // ...other plugins
  ],
}

// example:
// input
console.log('hello')
Logger.debug('123')
Logger.inst.debug('123')
Logger(123)
Logger.log('123')

// output
console.log('hello')

License

MIT License © 2024-PRESENT Jianxing Xu

Package Sidebar

Install

npm i babel-plugin-transform-remove-funcall

Weekly Downloads

10

Version

0.0.6

License

MIT

Unpacked Size

8.34 kB

Total Files

8

Last publish

Collaborators

  • jianxing