Right. I think the autogeneration of types should only be done if you have configured strapi to be a typescript project.
The idea behind generating types even for JavaScript projects is that it would allow Strapi types to propose better intellisense for common APIs (such as the entity service) even for regular JS code.
New JS Strapi projects are created with a jsconfig.json file which makes use of the generated types to check the project.
In fact, according to the documentation it should not automatically generate the type files, it
autogenerationdefaults tofalse(according to documentation). TypeScript configuration | Strapi Documentation.
The documentation has not been updated as it should have when we’ve removed the option. Sorry for this.
And about the typescript files, it seems (to me) that these files are required if you use strapi in typescript context, but what if you’re not?
Those are not required but we highly advise making use of them.
I tried to set it to false manually via
config/typescript.jsandconfig/typescript.ts. It still generates the files. Seems like a bug to me
We’re adding back the experimental autogenerate option for JavaScript projects only. It should be available in the next version
I think the files under
types/generatedare required, so they should be committed.
I tend to recommend committing them. The only issue that can arise from this is if you’re using the enterprise edition which can result in differences if the generation happens sometimes in CE and sometimes in EE