I've been to MDL-79953 and tried Andrew Lyons suggestions.
npx grunt gherkinlint --debug --root=mod/forum
(or any other plugin on my Moodle test site) it does it's thing, i.e. it checks the files inside mod/forum only.
But that is not the task I want grunt to do, I want it to watch/build an AMD script (restricting the task to an AMD folder only). By the way, with npm tasks I'm used to running npm watch and npm run (e.g. when working on the H5P libraries). But I see no "run" command in grunt. Is "watch" the same as "run" for grunt?