Comments (19)
its all green on https://kangax.github.io/compat-table/es2016plus/
from bases.
Hey, author of https://stackoverflow.com/a/61305579/148072 here 👋
Since Node.js 14 supports ES Modules, I wanted to take advantage of that. That's why it uses "module": "ES2020"
& "moduleResolution": "node"
, instead of "module": "commonjs"
.
I wouldn't say that anyone is right or wrong! It depends on wether you want to stick with require('...')
for a while longer, or start using import _ from _
even though it's still quite new to Node.js...
from bases.
Nice write-up in that SO Linus!
TS's support of the node implementation of ESM isn't complete enough that we class it as a feature in TypeScript yet - but when we do, I think we can ship a separate node14-esm
base for folks to work from 👍🏻
from bases.
It should auto publish overnight, if it doesn't that's a bug!
from bases.
It did https://github.com/tsconfig/bases/runs/1163996333?check_suite_focus=true#step:6:17
from bases.
+1 to add this 😄
from bases.
Want to take a look at figuring it out?
from bases.
I think that the tsconfig for Node 14 could be something like this :
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 14",
"compilerOptions": {
"lib": ["es2019", "es2020"],
"module": "commonjs",
"target": "es2020",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}
@orta What do you think about this ?
from bases.
It could be it - Did you verify the features in es2019 / es2020 are available inside that version of node?
from bases.
yes, it's all in the page you linked before : https://kangax.github.io/compat-table/es2016plus/
To be complete, more details are available here :
ES2019 is already supported in Node 12 ;) :
https://github.com/tsconfig/bases/blob/master/bases/node12.json
from bases.
And, by the way, all ESNEXT at Stage 3 are supported too : https://node.green/#ESNEXT
from bases.
Great, agree - want to ship a PR to claim the credit?
from bases.
Ok, I'll try to do the PR this evening, on 1-2 hours 😉
thanks
from bases.
Here's the PR #36
from bases.
@orta is it possible to publish @tsconfig/node14
?
from bases.
Hi,
Your config disagrees with https://stackoverflow.com/a/61305579/14731. Who is right?
from bases.
@orta Thanks!
TS's support of the node implementation of ESM isn't complete enough that we class it as a feature in TypeScript yet
Is this documented somewhere? 🤔 or is there anything in particular that doesn't work?
from bases.
does node 14 base work with node 15?
EDIT: it did not crash, so I'm just going to go with it 😆
from bases.
Node 14 is in, so I'm closing this
from bases.
Related Issues (20)
- Unofficial VSCode Extension HOT 2
- Node.js v18 & v19 don't support some es2023 features HOT 3
- missing settings in @tsconfig/strictest HOT 2
- [CHORE] Naming inconsistency in configs
- Add `javascript.json` HOT 2
- Remix: the `baseUrl` in `remix/tsconfig.json` is useless HOT 2
- README instructions about ESM is invalid HOT 1
- `@tsconfig/esm` is deprecated in README, but v1.0.5 has been just released HOT 2
- Remove noEmit from `Create React App` HOT 2
- Add react config HOT 2
- Reasoning behind removing the ESM config HOT 2
- Add bundler config HOT 2
- Node v21 support HOT 1
- Feature Request: Add a Dedicated Node ESM Configuration HOT 4
- Confused - why is this marked as deprecated on npm? HOT 2
- Chrome extension base HOT 1
- @tsconfig/node20 has tsconfig "moduleResolution": "node16" HOT 1
- Is it tsconfig/bases policy that there is no `vite-vue`? HOT 1
- tsconfig/recommended does not allow for "newer" ES features... HOT 1
- node presets: consider adding allowSyntheticDefaultImports: false? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bases.