twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Fix tsc in twenty-front and install vite-plugin-checker

Open lucasbordeau opened this issue 1 year ago • 1 comments

Scope & Context

twenty-front folder, typechecking.

Technical inputs

tsc is not working anymore on the twenty-front folder. We need to make it work because we're developing without seeing typescript errors on the project level, and that lowers the DX a lot.

See how to tweak the multiple tsconfig files so that we keep linting and typechecking.

Install vite-plugin-checker so we have tsc running in parallel with vite.

lucasbordeau avatar Jan 04 '24 15:01 lucasbordeau

@lucasbordeau I tried taking a look into this and found that none of the files are part of compilation. This is done by using --listFilesOnly flag available on tsc command line. image

But if I directly use the include in main tsconfig.json on twenty-front like this -

  "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
  "references": [
    // {
    //   "path": "./tsconfig.app.json"
    // },
    // {
    //   "path": "./tsconfig.node.json"
    // },
    // {
    //   "path": "./tsconfig.spec.json"
    // }
  ]

The files are getting scanned and tsc is functioning as expected - image Though, it's scanning node_modules too. Since, this is an issue with tsconfig.json, configuring vite-plugin-checker still won't work. I think all the files are getting excluded due to tsconfig in references here.

I haven't worked with tsconfig enough. Could you guide me here how should I approach this in order to preserve the references as well as make tsc work.

i-am-chitti avatar Jan 04 '24 18:01 i-am-chitti

@i-am-chitti We fixed the issue with the core team, for reference here is the PR : https://github.com/twentyhq/twenty/pull/3289

lucasbordeau avatar Jan 08 '24 11:01 lucasbordeau