gitlab-org--gitlab-foss/spec/javascripts
Alfredo Sumaran 4e68b88193 Merge branch 'clean-no-undef' into 'master'
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
2016-12-15 00:52:46 +00:00
..
behaviors resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
boards expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
environments Adds tests 2016-12-09 10:14:48 +00:00
extensions Added element extensions spec for .matches and .closest 2016-12-02 12:10:11 +00:00
fixtures Replace static fixture for awards_handler_spec (!7661) 2016-12-12 23:17:25 +01:00
graphs resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
lib/utils Fix broken test in chrome 2016-12-13 11:04:43 +00:00
u2f resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
vue_common_components Adds tests 2016-12-09 10:14:48 +00:00
.eslintrc clean up globals exemptions within .eslintrc 2016-11-22 12:19:51 -06:00
abuse_reports_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
activities_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
awards_handler_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
bootstrap_linked_tabs_spec.js.es6 Fixed influence from other specs. 2016-12-05 11:00:19 +01:00
build_spec.js.es6 Remove JSX/React eslint plugins. 2016-11-29 16:15:47 +00:00
dashboard_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
datetime_utility_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
diff_comments_store_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
gl_dropdown_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
gl_field_errors_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
header_spec.js explicitly disable eslint inline 2016-11-15 16:30:34 +00:00
issue_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
labels_issue_sidebar_spec.js.es6 resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
line_highlighter_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
merge_request_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
merge_request_tabs_spec.js Satisfied eslint 2016-12-03 23:04:21 +01:00
merge_request_widget_spec.js fix display hook error message 2016-12-05 22:02:45 +09:00
new_branch_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
notes_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
pipelines_spec.js.es6 Adds tests to prevent future errors. 2016-12-12 12:44:45 +00:00
pretty_time_spec.js.es6 Backport SmartInterval, PrettyTime, SubbableResource from EE. 2016-11-18 16:49:40 +01:00
project_title_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
right_sidebar_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
search_autocomplete_spec.js explicitly disable eslint inline 2016-11-15 16:30:34 +00:00
shortcuts_issuable_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00
signin_tabs_memoizer_spec.js.es6 Fixed Wrong Tab Selected When Loggin Fails And Multiple Login Tabs Exists 2016-12-02 10:19:31 +01:00
smart_interval_spec.js.es6 Added hiddenInterval and immediateExecution settings, fixed visibilitychange listening, implemented with mr widget 2016-12-12 15:56:11 +03:00
spec_helper.js Use Rails test host name for frontend fixtures 2016-11-25 11:03:35 +01:00
subbable_resource_spec.js.es6 expand remaining non-explicit eslint-disable blocks and factor out globals when no-undef encountered 2016-12-13 21:07:31 -06:00
syntax_highlight_spec.js explicitly disable eslint inline 2016-11-15 16:30:34 +00:00
zen_mode_spec.js resolve all instances of no-undef eslint rule violations 2016-12-14 02:11:13 -06:00