Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor so that new rules can be easily added #9

Open
pmcelhaney opened this issue Dec 31, 2017 · 0 comments
Open

Refactor so that new rules can be easily added #9

pmcelhaney opened this issue Dec 31, 2017 · 0 comments
Labels

Comments

@pmcelhaney
Copy link

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.

pmcelhaney pushed a commit to pmcelhaney/eslint-transforms that referenced this issue Dec 31, 2017
To add a new transform:

1. Create a directory under tests/fixtures/transforms
2. Add the test fixtures (*.input.js, *.output.js, and *.md)
3. Implement the transform in lib/transforms

There's no need to create new (Mocha) test file. At this point, documenting the transform is still manual, but it could be easily automated.
pmcelhaney pushed a commit to pmcelhaney/eslint-transforms that referenced this issue Dec 31, 2017
To add a new transform:

1. Create a directory under tests/fixtures/transforms
2. Add the test fixtures (*.input.js, *.output.js, and *.md)
3. Implement the transform in lib/transforms

There's no need to create new (Mocha) test file. At this point, documenting the transform is still manual, but it could be easily automated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant