Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript build in watch mode with eslint possible?

Is there a way doing this without webpack or other bundlers?

Or the only option is to use two consoles where in one you will build and in second lint?

like image 415
ZiiMakc Avatar asked Sep 20 '25 03:09

ZiiMakc


2 Answers

I think there is no way around the fact that this will require two processes: one for 'tsc -w' and the other for the linting. The linting can happen in a 2nd terminal, in your IDE, or in your build script, but either way it is still another process.

Does that answer your question?

like image 142
Tom Avatar answered Sep 22 '25 20:09

Tom


For instance, first: npm i tsc-watch -D and then, in package.json:

"scripts": {
   "lint": "eslint . --ext .ts",
   "serve:reload": "npm run lint && node ./dist/index.js",
   "serve": "tsc-watch --noClear --onSuccess \"npm run serve:reload\"",
like image 31
gvlax Avatar answered Sep 22 '25 20:09

gvlax