Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 594
Michael Frost Billing Avatar asked Sep 21 '15 09:09

Michael Frost Billing


2 Answers

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.

like image 154
Kitson Avatar answered Sep 29 '22 13:09

Kitson


Even better, the tree-view component in atom also has a setting to not show gitignored files at all: enter image description here

It's the "Hide VCS Ignored Files" setting

like image 41
chrismarx Avatar answered Sep 29 '22 13:09

chrismarx