Commit 5bd54918 authored by Mike Greiling's avatar Mike Greiling

update remaining uses of CJS syntax to ES module syntax

parent f5ad1dcb
/* eslint-disable class-methods-use-this, object-shorthand, no-unused-vars, no-use-before-define, no-new, max-len, no-restricted-syntax, guard-for-in, no-continue */ /* eslint-disable class-methods-use-this, object-shorthand, no-unused-vars, no-use-before-define, no-new, max-len, no-restricted-syntax, guard-for-in, no-continue */
require('./lib/utils/common_utils'); import './lib/utils/common_utils';
const gfmRules = { const gfmRules = {
// The filters referenced in lib/banzai/pipeline/gfm_pipeline.rb convert // The filters referenced in lib/banzai/pipeline/gfm_pipeline.rb convert
......
/* eslint-disable class-methods-use-this */ /* eslint-disable class-methods-use-this */
require('./lib/utils/url_utility'); import './lib/utils/url_utility';
const UNFOLD_COUNT = 20; const UNFOLD_COUNT = 20;
let isBound = false; let isBound = false;
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, one-var, no-var, one-var-declaration-per-line, no-unused-vars, camelcase, quotes, no-useless-concat, prefer-template, quote-props, comma-dangle, object-shorthand, consistent-return, prefer-arrow-callback */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, one-var, no-var, one-var-declaration-per-line, no-unused-vars, camelcase, quotes, no-useless-concat, prefer-template, quote-props, comma-dangle, object-shorthand, consistent-return, prefer-arrow-callback */
/* global Dropzone */ /* global Dropzone */
require('./preview_markdown'); import './preview_markdown';
window.DropzoneInput = (function() { window.DropzoneInput = (function() {
function DropzoneInput(form) { function DropzoneInput(form) {
......
/* eslint-disable comma-dangle, class-methods-use-this, max-len, space-before-function-paren, arrow-parens, no-param-reassign */ /* eslint-disable comma-dangle, class-methods-use-this, max-len, space-before-function-paren, arrow-parens, no-param-reassign */
require('./gl_field_error'); import './gl_field_error';
const customValidationFlag = 'gl-field-error-ignore'; const customValidationFlag = 'gl-field-error-ignore';
......
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, no-underscore-dangle, one-var-declaration-per-line, object-shorthand, no-unused-vars, no-new, comma-dangle, consistent-return, quotes, dot-notation, quote-props, prefer-arrow-callback, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, no-underscore-dangle, one-var-declaration-per-line, object-shorthand, no-unused-vars, no-new, comma-dangle, consistent-return, quotes, dot-notation, quote-props, prefer-arrow-callback, max-len */
/* global Flash */ /* global Flash */
import CreateMergeRequestDropdown from './create_merge_request_dropdown';
require('./flash'); import 'vendor/jquery.waitforimages';
require('~/lib/utils/text_utility'); import '~/lib/utils/text_utility';
require('vendor/jquery.waitforimages'); import './flash';
require('./task_list'); import './task_list';
import CreateMergeRequestDropdown from './create_merge_request_dropdown';
class Issue { class Issue {
constructor() { constructor() {
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, comma-dangle, no-unused-expressions, prefer-template, max-len */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, comma-dangle, no-unused-expressions, prefer-template, max-len */
/* global timeago */
/* global dateFormat */
window.timeago = require('timeago.js'); import timeago from 'timeago.js';
window.dateFormat = require('vendor/date.format'); import dateFormat from 'vendor/date.format';
window.timeago = timeago;
window.dateFormat = dateFormat;
(function() { (function() {
(function(w) { (function(w) {
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len, vars-on-top */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len, vars-on-top */
require('vendor/latinise');
import 'vendor/latinise';
var base; var base;
var w = window; var w = window;
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
// //
// Handles single- and multi-line selection and highlight for blob views. // Handles single- and multi-line selection and highlight for blob views.
// //
require('vendor/jquery.scrollTo');
// //
// ### Example Markup // ### Example Markup
// //
......
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
/* global Flash */ /* global Flash */
import Vue from 'vue'; import Vue from 'vue';
import './merge_conflict_store';
require('./merge_conflict_store'); import './merge_conflict_service';
require('./merge_conflict_service'); import './mixins/line_conflict_utils';
require('./mixins/line_conflict_utils'); import './mixins/line_conflict_actions';
require('./mixins/line_conflict_actions'); import './components/diff_file_editor';
require('./components/diff_file_editor'); import './components/inline_conflict_lines';
require('./components/inline_conflict_lines'); import './components/parallel_conflict_lines';
require('./components/parallel_conflict_lines');
$(() => { $(() => {
const INTERACTIVE_RESOLVE_MODE = 'interactive'; const INTERACTIVE_RESOLVE_MODE = 'interactive';
......
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, no-underscore-dangle, one-var, one-var-declaration-per-line, consistent-return, dot-notation, quote-props, comma-dangle, object-shorthand, max-len, prefer-arrow-callback */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, no-underscore-dangle, one-var, one-var-declaration-per-line, consistent-return, dot-notation, quote-props, comma-dangle, object-shorthand, max-len, prefer-arrow-callback */
/* global MergeRequestTabs */ /* global MergeRequestTabs */
require('vendor/jquery.waitforimages'); import 'vendor/jquery.waitforimages';
require('./task_list'); import './task_list';
require('./merge_request_tabs'); import './merge_request_tabs';
(function() { (function() {
this.MergeRequest = (function() { this.MergeRequest = (function() {
......
...@@ -6,15 +6,17 @@ ...@@ -6,15 +6,17 @@
import $ from 'jquery'; import $ from 'jquery';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import autosize from 'vendor/autosize';
import Dropzone from 'dropzone';
import 'vendor/jquery.caret'; // required by jquery.atwho
import 'vendor/jquery.atwho';
import CommentTypeToggle from './comment_type_toggle'; import CommentTypeToggle from './comment_type_toggle';
import './autosave';
import './dropzone_input';
import './task_list';
require('./autosave'); window.autosize = autosize;
window.autosize = require('vendor/autosize'); window.Dropzone = Dropzone;
window.Dropzone = require('dropzone');
require('./dropzone_input');
require('vendor/jquery.caret'); // required by jquery.atwho
require('vendor/jquery.atwho');
require('./task_list');
const normalizeNewlines = function(str) { const normalizeNewlines = function(str) {
return str.replace(/\r\n/g, '\n'); return str.replace(/\r\n/g, '\n');
......
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
require('~/lib/utils/url_utility'); import '~/lib/utils/url_utility';
(() => { (() => {
const ENDLESS_SCROLL_BOTTOM_PX = 400; const ENDLESS_SCROLL_BOTTOM_PX = 400;
......
require('./gl_crop'); import './gl_crop';
require('./profile'); import './profile';
require('./protected_branch_access_dropdown'); import './protected_branch_access_dropdown';
require('./protected_branch_create'); import './protected_branch_create';
require('./protected_branch_dropdown'); import './protected_branch_dropdown';
require('./protected_branch_edit'); import './protected_branch_edit';
require('./protected_branch_edit_list'); import './protected_branch_edit_list';
/* global Flash */ /* global Flash */
require('vendor/task_list');
import 'vendor/task_list';
class TaskList { class TaskList {
constructor(options = {}) { constructor(options = {}) {
......
require('vendor/xterm/encoding-indexes.js'); import 'vendor/xterm/encoding-indexes';
require('vendor/xterm/encoding.js'); import 'vendor/xterm/encoding';
window.Terminal = require('vendor/xterm/xterm.js'); import Terminal from 'vendor/xterm/xterm';
require('vendor/xterm/fit.js'); import 'vendor/xterm/fit';
require('./terminal.js'); import './terminal';
window.Terminal = Terminal;
$(() => new gl.Terminal({ selector: '#terminal' })); $(() => new gl.Terminal({ selector: '#terminal' }));
require('../../lib/utils/text_utility'); import '../../lib/utils/text_utility';
export default { export default {
name: 'MRWidgetHeader', name: 'MRWidgetHeader',
......
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
/* global Breakpoints */ /* global Breakpoints */
require('./breakpoints'); import 'vendor/jquery.nicescroll';
require('vendor/jquery.nicescroll'); import './breakpoints';
((global) => { ((global) => {
class Wikis { class Wikis {
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, prefer-arrow-callback, no-unused-vars, consistent-return, camelcase, comma-dangle, max-len */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, prefer-arrow-callback, no-unused-vars, consistent-return, camelcase, comma-dangle, max-len */
/* global Dropzone */
/* global Mousetrap */ /* global Mousetrap */
// Zen Mode (full screen) textarea // Zen Mode (full screen) textarea
...@@ -7,10 +6,12 @@ ...@@ -7,10 +6,12 @@
/*= provides zen_mode:enter */ /*= provides zen_mode:enter */
/*= provides zen_mode:leave */ /*= provides zen_mode:leave */
require('vendor/jquery.scrollTo'); import 'vendor/jquery.scrollTo';
window.Dropzone = require('dropzone'); import Dropzone from 'dropzone';
require('mousetrap'); import 'mousetrap';
require('mousetrap/plugins/pause/mousetrap-pause'); import 'mousetrap/plugins/pause/mousetrap-pause';
window.Dropzone = Dropzone;
// //
// ### Events // ### Events
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment