Sharing Typescript project settings via git

Hey Webstormers,

first of all a Happy New Year!

I'm wondering which files of my .idea folder should go into version control in a multi-module setup with Typescript.

We see a lot of changes to .idea/libraries/tsconfig_roots.xml files. Are those supposed to be shared or are these machine dependent?

Best

Sebastian

8 comments
Comment actions Permalink

Hmm... Not sure where this library comes from - can you see it in Settings | Languages & Frameworks | JavaScript | Libraries?

0
Comment actions Permalink

Hi Elena,

yes, there is a library 'tsconfig$roots' in the JS libraries configured as a project library.

 

0
Comment actions Permalink

Might be smth auto-generated (didn't see it created though). I can tell for sure that it doesn't have to be version controlled. Not even sure if it's needed at all... Try deleting it - are there any problems?

0
Comment actions Permalink

I tried to remove the libs but apparently they are auto-generated. When I delete them from git, I still see references to these logical libraries in the iml file of my modules.

`<orderEntry type="library" name="tsconfig$roots" level="project" />`

Also there is a reference in `jsLibraryMappings.xml`. When I reopen the project with the tsconfig_roots.xml deleted on the cmd line, it is regenerated automatically, though. Long story short: I wonder if it is really ok to have seemingly inconsistent configuration in git.

0
Comment actions Permalink

Try deleting the library in Settings | Languages & Frameworks | JavaScript | Libraries - this should remove all references from .iml, etc. files

0
Comment actions Permalink

I did this but after I reopend the project, it was automatically added again.

0
Comment actions Permalink

just checked - this library is indeed auto-generated if path mappings in tsconfig.json include `external` paths (located outside of the project). As the library is automatically created from your tsconfig.json, version controlling it doesn't make much sense... I don't think that adding .idea/libraries/tsconfig_roots.xml  to .gitignore would make your configuration inconsistent

0
Comment actions Permalink

Perfect. Thank you for confirming the behavior as expected and correct! I'll remove all the stuff and let you know if it works for our setup. We do indeed have externally shared tsconfigs.

0

Please sign in to leave a comment.