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

Deadly 提交于 2019-12-22 01:37:59

问题


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)


回答1:


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.




回答2:


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

It's the "Hide VCS Ignored Files" setting



来源:https://stackoverflow.com/questions/32691718/can-i-hide-typescript-autogenerated-js-and-map-js-files-in-atom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!