ola icon indicating copy to clipboard operation
ola copied to clipboard

Add JS Linting to the RDM test code

Open peternewman opened this issue 6 years ago • 4 comments

So things like this can't slip through: https://github.com/peternewman/ola/commit/a93a464f7669d3355a3b4bae10bf4c2b86c77c6d

peternewman avatar Jan 07 '19 17:01 peternewman

Hm, your example mentions a typo in a (jsdoc) comment. Do you recommend any linter that fetches those? Would the linter run in the "normal" build process (possibly requiring and additional dependency) or just for "developer builds"?

kripton avatar Sep 26 '21 20:09 kripton

I'd recommend ESLint with the eslint-plugin-jsdoc and its check-types rule.

FloEdelmann avatar Sep 27 '21 06:09 FloEdelmann

Hi @kripton ,

Would the linter run in the "normal" build process (possibly requiring and additional dependency) or just for "developer builds"?

I don't think we'd want to require the dependency, but we could run it for those who have it available. Currently it's done outside of the main Make process as it doesn't interact with it at all (compared to say the bison/yakk stuff) and most people (myself included) rarely touch it and just use the "pre-compiled" files. It's just run via Travis here: https://github.com/OpenLightingProject/ola/blob/f2f228eafcccc1a03c48875737e103c8cca9510a/.travis-ci.sh#L217-L222

So for now it would make sense to just stick such checks in with the code for the "New" Web UI here: https://github.com/OpenLightingProject/ola/blob/master/javascript/new-src/Gruntfile.js

I'll leave it to @FloEdelmann or others to suggest whether or at which point it might be worth us splitting them out to two separate Gruntfiles.

peternewman avatar Sep 27 '21 15:09 peternewman

I think having everything in one Gruntfile is good enough for now.

FloEdelmann avatar Sep 29 '21 16:09 FloEdelmann