google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.54k stars 424 forks source link

Pushing TS files changes indentation and removes empty lines. Could this be configured? #883

Open kjaku opened 2 years ago

kjaku commented 2 years ago

Expected Behavior

Code style should look as is was locally in VSCode or it should be configurable.

Actual Behavior

After clasp push in editor there is // Compiled using ts2gas 3.6.5 (TypeScript 4.3.4) and all code is formatted into 4 spaces (or 2 tabs) indentation and all empty lines are removed.

Steps to Reproduce the Problem

  1. Rename Code.gs to Code.ts
  2. clasp push
  3. Check effect in online editor

tsconfig.json:

{
    "compilerOptions": {
        "experimentalDecorators": true,
        "target": "ES2019"
    }
}

.prettierrc:

{ 
  "singleQuote": false,
  "trailingComma": "es5",
  "tabWidth": 2,
  "useTabs": false,
  "endOfLine": "auto",
  "printWidth": 100
}

Specifications

calebmisclevitz commented 2 years ago

I noticed this too. I haven't found a workaround other than to ignore it, but it's a little frustrating. Would be cool to at least learn of a more compatible way to configure.