dangreenisrael / eslint-plugin-jest-formatting

ESLint rules for formatting test suites written for jest.
MIT License
156 stars 13 forks source link

Improve base padding rule #72

Closed benkimpel closed 5 years ago

benkimpel commented 5 years ago

Closes #50 Closes #51

benkimpel commented 5 years ago

Ok, now it's ready for a look, @dangreenisrael.

Sorry for the large commit. Given there was a refactor alongside additions, it was too hard to break this into several smaller commits.

I'd recommend skipping the diff on src/rules/padding.ts and just reading through the file as a whole. I added a huge comment at the bottom to explain the algorithm, moved a lot of functions to module scope, renamed functions and parameterss, added comments and types for clarity, etc.

benkimpel commented 5 years ago

@dangreenisrael I think I've addressed your feedback, but let me know if I've missed anything. I did some work on test coverage for ast utils (ast-utils.spec.ts). Two functions left to cover, but i'd vote to handle them at a later time.

dangreenisrael commented 5 years ago

@benkimpel Feel free to merge this

benkimpel commented 5 years ago

@dangreenisrael merge coming up! gonna squish the PR feedback commit... not really valuable for historical purposes.