1.0.2 • Published 7 years ago

babel-plugin-remove-bugs v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

babel-plugin-remove-bugs

Dependency Status devDependency Status Greenkeeper badge Build Status Code Coverage Npm Version License Badges

A Babel plugin which removes all bugs from your code.

Usage

First install and save this plugin as a development dependency:

npm i -D babel-plugin-remove-bugs

Or if you are using yarn:

yarn add --dev babel-plugin-remove-bugs

Then just add the plugin to your .babelrc file or equivalent Babel configuration:

{
  "plugins": ["remove-bugs"]
}

Example

Consider the following code. Can you spot the bug?

let counter = 0;
const output = document.getElementById('output');
const addOneButton = document.getElementById('add-one-button');

const render = () => {
  output.textContent = counter;
};

addOneButton.addEventListener('click', () => {
  counter += 0;
  render();
});

render();

babel-plugin-remove-bugs can! With this plugin enabled, Babel will output the following:

No more bugs!

Limitations

Being a Babel plugin, we can only remove bugs from files which Babel can parse. That said, this plugin is unable to fix syntax errors which cause Babel to crash.

License

MIT