1

enter image description here

I have a few Typescript projects where I am suddenly getting getting a bunch of files popping up in the editor as "changed". The first thing that's odd about this is I DIDn't change them. Second, they are all in the node_modules directory rather than my projects src folder.

The trigger -- it would seem -- for the files showing up is me running my build script. This script is fairly mundane, as it:

  • run tslint to make sure there's no dumb mistakes
  • transpile TS files in src to ESNEXT module format in /dist/esnext
  • use RollupJS to transpile this ESNEXT code into CJS and UMD format

The use of Rollup in these projects is pretty new but I'm 100% confident it does NOT change the code in node_modules. This change of behavior did seem to coincide with vs-code 1.24.0 (I'm on 1.24.1 now) and while I'm shooting in the dark I feel it must have something to do with this upgrade combined with my project config.

I will say that in my "user settings" of vs-code i have:

"files.exclude": {
  "**/.git": true,
  "**/.svn": true,
  "**/.hg": true,
  "**/CVS": true,
  "**/.DS_Store": true,
  "node_modules/**": true,
},
"search.exclude": {
  "**/node_modules": true,
  "**/bower_components": true,
  "**/*.d.ts": true,
},

Everything else is quite bland and uninteresting.

ken
  • 8,763
  • 11
  • 72
  • 133
  • I take it back. Files are just popping up even without my running the BUILD script!!!! – ken Jun 14 '18 at 20:20
  • I am not running any watcher processes that would be transpiling (unless vs-code does that under the hood) ... and yet all the files are `.d.ts` files – ken Jun 14 '18 at 20:21
  • Are you using Git? Is your project under Git control? If yes, what `git config core.autocrlf` returns? – VonC Jun 15 '18 at 04:40
  • I am under `git` and that command returns nothing. – ken Jun 15 '18 at 17:40
  • For testing: could you type (anywhere) `git config --global core.autocrlf false`, clone your Git repo in a new folder, open that folder in VSCode, and see if the issue persists? – VonC Jun 15 '18 at 17:42
  • ok, have added the config. will try later today doing the rest. Would be interested though ... what is then angle you're taking on this? Just would be like to grok the debugging a bit better. – ken Jun 15 '18 at 17:47
  • 1
    To avoid any automagic transformation of files (end of lines): https://stackoverflow.com/a/44224929/6309. Check also if you have any `.gitattributes` in your Git repository. – VonC Jun 15 '18 at 17:51
  • It sounds like when you're tsc or compiling your typescript you're not excluding everything that you should. https://www.typescriptlang.org/docs/handbook/tsconfig-json.html look at the exclude block, do you have this in your tsconfig.json – Dylan Wright Jun 15 '18 at 18:59
  • @DylanWright I am doing this ... also, transpiling is part of what I thought the trigger was but there was at least one point yesterday in which it seemed to happen even without that. I am now secretly wondering if maybe my file system watchers were corrupted so I did a hard restart this morning and so far haven't run into the problem but i haven't transpiled yet either. – ken Jun 15 '18 at 19:03
  • FOLKS, i have an update ... the trigger event is when I change the name of a file in the explorer. I am on MacOS and in the case where I did this just now I was changing a file from a camelCase to PascalCase name (I know MacOS is annoyingly weird about caps). – ken Jun 15 '18 at 21:40

0 Answers0