Fixing Nits
As I was exploring #29, I came across some minor stuff that I figured would be good to add to the codebase:
- Replace
useContext(ThemeContext)withuseTheme(). - Removed
"theme"fromsplitProps(htmlProps, ["children", "theme"]);.- This is already removed a few lines above and was throwing some TS errors during #29.
- Simplified conditional logic through short-circuit
return. - Replaced
lettoconst(where applicable). - Remove
nullfrom optional params.- This simplifies the TS slightly since
undefinedis captured through optional params already.
- This simplifies the TS slightly since
- Added
"solid"preset to babel config. - Added
"forceConsistentCasingInFileNames"to tsconfig.- VSCode recommends doing this to ensure consistency across OS's.
- Ran
prettier --write .✨ .
I am definitely open to feedback / suggestions.
The diffing on src/index.js got affected by prettier it seems. If this is an eye-sore, I can remove the prettier changes from this file 👍🏻 .
@ryansolid Is there anyone you'd recommend to review this?
Hmm.. because of all the changes the diff on index.js is basically useless. It might be better without prettier, so I can make sense of it.
@ryansolid Yeah, I agree. I will remove the prettier change in index.js.
Maybe in a different PR, we could introduce linting/prettier rules to run on every commit. This can be achieved with something like husky + lint-staged.
@ryansolid I pushed out index.js without prettier changes. Lmk if there's anything else 👍🏻 .