mst-gql
mst-gql copied to clipboard
Update generator to not generate unused imports / exports
Add // @ts-nocheck in header for generated *.ts files, for prevents tsc errors.
this might be an issue with your ts config, I'm not seeing errors in our example project or in my project that uses mst-gql. If you are having issues more information would be helpful.
I'm using CRA in project.
Common errors like: TS6133: 'RootStore' is declared but its value is never read. TS6192: All imports in import declaration are unused.
I can't add rules into tsconfig, cause it will be affect all project.
And I can't exclude generated directory using tsconfig exclude property:
Any files that are referenced by files included via the "files" or "include" properties are also included. Similarly, if a file B.ts is referenced by another file A.ts, then B.ts cannot be excluded unless the referencing file A.ts is also specified in the "exclude" list.
ah, so this has to do with the generated model code. Ideally our generator should not be generating unused imports. I'm going to rename this issue to cover that issue.
For now you can safely remove unused imports in the generated code to remove typescript errors. Unfortunately you'll need to do this every time you run scaffold, but hopefully we can get to cleaning this up!