Skip to content

knpwrs/babel-plugin-remove-bugs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Babel plugin which removes all bugs from your code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published