Merge branch 'eslint' into 'master'
Add ESLint ## What does this MR do? - create `package.json` - add ESLint dependencies to `package.json` - add JavaScript linting to CI - add Rake task `lint:javascript`as alias for `eslint` (which itself is an alias for `npm run eslint`) ## Are there points in the code the reviewer needs to double check? Probably not. ## Why was this MR needed? My hovercraft was full of eels. ## What are the relevant issue numbers? - https://gitlab.com/gitlab-org/gitlab-ce/issues/13224#note_12537431 - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5006#note_13255658 See merge request !5445
This commit is contained in:
commit
dd5e46ab69
|
@ -0,0 +1,4 @@
|
|||
/public/
|
||||
/tmp/
|
||||
/vendor/
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"extends": "airbnb",
|
||||
"globals": {
|
||||
"$": false,
|
||||
"_": false,
|
||||
"beforeEach": false,
|
||||
"d3": false,
|
||||
"define": false,
|
||||
"describe": false,
|
||||
"document": false,
|
||||
"expect": false,
|
||||
"fixture": false,
|
||||
"gl": false,
|
||||
"it": false,
|
||||
"jQuery": false,
|
||||
"Mousetrap": false,
|
||||
"spyOn": false,
|
||||
"spyOnEvent": false,
|
||||
"Turbolinks": false,
|
||||
"window": false
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@
|
|||
/doc/code/*
|
||||
/dump.rdb
|
||||
/log/*.log*
|
||||
/node_modules/
|
||||
/nohup.out
|
||||
/public/assets/
|
||||
/public/uploads.*
|
||||
|
|
|
@ -311,6 +311,14 @@ coverage:
|
|||
- coverage/index.html
|
||||
- coverage/assets/
|
||||
|
||||
lint-javascript:
|
||||
stage: test
|
||||
image: "node:latest"
|
||||
before_script:
|
||||
- npm install
|
||||
script:
|
||||
- npm run eslint
|
||||
|
||||
# Trigger docs build
|
||||
# https://gitlab.com/gitlab-com/doc-gitlab-com/blob/master/README.md#deployment-process
|
||||
trigger_docs:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((global) => {
|
||||
const MAX_MESSAGE_LENGTH = 500;
|
||||
const MESSAGE_CELL_SELECTOR = '.abuse-reports .message';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Activities = (function() {
|
||||
function Activities() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Admin = (function() {
|
||||
function Admin() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Api = {
|
||||
groupsPath: "/api/:version/groups.json",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
// This is a manifest file that'll be compiled into including all the files listed below.
|
||||
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
||||
// be included in the compiled file accessible from http://example.com/assets/application.js
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Aside = (function() {
|
||||
function Aside() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Autosave = (function() {
|
||||
function Autosave(field, key) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.AwardsHandler = (function() {
|
||||
const FROM_SENTENCE_REGEX = /(?:, and | and |, )/; //For separating lists produced by ruby's Array#toSentence
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require jquery.ba-resize */
|
||||
/*= require autosize */
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
$(function() {
|
||||
$("body").on("click", ".js-details-target", function() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
// Quick Submit behavior
|
||||
//
|
||||
// When a child field of a form with a `js-quick-submit` class receives a
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
// Requires Input behavior
|
||||
//
|
||||
// When called on a form with input fields with the `required` attribute, the
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function(w) {
|
||||
$(function() {
|
||||
// Toggle button. Show/hide content inside parent container.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
/*= require blob/template_selector */
|
||||
((global) => {
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.BlobFileDropzone = (function() {
|
||||
function BlobFileDropzone(form, method) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require blob/template_selector */
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.BlobGitignoreSelectors = (function() {
|
||||
function BlobGitignoreSelectors(opts) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require blob/template_selector */
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((global) => {
|
||||
class BlobLicenseSelectors {
|
||||
constructor({ $dropdowns, editor }) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((global) => {
|
||||
class TemplateSelector {
|
||||
constructor({ dropdown, data, pattern, wrapper, editor, fileEndpoint, $input } = {}) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
/*= require_tree . */
|
||||
|
||||
(function() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
//= require vue
|
||||
//= require vue-resource
|
||||
//= require Sortable
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
//= require ./board_blank_state
|
||||
//= require ./board_delete
|
||||
//= require ./board_list
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(() => {
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(() => {
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(() => {
|
||||
window.gl = window.gl || {};
|
||||
window.gl.issueBoards = window.gl.issueBoards || {};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
//= require ./board_card
|
||||
//= require ./board_new_issue
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(() => {
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
$(() => {
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
window.gl = window.gl || {};
|
||||
window.gl.issueBoards = window.gl.issueBoards || {};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class ListIssue {
|
||||
constructor (obj) {
|
||||
this.id = obj.iid;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class ListLabel {
|
||||
constructor (obj) {
|
||||
this.id = obj.id;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class List {
|
||||
constructor (obj) {
|
||||
this.id = obj.id;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class ListUser {
|
||||
constructor (user) {
|
||||
this.id = user.id;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class BoardService {
|
||||
constructor (root, boardId) {
|
||||
this.lists = Vue.resource(`${root}/${boardId}/lists{/id}`, {}, {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(() => {
|
||||
window.gl = window.gl || {};
|
||||
window.gl.issueBoards = window.gl.issueBoards || {};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
Vue.http.interceptors.push((request, next) => {
|
||||
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Breakpoints = (function() {
|
||||
var BreakpointInstance, instance;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
$(function() {
|
||||
var previewPath;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.BuildArtifacts = (function() {
|
||||
function BuildArtifacts() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
$(function(){
|
||||
$('.reveal-variables').off('click').on('click',function(){
|
||||
$('.js-build').toggle().niceScroll();
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Commit = (function() {
|
||||
function Commit() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.CommitFile = (function() {
|
||||
function CommitFile(file) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.ImageFile = (function() {
|
||||
var prepareFrames;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.CommitsList = (function() {
|
||||
function CommitsList() {}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Compare = (function() {
|
||||
function Compare(opts) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.CompareAutocomplete = (function() {
|
||||
function CompareAutocomplete() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.ConfirmDangerModal = (function() {
|
||||
function ConfirmDangerModal(form, text) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require clipboard */
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function (w) {
|
||||
class CreateLabelDropdown {
|
||||
constructor ($el, namespacePath, projectPath) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
//= require vue
|
||||
|
||||
((global) => {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Diff = (function() {
|
||||
var UNFOLD_COUNT;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
w.CommentAndResolveBtn = Vue.extend({
|
||||
props: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(() => {
|
||||
JumpToDiscussion = Vue.extend({
|
||||
mixins: [DiscussionMixins],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
w.ResolveBtn = Vue.extend({
|
||||
props: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
w.ResolveCount = Vue.extend({
|
||||
mixins: [DiscussionMixins],
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
w.ResolveDiscussionBtn = Vue.extend({
|
||||
props: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
//= require vue
|
||||
//= require vue-resource
|
||||
//= require_directory ./models
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
w.DiscussionMixins = {
|
||||
computed: {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class DiscussionModel {
|
||||
constructor (discussionId) {
|
||||
this.id = discussionId;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
class NoteModel {
|
||||
constructor (discussionId, noteId, canResolve, resolved, resolved_by) {
|
||||
this.discussionId = discussionId;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
class ResolveServiceClass {
|
||||
constructor() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((w) => {
|
||||
w.CommentsStore = {
|
||||
state: {},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var Dispatcher;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require preview_markdown */
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function(global) {
|
||||
class DueDateSelect {
|
||||
constructor({ $dropdown, $loading } = {}) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
Array.prototype.first = function() {
|
||||
return this[0];
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatches;
|
||||
|
||||
Element.prototype.closest = function closest(selector, selectedElement = this) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
// Disable an element and add the 'disabled' Bootstrap class
|
||||
(function() {
|
||||
$.fn.extend({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Flash = (function() {
|
||||
var hideFlash;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
// Creates the variables for setting up GFM auto-completion
|
||||
(function() {
|
||||
if (window.GitLab == null) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote,
|
||||
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((global) => {
|
||||
/*
|
||||
* This class overrides the browser's validation error bubbles, displaying custom
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.GLForm = (function() {
|
||||
function GLForm(form) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
// This is a manifest file that'll be compiled into including all the files listed below.
|
||||
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
||||
// be included in the compiled file accessible from http://example.com/assets/application.js
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.StatGraph = (function() {
|
||||
function StatGraph() {}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require d3 */
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require d3 */
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
window.ContributorsStatGraphUtil = {
|
||||
parse_log: function(log) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.GroupAvatar = (function() {
|
||||
function GroupAvatar() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var slice = [].slice;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.ImporterStatus = (function() {
|
||||
function ImporterStatus(jobs_url, import_url) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var issuable_created;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.IssuableContext = (function() {
|
||||
function IssuableContext(currentUser) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*= require flash */
|
||||
/*= require jquery.waitforimages */
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.IssueStatusSelect = (function() {
|
||||
function IssueStatusSelect() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((global) => {
|
||||
|
||||
class IssuableBulkActions {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
((global) => {
|
||||
|
||||
class LabelManager {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
this.LabelsSelect = (function() {
|
||||
function LabelsSelect() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
(function() {
|
||||
var hideEndFade;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue