-
Notifications
You must be signed in to change notification settings - Fork 91
Description
LoRaWAN and OPC-UA already use ES6 and are linted using ESLint. The telefonica IoT Agents code base is older and continues to use jshint
I see several advantages of swapping out the older linter and replacing it with the ES6 compliant one:
- Consistency - users would find it easier to navigate between the various projects.
- An Es6 codebase is more modern and likely to attract more contributions.
- EsLint can be configured to check code only and delegate formatting rules to work with prettier to avoid the need for extra jshint workarounds in the code base.
- Use of constructs such as
const
andlet
is supposedly more performant - well they would say that wouldn't they
The existing minimum node engine is Node 8. Node 8 is reaching EoF and is already compliant with const
and let
anyway . I can't see why there would there be any problem is upgrading the IoT Agents to use the newer syntax? It's just a start - ideally someone can delete the existing async library callbacks and replace them with proper native ES2015+ Promises and use async await
- it would make the code a lot easier to follow. I'm not sure if the iot-node-lib eventually needs to offer promise endpoints itself or just use utils.promisify()
but that is an issue for another day. This would just be a start.
As a broad mechanical automated change, it would make sense to try push this through whilst there is a lull to avoid merge conflicts with other ongoing PRs.