charlesfrye / aoc2022

Solutions to puzzles from Advent of Code 2022
1 stars 0 forks source link

finish automation of setup of node.js+typescript projects #6

Closed charlesfrye closed 1 year ago

charlesfrye commented 1 year ago

I need to get the equivalent of running eslint --init and selecting my preferred options into the Makefile.

Just doing that command gets us pretty far (but is interactive), then I think need:

npm install eslint-config-standard-with-typescript

and to set the parserOptions.project in the .eslintrc.json, not sure how to do the latter programmatically (without falling back on awk/sed).

According to error messages, would have to drop at least the "dot-notation" rule in order to avoid the project setting, not sure how standard that is

charlesfrye commented 1 year ago

also want to add .js files to .eslintignore, because they are autogenerated

charlesfrye commented 1 year ago

(also, could add a command to compile and run, but should check whether that should use nodemon or some other tool)

e: npx ts-node foo.ts compiles and runs foo.ts

charlesfrye commented 1 year ago

can avoid need to specify .ts files manually in tsconfig.json by setting includes with a glob instead of listing files (top-level keys here)

charlesfrye commented 1 year ago

there are also tsconfig.json settings for recompiling and building i should check out

charlesfrye commented 1 year ago

almost done, just need to copy tsconfig.json, using a template in the /node.js folder and add a note about editing the .eslintrc file