Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
✖ 81 problems (79 errors, 2 warnings)
Attached is the full list of errors found by ESLint and the patch that fixes them. There are a few remaining but not sure how to handle them. Check remaining-eslint-errors.txt
Comment | File | Size | Author |
---|---|---|---|
#9 | ga-eslint-2490326-9.patch | 6.94 KB | nod_ |
google_analytics-eslint-output.txt | 6.62 KB | rteijeiro | |
remaining-eslint-errors.txt | 1.31 KB | rteijeiro | |
fix-eslint-errors.patch | 5.39 KB | rteijeiro | |
Comments
Comment #1
hass CreditAttribution: hass commentedga() is a function, not a variable.
Comment #8
hass CreditAttribution: hass commentedI have no idea how I can add
ga
to globals of core.eslintrc
file and how I can ignore the console warnings in the debug.js file.Comment #9
nod_Here is the patch fixing the rest of the errors.
ESLint config can be overriden within directories, to add the "ga" variable you can declare an eslint config file adding that variable to globals, see the patch.
Comment #10
hass CreditAttribution: hass commentedMany thanks for your help and patch.
Comment #14
hass CreditAttribution: hass commentedComment #16
hass CreditAttribution: hass commentedThis has broken nearly all
val()
's in vertical tabs.Broken:
Should we quote the integer or parseInt()?
Comment #17
droplet CreditAttribution: droplet commentedinput value is String
Comment #18
hass CreditAttribution: hass commented