General developer forum

grunt error with max-len of 132 - Moodle 3.2

 
Picture of Dave Emsley
grunt error with max-len of 132 - Moodle 3.2
Particularly helpful Moodlers

Possibly not (probably not) a Moodle issue but when I grunt my javascript files I'm getting the error:   

12:1  error  Line 12 exceeds the maximum line length of 132  max-len

Neither the /moodle/Gruntfile.js nor the package.json file seem to set this and I cannot work out where/how to set it to higher. Can anyone point me in the right direction please.

I also seem to get annoying tab errors:

   7:2    error  Unexpected tab character   no-tabs

which I can easily resolve but means taking out the indentation in  my code before uploading it.  If anyone could advise,


Cheers

Dave

 
Average of ratings: -
Picture of Mark Sharp
Re: grunt error with max-len of 132 - Moodle 3.2
Core developersParticularly helpful MoodlersPlugin developers

They can be annoying, but in the end I just adjust my code to fix those issues. Personally I think of it as good practice to conform to Moodle standard for Moodle plugins.

The rules that grunt uses are in .eslintrc.

For the tab error, you should set up your editor to use 4 spaces instead of tabs.


 
Average of ratings: Useful (1)
Picture of Dave Emsley
Re: grunt error with max-len of 132 - Moodle 3.2
Particularly helpful Moodlers

Thanks Mark, the tab is set to 4 spaces but could be because I'm using DreamWeaver. 

Standards file is https://docs.moodle.org/dev/Coding_style for anyone else setting out on this road.


Cheers


Dave

 
Average of ratings: -