medic / cht-conf

A command-line interface for configuring Community Health Toolkit applications
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
22 stars 25 forks source link

Declarative system eslint rules should allow the library to be written in JavaScript ES6 #573

Open kennsippell opened 1 year ago

kennsippell commented 1 year ago

What feature do you want to improve? The code in src/nools has eslint rule requiring ecmaVersion: 5. It'd be super nice to work in ES6 and support features like const, destructuring, spread, etc. ES6 is supported after Chrome 51. XWalk android container was Chrome 54.

I'm unclear why the code in this folder is special cased. I suspect it was something back in CHT 2.x days? Or pre-XWalk users used the Chrome WebView and could have had Chrome <51.

Describe the improvement you'd like Relax the eslint rule to require ES6.

Additional context I'm unclear if this would be called a "breaking change"?

garethbowen commented 1 year ago

I'm unclear why the code in this folder is special cased.

Isn't it because this code is executed in the browser, unlike the rest which is only executed on command line? We can be much more aggressive with backwards compatibility for app dev CLI than CHW browsers. I think it would be a better design to bundle this code into the cht-core webapp behind some API so it can comply with the cht-cores browser support rather than cht-confs.

I think es6 would be safe though, as you say, even xwalk supported it (almost) completely. So +1 from me.