Skip to content

Should every IoT Agent align to use eslint #830

@jason-fox

Description

@jason-fox

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:

  1. Consistency - users would find it easier to navigate between the various projects.
  2. An Es6 codebase is more modern and likely to attract more contributions.
  3. 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.
  4. Use of constructs such as const and let 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions