Page MenuHomePhabricator

Fix npm eslint errors (and warnings) for CentralAuth
Open, NormalPublic

Description

Updating the dev dependencies for CentralAuth resulted in linting errors. See patch and jenkins output:

23:05:48 Running "eslint:all" (eslint) task
23:05:49 
23:05:49 /workspace/src/extensions/CentralAuth/modules/ext.centralauth.ForeignApi.js
23:05:49    13:1  warning  Line 13 exceeds the maximum line length of 100   max-len
23:05:49    14:1  warning  Line 14 exceeds the maximum line length of 100   max-len
23:05:49    51:1  warning  Line 51 exceeds the maximum line length of 100   max-len
23:05:49   199:1  warning  Line 199 exceeds the maximum line length of 100  max-len
23:05:49 
23:05:49 /workspace/src/extensions/CentralAuth/modules/ext.centralauth.globalrenamequeue.js
23:05:49    8:11  error  Unexpected confirm  no-alert
23:05:49   11:11  error  Unexpected confirm  no-alert
23:05:49 
23:05:49 /workspace/src/extensions/CentralAuth/modules/ext.centralauth.globalrenameuser.js
23:05:49   13:11  error  Unexpected confirm  no-alert
23:05:49 
23:05:49 /workspace/src/extensions/CentralAuth/modules/ext.centralauth.js
23:05:49   64:11  error  Unexpected confirm  no-alert
23:05:49 
23:05:49 /workspace/src/extensions/CentralAuth/modules/inline/anon-set.js
23:05:49   1:5  error  Implicit global variable, assign as global property instead  no-implicit-globals
23:05:49 
23:05:49 ✖ 9 problems (5 errors, 4 warnings)
23:05:49 
23:05:49 Warning: Task "eslint:all" failed. Use --force to continue.

Thank you.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 2 2018, 11:08 PM
MarcoAurelio renamed this task from Fix npm eslint errors for CentralAuth to Fix npm eslint errors (and warnings) for CentralAuth.Sep 2 2018, 11:08 PM
MarcoAurelio triaged this task as Normal priority.

Change 457163 had a related patch set uploaded (by MarcoAurelio; owner: MarcoAurelio):
[mediawiki/extensions/CentralAuth@master] Fix eslint's 'no-alert' errors

https://gerrit.wikimedia.org/r/457163

Change 457163 abandoned by MarcoAurelio:
Fix eslint's 'no-alert' errors

https://gerrit.wikimedia.org/r/457163

Looks like the no-alert errors in the output are actually needed for us to confirm our global rename actions. I think we can safely exclude that eslint error from those pages.

Change 457163 restored by MarcoAurelio:
Fix eslint's 'no-alert' errors

https://gerrit.wikimedia.org/r/457163

Not sure about anon-set.js.

Change 457163 merged by jenkins-bot:
[mediawiki/extensions/CentralAuth@master] build: Suppress eslint's 'no-alert' errors from some files

https://gerrit.wikimedia.org/r/457163