Manage lint on external js/css while developing plugin

Manage lint on external js/css while developing plugin

by Mattia Bonzi -
Number of replies: 0

Hi,
I'm developing a plugin that require several third party JavaScript library in order to work, but I'm struggling to make the linting work properly.
I'm followed several guides on how to include third party library, but I haven't found the way for now.
I've tried with those approach:
but no one has worked, every time I run grunt (via grunt watch) it's end up with the following error, running it from the Moodle root or even form the plugin root or 'AMD' folder:

3217 problems
Warning: Task "stylelint:css" failed. Use --force to continue.
Aborted due to warnings.
>>Error
the number of warning may vary depending on what library I'm trying to include, but the result is always the same.
I'm trying to include popular library as Datatables and Select2, I do not think that I have to manually correct all the warning (most are coding convention violation on both js and css file, sometimes error like "Unexpected console statement") , so I'm think that I'm making something wrong.

I've tried to download a plugin from the Moodle directory called "tool_datatables", trying to understand how to include datatable (I need the “editor” version, so I cannot just require the installation of the other plugin and use it's version in my code), but even that plugin rise warning. was the linting being introduced in some of the latest Moodle release?
How I can prevent Grunt from lint Datatable source code? It's an external module and of course it does not comply with moodle standard, it was not written as Moodle integration...
Am I missing something? I don't need to run grunt?
Can't understand the proper way to include something external.

Thanks to all in advance,
Mattia
Average of ratings: -