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

Update jshint and add ignore

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.5.8, 3.6.6, 3.7.2
    • 3.5.7, 3.6.5, 3.7.1, 3.8
    • JavaScript
    • 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)

      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/*'.

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Glyn (Mathew) May Glyn (Mathew) May
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Carlos Escobedo Carlos Escobedo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.