eslint / eslint-transforms

Codemods for the ESLint ecosystem
Other
22 stars 8 forks source link

Refactor so that new rules can be easily added #9

Open pmcelhaney opened 6 years ago

pmcelhaney commented 6 years ago

This repository currently only contains one transform. It's tested by looping over fixture files with <test>.input.js and <test>.output.js.

There's no reason we shouldn't be able to use the same test for additional transforms and provide a new set of fixtures for each transform.

We can also automatically the scan the fixtures directory rather than referencing each one in the test file.

The only question is what to do with the comments describing each transform. I'm going to solve that by creating a <test>.md file for each of the fixtures. In the future, we could write a script to automatically generate documentation that collects everything in one place.