screepers / screeps-typescript-starter

Starter kit for TypeScript-based Screeps AI codes.
https://screepers.gitbook.io/screeps-typescript-starter/
The Unlicense
440 stars 318 forks source link

upgrade eslint and fix tsconfig.lib #167

Open Jomik opened 2 years ago

pyrodogg commented 2 years ago

I think the target should stay at ES2018. Node 10 supports ES2018 in all of the major ways.

I've done more research on this than I'm happy about. Node 10 should be dead, it stopped receiving security patches on 30 Apr 2021. So researching it is getting more frustrating as time goes on (ex. I cannot run tests on replit. because drumroll it's a (potentially) insecure package).

Node.green lists ES2018 as 92% supported for Node 10 but this I think is a very minor technicality. Supporting ES2018 allows for the following features to be used without transpiling, object spread and rest syntax, async generators, Promise.finally.

The Proxy ownKeys note is a rather minor footnote https://github.com/kangax/compat-table/pull/1543 Perhaps critical for node/browsers to get right but for devs it's more of a "don't do this, will cause obvious bugs" sort of indicator.


For engine, it would be better to remove it altogether. I really don't want to advocate for more use of Node 10. Players should be free to develop with whatever they want. At most, it was most an indication of what your "output" is expected to run in which would be Screeps MMO running on Node 10.

I haven't had time yet to test the rest of the changes but I suspect the dependency updates are fine, will check on the next pass.

Jomik commented 2 years ago

Object spread and rest syntax is a good point! That at least makes the bundled code smaller in size, so arguably better.

Promises and async generators do not really matter for screeps though.


Completely agree on removing the engine field.

Jeroendevr commented 1 year ago

Can I bump this request to make this PR into the master branch?

Jomik commented 1 year ago

I think the README may need to have an update, to remove the reference to what node version is required.

Jeroendevr commented 1 year ago

Seems a small thing to to, I would like to contribute to. But can I do that within this PR, is that possible? Or should I create a separate PR? Seems like a small fix to just merge this PR and then adjust the readme or do I overlook something?