grunt error with max-len of 132 - Moodle 3.2

grunt error with max-len of 132 - Moodle 3.2

by Dave Emsley -
Number of replies: 3

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: -
In reply to Dave Emsley

Re: grunt error with max-len of 132 - Moodle 3.2

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin 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)
In reply to Mark Sharp

Re: grunt error with max-len of 132 - Moodle 3.2

by Dave Emsley -

<<Note to admin >>

This is a really important point and ought to be on the Grunt Page.   https://docs.moodle.org/dev/Grunt

I don't feel confident enough editing the development documentation and wouldn't know how to word it but without this I'd have been very stuck.