Skip to content

Latest commit

 

History

History
56 lines (32 loc) · 1.85 KB

README.md

File metadata and controls

56 lines (32 loc) · 1.85 KB

template-discordbot

A sane, opinionated template for discord bots written in typescript using the discord.js library.

Uses:

  • biome for linting and formatting
  • tsx for running typescript code without transpiling
  • vitest for tests
  • commitlint for linting commit messages
  • husky for git hooks
  • tsup for building

prerequisites

  • filled variables in .env file (see .env.example)
  • a notion of what a discord bot is and how discord.js works
  • a server to test the bot on (that's where you get the server id for the env variable)

running

yarn dev

Runs the project in watch mode.

yarn build

Builds/transpiles the code to ./build.

yarn start

Runs the built project.

yarn test, yarn test:e2e

Runs tests with vitest.

yarn tidy

Runs biome in fix mode (only safe fixes) to lint and format the project.

yarn typecheck

Runs type checking using tsc.

that tsconfig.json seems very strict and opinionated

Yup.

vscode

You might want to install the recommended extensions in vscode. Search for @recommended in the extensions tab, they'll show up as "workspace recommendations".

If you have been using eslint and prettier and their extensions, you might want to disable eslint entirely and keep prettier as the formatter only for certain types of files.

I suggesting using the settings in .vscode/settings-example.json, that should be pasted into your own .vscode/settings.json. I'm not commiting the .vscode/settings.json proper because it shouldn't be in VCS as it contains your personal settings.