Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66265

Update jshint and add ignore

    XMLWordPrintable

Details

    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66265-master
    • Hide
      1. Update your node_modules:

        npm install
        

      2. Run jshint across a large swathe of AMD/ES6 code:

        npx jshint lib/amd/src/*.js
        

        (note that, instead of npx you can find jshint under node_modules/.bin/jshint)

        1. Confirm nothing was output (Previously this reported jshint failures)
      3. Run jshint on some of our old YUI modules:

        npx jshint --verbose lib/yui/src/actionmenu/js/actionmenu.js
        

        1. Confirm that the YUI code has some failures (no change)
      4. Run jshint across some old modules:

        npx jshint mod/scorm/module.js
        

        1. Confirm that our old code sucks (no change)
      Show
      Update your node_modules: npm install Run jshint across a large swathe of AMD/ES6 code: npx jshint lib/amd/src/*.js (note that, instead of npx you can find jshint under node_modules/.bin/jshint ) Confirm nothing was output (Previously this reported jshint failures) Run jshint on some of our old YUI modules: npx jshint --verbose lib/yui/src/actionmenu/js/actionmenu.js Confirm that the YUI code has some failures (no change) Run jshint across some old modules: npx jshint mod/scorm/module.js Confirm that our old code sucks (no change)

    Description

      I discovered in MDL-66192 that jshint is applying to all JS by default, even JS which we expect to be checked by eslint.

      We only use jshint for YUI, and it is used intrinsically by Shifter. We can't just replace it with eslint sadly.

      We are currently on version 0.9.1 of jshint, which is ancient (7+ years). That version does not support any way to either specify or ignore files.

      I propose we upgrade to the latest version of jshint, which does support a .jshintignore and then ignore '*/amd/*'.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Mathew May Mathew May
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Carlos Escobedo Carlos Escobedo
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Sep/19

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 3 days, 1 hour, 5 minutes
                  1w 3d 1h 5m