Obsidian_to_Anki icon indicating copy to clipboard operation
Obsidian_to_Anki copied to clipboard

Add editorconfig and prettier to project

Open mattcoleanderson opened this issue 1 year ago • 2 comments

There are many styling inconsistencies through the project:

  • Files with mixed tabs and spaces
  • Files with different indentation levels
  • mixed used of double and single quotes
  • etc.

This is a common result of open source projects that without formatter/linter due to different editor setups per user.

In this PR I've added an editorconfig for live formatting and prettier for post formatting.

I've also added a precommit hook to run prettier on all staged files upon a commit. This will further ensure styling stays consistent.

I've gone ahead and ran prettier against the entire code base to fix all styling issues via npx prettier . --write. However, some of the styling choices I've made are arbitrary and are absolutely up for discussion.

mattcoleanderson avatar Feb 14 '24 15:02 mattcoleanderson

Awesome! Thought of doing this myself as it's very important. Didn't check out the pr yet. Will merge asap.

ShootingKing-AM avatar Feb 16 '24 09:02 ShootingKing-AM

Seems like some tests are failing

ShootingKing-AM avatar Feb 16 '24 10:02 ShootingKing-AM