p2r3 / epochtal

Portal 2 tournament framework
https://epochtal.p2r3.com/
GNU General Public License v3.0
8 stars 4 forks source link

Bundle ESLint and Bun configurations with epochtal #67

Closed PancakeTAS closed 4 months ago

PancakeTAS commented 4 months ago

One at a time:

Bun launch configurations

Installing the official VSCode Bun extension makes debugger a whole lot easier.

Immediately, breakpoints and proper debugging becomes possible. The purpose of debugging should be self explanatory, however here's two screenshots to show just how neat the debugger is: image image

Additionally, one can FINALLY bind restarting epochtal to a hotkey, woo. All of this can be achieved by bundling a single launch.json file that completely universal.

ESLint

VSCode's integrated JavaScript language server simply sucks. Bugs like steamid and the countless other ones I encountered after attaching ESLint should've been avoided from the start.

ESLint is the go-to js language server. It's configured through a single json file and completely customizable. It can immediately highlight unused variables, potential undeclared variables and most importantly: tell you where you forgot semicolons, lol. It can also enforce double quotes, curly braces or whatever you program it to. After some tampering around I achieved a config that already discovered 3 enormous bugs, one of which I will post below: image image

Setting up ESLint again is just a VSCode extension. On Arch Linux I didn't even have to install the system package eslint, though that might be necessary on other distros, idk.

I've already started working on a configuration, so I will immediately assign myself to this. (also, I did not find any of the tags suitable for this)

PancakeTAS commented 4 months ago

I have a bunch of local changes prepared already, I'm too tired to commit then (lol). Will do so tomorrow!