Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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)
Comment | File | Size | Author |
---|---|---|---|
#2 | gascp-eslint-error-2.patch | 1.11 KB | Neelanjana Das |
|
Comments
Comment #2
Neelanjana Das CreditAttribution: Neelanjana Das at Melity commentedThe code is cleaned up in this patch.
Comment #3
Neelanjana Das CreditAttribution: Neelanjana Das at Melity commentedComment #4
gappleThank 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
2. Declaring
var ga
within the function scope will result in an error asga.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*/
Comment #5
gappleI've addressed this in acfde55cf21a347d0a9bf615297cbb635e1e004d