Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output .js files as read/execute only #14726

Closed
ORESoftware opened this issue Mar 19, 2017 · 1 comment
Closed

Output .js files as read/execute only #14726

ORESoftware opened this issue Mar 19, 2017 · 1 comment
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript

Comments

@ORESoftware
Copy link

ORESoftware commented Mar 19, 2017

Regarding this issue thread:
#843

It seems like it would be a nice-to-have to configure tsc to output .js files that were readonly/execute only. That would prevent people from editing the wrong file. (Editing the .js instead of editing the .ts/.tsx).

This will be especially useful in conjunction with a "preserveWhitespace" compiler option which would make the outputted .js files look much more like source code than before such an option.

So in the compiler options, I would like to see something like:

{
  "compilerOptions": {
    "declaration": true,
    "permissions":{
      "read": true,
      "write": false,
      "execute": true
    }
}

or instead of that perhaps this:

{
  "compilerOptions": {
    "permissions": "555",   // read and execute only

}

I suppose it's possible that someone may wish to write out js code that was no executable either, or whatever.

like I was saying - I haven't had too many problems as of yet editing the wrong files but with a "preserveWhitespace" option in place, it will be much more likely to happen to unsuspecting developers.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2017

The compiler does not do file manipulation of this sort. i would recommend having a post-build step, or using a build driver like gulp or grunt to do that.

@mhegazy mhegazy closed this as completed Apr 27, 2017
@mhegazy mhegazy added Suggestion An idea for TypeScript Out of Scope This idea sits outside of the TypeScript language design constraints labels Apr 27, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants