refactor UsernameValidator class to ES module syntax

This commit is contained in:
Mike Greiling 2017-06-30 17:01:49 -05:00
parent 5530d80155
commit 128c6e7060
3 changed files with 2 additions and 5 deletions

View file

@ -1,5 +1,4 @@
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */
/* global UsernameValidator */
/* global ActiveTabMemoizer */
/* global ShortcutsNavigation */
/* global IssuableIndex */
@ -53,6 +52,7 @@ import UsersSelect from './users_select';
import RefSelectDropdown from './ref_select_dropdown';
import GfmAutoComplete from './gfm_auto_complete';
import ShortcutsBlob from './shortcuts_blob';
import UsernameValidator from './username_validator';
import VersionCheckImage from './version_check_image';
import Wikis from './wikis';
import ZenMode from './zen_mode';

View file

@ -157,7 +157,6 @@ import './tree';
import './usage_ping';
import './user';
import './user_tabs';
import './username_validator';
import './users_select';
// eslint-disable-next-line global-require, import/no-commonjs

View file

@ -8,7 +8,7 @@ const successMessageSelector = '.username .validation-success';
const pendingMessageSelector = '.username .validation-pending';
const invalidMessageSelector = '.username .gl-field-error';
class UsernameValidator {
export default class UsernameValidator {
constructor() {
this.inputElement = $('#new_user_username');
this.inputDomElement = this.inputElement.get(0);
@ -129,5 +129,3 @@ class UsernameValidator {
$inputErrorMessage.show();
}
}
window.UsernameValidator = UsernameValidator;