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 |
---|---|---|
.. | ||
builds | Loading commit data... | |
empty_states | Loading commit data... | |
groups | Loading commit data... | |
icons | Loading commit data... | |
issuable | Loading commit data... | |
labels | Loading commit data... | |
members | Loading commit data... | |
milestones | Loading commit data... | |
notifications | Loading commit data... | |
projects | Loading commit data... | |
snippets | Loading commit data... | |
web_hooks | Loading commit data... | |
_allow_request_access.html.haml | Loading commit data... | |
_choose_group_avatar_button.html.haml | Loading commit data... | |
_clone_panel.html.haml | Loading commit data... | |
_commit_message_container.html.haml | Loading commit data... | |
_confirm_modal.html.haml | Loading commit data... | |
_event_filter.html.haml | Loading commit data... | |
_field.html.haml | Loading commit data... | |
_file_highlight.html.haml | Loading commit data... | |
_group_form.html.haml | Loading commit data... | |
_group_tips.html.haml | Loading commit data... | |
_import_form.html.haml | Loading commit data... | |
_issues.html.haml | Loading commit data... | |
_label.html.haml | Loading commit data... | |
_label_row.html.haml | Loading commit data... | |
_labels_row.html.haml | Loading commit data... | |
_logo.svg | Loading commit data... | |
_merge_requests.html.haml | Loading commit data... | |
_milestone_expired.html.haml | Loading commit data... | |
_milestones_filter.html.haml | Loading commit data... | |
_nav_scroll.html.haml | Loading commit data... | |
_new_commit_form.html.haml | Loading commit data... | |
_new_project_item_select.html.haml | Loading commit data... | |
_no_password.html.haml | Loading commit data... | |
_no_ssh.html.haml | Loading commit data... | |
_outdated_browser.html.haml | Loading commit data... | |
_project_limit.html.haml | Loading commit data... | |
_promo.html.haml | Loading commit data... | |
_ref_switcher.html.haml | Loading commit data... | |
_service_settings.html.haml | Loading commit data... | |
_show_aside.html.haml | Loading commit data... | |
_sort_dropdown.html.haml | Loading commit data... | |
_visibility_level.html.haml | Loading commit data... | |
_visibility_radios.html.haml | Loading commit data... |