This is a continuation of the addition of eslint to lint Typescript files.
The default @typescript-eslint/recommended doesn't include rules that require type checking, so this PR includes @typescript-eslint/recommended-requiring-type-checking rules to check for those too.
Due to the new rules being enforced, some miscellaneous changes were done:
Modified no-void rule on eslint to allow for "void" at the beginning of statements. This is useful for calling promises that we don't care about the result of.
Remove pad function from util. Functions that used it now use String.padStart() or String.padEnd().
Use fs/promise instead of fs wherever possible to avoid blocking operations.
Make util.find resolve to false when no valid type is given.
Move util.getPrefix to the config command file..
await or void all promises.
Make Command.execute return Promise | void.
Allow presence to be unset/null in config.
This PR also:
Adds a tsconfig.json file.
Adds scripts for verifying that Typescript files don't have errors.
Makes !ping return per shard ping instead of the last pings. This is because Discord.js v12 stopped providing this information to us.
Fixes !config create not checking database errors correctly.
This is a continuation of the addition of eslint to lint Typescript files.
The default
@typescript-eslint/recommended
doesn't include rules that require type checking, so this PR includes@typescript-eslint/recommended-requiring-type-checking
rules to check for those too.Due to the new rules being enforced, some miscellaneous changes were done:
await
orvoid
all promises.This PR also:
!ping
return per shard ping instead of the last pings. This is because Discord.js v12 stopped providing this information to us.!config create
not checking database errors correctly.