Repository navigation
chore: set shared tsc target (ES6) - #179
Conversation
| "compilerOptions": { | ||
| /* Basic Options */ | ||
| // "incremental": true, /* Enable incremental compilation */ | ||
| "target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ |
There was a problem hiding this comment.
I'm not sure why just touching this file led to such a large diff... sorry!
There was a problem hiding this comment.
Not your fault, it seems this file was using CRLF line breaks for some reason.
|
Would there be a problem if we target older ES versions (i.e. ES5 or ES6)? It seems most popular TypeScript projects are targeting either ES5 or ES6. https://github.com/angular/angular/blob/master/tools/tsconfig.json |
|
I don't have an issue with targeting a slightly older ES version. However, I would push for ES6 (ES2015) because it is well supported in Node and browsers, and this specifically includes Full disclosure, I am considering extending |
|
Additionally, as of TS 4.5 apparently the default for |
|
Ok, let's target ES6 then 👍 |
The commonjs & esm builds have different tsc targets ('es5' & 'esnext'). The javascript
classwas introduced in es6 (I believe), so theParsers exported from the cjs & esm builds are different due to transpilation and have different characteristics. Example:This PR sets the target output to es2018, which is a modern target and 100% compatible with node >= 10. This way the only difference between the CJS & ESM builds is the module system.The target has been changed to ES6.