As of Drupal 8 all JS needs to follow our JavaScript coding standards. For this we use ESLint to check most of our standards.

Here is the summary of running ESLint on this module JS:
41 problems (41 errors, 0 warnings)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Neelanjana Das created an issue. See original summary.

Neelanjana Das’s picture

The code is cleaned up in this patch.

Neelanjana Das’s picture

Status: Active » Needs review
gapple’s picture

Priority: Normal » Minor
Status: Needs review » Needs work

Thank you for your contribution

1. The affected expression is the Google Analytics code snippet, which is minified and should not be reformatted so drastically. Instead, linting should be disabled for that segment with

/*eslint-disable */

/*eslint-enable */

2. Declaring var ga within the function scope will result in an error as ga.apply() will then be trying to call a method on undefined. ga is a global function created by the Google Analytics snippet, so to pass linting is should instead be declared with a comment: /*global ga*/

gapple’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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