BigW Consortium Gitlab
Explicitly declare all javascript globals and all eslint rule violations This merge request takes every single external global variable referenced within a javascript file and explicitly marks it with a `/* global Foo */` comment block at the top of the script. This also expands all blanket instances of `/* eslint-disable */` with an explicit list of disabled rules. This is useful because if we need to search for violations of a particular rule we can simply grep the codebase for something like `no-unused-vars` or `semi` and find all of the places where this rule has yet to be fixed. Lastly, it also removes and resolves any existing `no-undef` eslint violations. This is useful for catching mistakes like forgetting to declare a variable with `var`/`let`/`const` which can cause hard to find bugs. ## What does this MR do? 1. Looks for generic uses of `/* eslint-disable */` and refactors them into individual rule exceptions. 2. Looks for all occurrences of `/* eslint-disable ... no-undef */` and resolves them by either fixing bugs or declaring globals with `/* global Foo */`. ## Are there points in the code the reviewer needs to double check? This touches a lot of files, most changes touch nothing other than comment blocks or whitespace. The exceptions are the following 14 files which required some small bug fixes after removing `no-undef`: - api.js - breakpoints.js - build.js - commits.js - diff_notes/components/jump_to_discussion.js.es6 - gfm_auto_complete.js.es6 - gl_dropdown.js - groups_select.js - importer_status.js - namespace_select.js - notes.js - preview_markdown.js - projects_list.js - single_file_diff.js ## Why was this MR needed? Removal of ~"technical debt" and some necessary changes to help !7288 ## Screenshots (if relevant) N/A ## Does this MR meet the acceptance criteria? - [ ] ~~[Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added~~ - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - Tests - [ ] ~~Added for this feature/bug~~ - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? N/A See merge request !8043
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
behaviors | Loading commit data... | |
blob | Loading commit data... | |
blob_edit | Loading commit data... | |
boards | Loading commit data... | |
commit | Loading commit data... | |
cycle_analytics | Loading commit data... | |
diff_notes | Loading commit data... | |
environments | Loading commit data... | |
extensions | Loading commit data... | |
graphs | Loading commit data... | |
lib | Loading commit data... | |
merge_conflicts | Loading commit data... | |
network | Loading commit data... | |
profile | Loading commit data... | |
protected_branches | Loading commit data... | |
snippet | Loading commit data... | |
templates | Loading commit data... | |
u2f | Loading commit data... | |
users | Loading commit data... | |
vue_common_component | Loading commit data... | |
abuse_reports.js.es6 | Loading commit data... | |
activities.js.es6 | Loading commit data... | |
admin.js | Loading commit data... | |
api.js | Loading commit data... | |
application.js | Loading commit data... | |
aside.js | Loading commit data... | |
autosave.js | Loading commit data... | |
awards_handler.js | Loading commit data... | |
breakpoints.js | Loading commit data... | |
broadcast_message.js | Loading commit data... | |
build.js | Loading commit data... | |
build_artifacts.js | Loading commit data... | |
build_variables.js.es6 | Loading commit data... | |
commit.js | Loading commit data... | |
commits.js | Loading commit data... | |
compare.js | Loading commit data... | |
compare_autocomplete.js.es6 | Loading commit data... | |
confirm_danger_modal.js | Loading commit data... | |
copy_to_clipboard.js | Loading commit data... | |
create_label.js.es6 | Loading commit data... | |
diff.js.es6 | Loading commit data... | |
dispatcher.js.es6 | Loading commit data... | |
dropzone_input.js | Loading commit data... | |
due_date_select.js.es6 | Loading commit data... | |
files_comment_button.js | Loading commit data... | |
flash.js | Loading commit data... | |
gfm_auto_complete.js.es6 | Loading commit data... | |
gl_dropdown.js | Loading commit data... | |
gl_field_error.js.es6 | Loading commit data... | |
gl_field_errors.js.es6 | Loading commit data... | |
gl_form.js | Loading commit data... | |
group_avatar.js | Loading commit data... | |
group_label_subscription.js.es6 | Loading commit data... | |
groups_select.js | Loading commit data... | |
header.js | Loading commit data... | |
importer_status.js | Loading commit data... | |
issuable.js.es6 | Loading commit data... | |
issuable_context.js | Loading commit data... | |
issuable_form.js | Loading commit data... | |
issue.js | Loading commit data... | |
issue_status_select.js | Loading commit data... | |
issues_bulk_assignment.js.es6 | Loading commit data... | |
label_manager.js.es6 | Loading commit data... | |
labels.js | Loading commit data... | |
labels_select.js | Loading commit data... | |
layout_nav.js | Loading commit data... | |
line_highlighter.js | Loading commit data... | |
logo.js | Loading commit data... | |
member_expiration_date.js | Loading commit data... | |
members.js.es6 | Loading commit data... | |
merge_request.js | Loading commit data... | |
merge_request_tabs.js.es6 | Loading commit data... | |
merge_request_widget.js.es6 | Loading commit data... | |
merged_buttons.js | Loading commit data... | |
milestone.js | Loading commit data... | |
milestone_select.js | Loading commit data... | |
namespace_select.js | Loading commit data... | |
new_branch_form.js | Loading commit data... | |
new_commit_form.js | Loading commit data... | |
notes.js | Loading commit data... | |
notifications_dropdown.js | Loading commit data... | |
notifications_form.js | Loading commit data... | |
pager.js.es6 | Loading commit data... | |
pipelines.js.es6 | Loading commit data... | |
preview_markdown.js | Loading commit data... | |
project.js | Loading commit data... | |
project_avatar.js | Loading commit data... | |
project_find_file.js | Loading commit data... | |
project_fork.js | Loading commit data... | |
project_import.js | Loading commit data... | |
project_label_subscription.js.es6 | Loading commit data... | |
project_new.js | Loading commit data... | |
project_select.js | Loading commit data... | |
project_show.js | Loading commit data... | |
project_variables.js.es6 | Loading commit data... | |
projects_list.js | Loading commit data... | |
right_sidebar.js | Loading commit data... | |
search.js | Loading commit data... | |
search_autocomplete.js.es6 | Loading commit data... | |
shortcuts.js | Loading commit data... | |
shortcuts_blob.js | Loading commit data... | |
shortcuts_dashboard_navigation.js | Loading commit data... | |
shortcuts_find_file.js | Loading commit data... | |
shortcuts_issuable.js | Loading commit data... | |
shortcuts_navigation.js | Loading commit data... | |
shortcuts_network.js | Loading commit data... | |
sidebar.js.es6 | Loading commit data... | |
signin_tabs_memoizer.js.es6 | Loading commit data... | |
single_file_diff.js | Loading commit data... | |
smart_interval.js.es6 | Loading commit data... | |
snippets_list.js.es6 | Loading commit data... | |
star.js | Loading commit data... | |
subbable_resource.js.es6 | Loading commit data... | |
subscription.js.es6 | Loading commit data... | |
subscription_select.js | Loading commit data... | |
syntax_highlight.js | Loading commit data... | |
todos.js.es6 | Loading commit data... | |
tree.js | Loading commit data... | |
user.js.es6 | Loading commit data... | |
user_tabs.js.es6 | Loading commit data... | |
username_validator.js.es6 | Loading commit data... | |
users_select.js | Loading commit data... | |
wikis.js.es6 | Loading commit data... | |
zen_mode.js | Loading commit data... |