I realized that a lot of the problems I'm having as I work in my
local environment on IntelliJ are probably because
I am (implicitly) using inconsistent CompilerOptions in my two environments (synchronized via
clasp)
* GAS environment in the cloud
* my local (MacBook) environment
If
implicit, inconsistent CompilerOptions are the
problem,
then
consistent, explicit CompilerOptions could be the
solution.
Hey GAS team... Could you post the CompilerOptions that are currently being used in the GAS cloud environment? As a ```tsconfig.json``` file? If so, yeahhh!!!! I could use it to make my local compiler behave like yours does. (P.S. And, if you add your tsconfig.json to the
tsconfig/bases GitHub repo, you could add a link to "TypeScript getting started" page and it would help lots of other folks.)
Here's the (non-default) values from my tsconfig.json file. Since I'm having trouble with 'require' vs 'export/import', and because GAS supports all ES6 features (except Modules), I'm betting that tsc(1) needs some tweaking to be really-modern (but not fully), and I bet the 'target' (not 'targets') and 'module' values are critical.
My ```tsconfig.json``` file...
{
"compilerOptions": {
/* Projects */
// No overrides
/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// Default: ES3
// Allowed: es3 es5 es6/es2015 es2016 es2017 es2018 es2019 es2020 es2021 es2022 esnext
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
// Default: CommonJS if target is ES3 or ES5,,
// ES6/ES2015 otherwise.
// Allowed: none commonjs amd umd system es6/es2015 es2020 es2022 esnext node16 nodenext
/* JavaScript Support */
// No overrides
/* Emit */
// No overrides
/* Interop Constraints */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}