tmi.js-v2
tmi.js-v2 copied to clipboard
chore: lint
- Adds eslint + prettier config and linted all files.
- Adds gh workflow to lint on PR and Push
- Adds precommit hook to lint staged files and ensure conventional commit is used for commit names
- Adds recommend vscode extensions and appropriate settings for linting
- Moves the esbuild script to typescript because linting that file informs you that
// @ts-check
is not a good way to check js files - Replaces esuild-plugin-replace (lol) with esbuild-plugin-version-injector for a better version insertion scheme that lint is happier about.
There are code changes in this PR. Most of them are to satisfy lint and are no functionally different. However, a few are bug fixes that showed themselves to be bugs via linting.
I like this ruleset and use it all over the place (also happens to be what we use in discord.js) but if there is code styling that you do not like, I am happy to change those rules before merging this. There are a couple of places where I disabled rules for a chunk of lines because it was obvious that they were split up on purpose for readability and the "more readable" linted version was not actually.
P.s. Sorry about the diff, not much to do about that, and better to do it now than later.