Modernizr is included on all page loads. It should be included in the list of globals that are predefined.

CommentFileSizeAuthor
jshint-modernizr.patch212 bytesjessebeach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jessebeach’s picture

Status: Active » Needs review

One line addition to the .jshintrc file.

seutje’s picture

Makes sense.

RobLoach’s picture

Status: Needs review » Reviewed & tested by the community
$ git apply jshint-modernizr.patch
$ cd core
$ jshint .
misc/autocomplete.js: line 230, col 52, Don't make functions within a loop.
misc/autocomplete.js: line 231, col 55, Don't make functions within a loop.
misc/autocomplete.js: line 232, col 56, Don't make functions within a loop.
misc/autocomplete.js: line 319, col 9, 'alert' is not defined.

misc/drupal.js: line 1, col 5, Redefinition of 'Drupal'.

modules/contextual/contextual.js: line 144, col 24, Did you mean to return a conditional instead of an assignment?

modules/contextual/contextual.toolbar.js: line 191, col 52, Missing semicolon.

modules/edit/js/backbone.drupalform.js: line 96, col 26, Bad escaping.
modules/edit/js/backbone.drupalform.js: line 96, col 35, Bad escaping.

modules/edit/js/views/toolbar-view.js: line 224, col 29, Expected '!==' and instead saw '!='.

modules/views/views_ui/js/views-admin.js: line 1018, col 50, A leading decimal point can be confused with a dot: '.85'.
modules/views/views_ui/js/views-admin.js: line 1018, col 50, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1019, col 49, A leading decimal point can be confused with a dot: '.6'.
modules/views/views_ui/js/views-admin.js: line 1019, col 49, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1027, col 51, A leading decimal point can be confused with a dot: '.8'.
modules/views/views_ui/js/views-admin.js: line 1027, col 51, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1042, col 54, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1043, col 57, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1057, col 52, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1058, col 55, Missing radix parameter.
modules/views/views_ui/js/views-admin.js: line 1103, col 3, Missing semicolon.

21 errors

Once we have #1473066: [Meta] Move third-party assets out of core/misc folder, we'll be able to ignore all .js vendor code easily.

nod_’s picture

+1, also put it in #1975426: Clean up collapse.js. Will take it away once this one committed.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2172cde and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.