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

Update jshint and add ignore

    XMLWordPrintable

    Details

    • Testing Instructions:
      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)
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.5 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-66265-master

      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

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Mathew May
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Carlos Escobedo
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                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