Skip to content

Commit 19b017f

Browse files
authored
Use explicit jQuery import, remove unused eslint globals (#18435)
- Don't rely on globals (window.$) for jQuery import - Remove eslint globals no longer in use
1 parent 7b04c97 commit 19b017f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+76
-18
lines changed

.eslintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ env:
2323

2424
globals:
2525
__webpack_public_path__: true
26-
CodeMirror: false
27-
Dropzone: false
28-
SimpleMDE: false
2926

3027
settings:
3128
html/html-extensions: [".tmpl"]
@@ -34,7 +31,6 @@ overrides:
3431
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
3532
env:
3633
browser: true
37-
jquery: true
3834
node: false
3935
- files: ["templates/**/*.tmpl"]
4036
rules:

web_src/js/components/ContextPopup.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</template>
2525

2626
<script>
27+
import $ from 'jquery';
2728
import {SvgIcon} from '../svg.js';
2829
2930
const {appSubUrl, i18n} = window.config;

web_src/js/components/DashboardRepoList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Vue from 'vue';
2+
import $ from 'jquery';
23
import {initVueSvg, vueDelimiters} from './VueComponentLoader.js';
34

45
const {appSubUrl, assetUrlPrefix, pageData} = window.config;

web_src/js/components/RepoBranchTagDropdown.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Vue from 'vue';
2+
import $ from 'jquery';
23
import {vueDelimiters} from './VueComponentLoader.js';
34

45
export function initRepoBranchTagDropdown(selector) {

web_src/js/features/admin-common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
const {csrfToken} = window.config;
24

35
export function initAdminCommon() {

web_src/js/features/admin-emails.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
export function initAdminEmails() {
24
function linkEmailAction(e) {
35
const $this = $(this);

web_src/js/features/admin-users.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
export function initAdminUserListSearchForm() {
24
const searchForm = window.config.pageData.adminUserListSearchForm;
35
if (!searchForm) return;

web_src/js/features/clipboard.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
const {copy_success, copy_error} = window.config.i18n;
24

35
function onSuccess(btn) {

web_src/js/features/common-global.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import $ from 'jquery';
2+
import 'jquery.are-you-sure';
13
import {mqBinarySearch} from '../utils.js';
24
import createDropzone from './dropzone.js';
35
import {initCompColorPicker} from './comp/ColorPicker.js';
46

5-
import 'jquery.are-you-sure';
6-
77
const {csrfToken} = window.config;
88

99
export function initGlobalFormDirtyLeaveConfirm() {

web_src/js/features/common-issue.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import $ from 'jquery';
12
import {updateIssuesMeta} from './repo-issue.js';
23

34
export function initCommonIssue() {

0 commit comments

Comments
 (0)