Michael Billing Michael Billing - 3 months ago 101
TypeScript Question

Can I hide typescript autogenerated .js and .map.js files in atom?

Does anyone know if there is a plugin/option for hiding or grouping autogenerated files in Atom?

The files I want hidden/grouped is what the

typescript compiler
auto generates (
.js
and
.map.js
files).

Visual Studio style grouping would be best, if possible

My typescript file
file.ts


which generates
file.js

file.map.js


file.js
is interesting to read once in a while, but in general its autogenerated and I shouldn't care about it.

So letting
file.ts
be a virtual folder like

- file.ts
- file.js
- file.map.js


would be the ideal solution.

Plain hiding is fine. (hiding
.js
files in general is not a solution, since typescript projects typically mix
.js
,
.ts
and even
.tsx
files)

Answer

Atom respects .gitignore and will grey out any files matching your .gitignore which you place in the root of your project. This should be sufficient to ignore generated files:

*.js
*.jsx

In addition, your tsconfig.json can output all your files into another path. For example:

{
  "version": "1.6.2",
  "compilerOptions": {
    "outDir": "build"
    "sourceMap": true
  },
  "filesGlob": {
    "./src/**/*.ts",
    "./src/**/*.tsx"
  }
}

This will inform tsc and atom-typescript to output all the TypeScript files located in src into build.

Comments