Grunt error - No ESLint configuration found - Moodle 3.7

Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -
Number of replies: 9

Hi All,

Very frustrating error message

ltat@OrangeServer:~/public_html/theme/ltat/amd$ grunt watch
Running "watch" task
Waiting...
>> File "theme/ltat/amd/src/initialise.js" changed.
Running "eslint:amd" (eslint) task
Warning: No ESLint configuration found.
Warning: Task "eslint:amd" failed.

If anyone can guide me in the right direction as to why this may be occuring I'd be grateful.  I've looked all over and not found the case.


Cheers

Dave


Average of ratings: -
In reply to Dave Emsley

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I suggest you spend an hour or two typing in various random permutations of npm bla bla
Well that's usually what I end up doning sad
This might be relevent..
https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/amd/src/eslintrc
Average of ratings: Useful (2)
In reply to Marcus Green

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -
LMAO - Not just me then Marcus - winner!

That's cool as the error message has changed. 
Average of ratings: Useful (1)
In reply to Dave Emsley

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -
That's resolved it now Marcus - Many thanks.
In reply to Dave Emsley

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -

...and it's gone again.  Now if I can only remember what I did to get it to work.


In reply to Dave Emsley

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
nvm install grunt
backspace backspace backspace
npm install grunt
npm install gulp
npm install grunt --force
npm install eslint
npm install grunt lint
npm install bees with machineguns
npm install beehat
npm insall bees with hats
cd moodle
vim config.php
$CFG->cachejs=false;
feck
Don't worry Dave, 3.8 changes it all again
Average of ratings: Useful (1)
In reply to Marcus Green

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -

Losing the will to live... LOL

My problem is I don't do enough to keep up to date and I'm always playing catchup.


In reply to Marcus Green

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -
This gets worse!

Running "watch" task
Waiting...
>> File "theme/mytheme/amd/src/initialise.js" changed.

Running "eslint:amd" (eslint) task

/public_html/theme/mytheme/amd/src/initialise.js
2:1 error 'define' is not defined no-undef
2:9 error Strings must use doublequote quotes
5:6 error Strings must use doublequote quotes
9:8 error Strings must use doublequote quotes
11:8 error Strings must use doublequote quotes
17:6 error Strings must use doublequote quotes
18:7 error Strings must use doublequote quotes

✖ 7 problems (7 errors, 0 warnings)
6 errors, 0 warnings potentially fixable with the `--fix` option.

Warning: Task "eslint:amd" failed.
In reply to Dave Emsley

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
It should just be a case of running `npm install` in the Moodle root directory. Technically it can be anywhere, but if your theme also has a package.json then the core Moodle packages won't be installed when you run it.
Average of ratings: Useful (1)
In reply to Andrew Lyons

Re: Grunt error - No ESLint configuration found - Moodle 3.7

by Dave Emsley -
Thanks Andrew - emphasis on *should* wink

Theme doesn't have its own package.json - I'm relying on the Moodle default one.

Cheers
Dave