Skip to content

Output .js files as read/execute only #14726

Closed
@ORESoftware

Description

@ORESoftware

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Out of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions