Commit dd5e46ab authored by Fatih Acet's avatar Fatih Acet

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
parents 5a4dabd0 02f94cf0
/public/
/tmp/
/vendor/
{
"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:
......
/* eslint-disable */
((global) => {
const MAX_MESSAGE_LENGTH = 500;
const MESSAGE_CELL_SELECTOR = '.abuse-reports .message';
......
/* eslint-disable */
(function() {
this.Activities = (function() {
function Activities() {
......
/* eslint-disable */
(function() {
this.Admin = (function() {
function Admin() {
......
/* eslint-disable */
(function() {
this.Api = {
groupsPath: "/api/:version/groups.json",
......
/* 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
......
/* eslint-disable */
(function() {
this.Aside = (function() {
function Aside() {
......
/* eslint-disable */
(function() {
this.Autosave = (function() {
function Autosave(field, key) {
......
/* eslint-disable */
(function() {
this.AwardsHandler = (function() {
const FROM_SENTENCE_REGEX = /(?:, and | and |, )/; //For separating lists produced by ruby's Array#toSentence
......
/* eslint-disable */
/*= require jquery.ba-resize */
/*= require autosize */
......
/* eslint-disable */
(function() {
$(function() {
$("body").on("click", ".js-details-target", function() {
......
/* eslint-disable */
// Quick Submit behavior
//
// When a child field of a form with a `js-quick-submit` class receives a
......
/* eslint-disable */
// Requires Input behavior
//
// When called on a form with input fields with the `required` attribute, the
......
/* eslint-disable */
(function(w) {
$(function() {
// Toggle button. Show/hide content inside parent container.
......
/* eslint-disable */
/*= require blob/template_selector */
((global) => {
......
/* eslint-disable */
(function() {
this.BlobFileDropzone = (function() {
function BlobFileDropzone(form, method) {
......
/* eslint-disable */
/*= require blob/template_selector */
......
/* eslint-disable */
(function() {
this.BlobGitignoreSelectors = (function() {
function BlobGitignoreSelectors(opts) {
......
/* eslint-disable */
/*= require blob/template_selector */
......
/* eslint-disable */
((global) => {
class BlobLicenseSelectors {
constructor({ $dropdowns, editor }) {
......
/* eslint-disable */
((global) => {
class TemplateSelector {
constructor({ dropdown, data, pattern, wrapper, editor, fileEndpoint, $input } = {}) {
......
/* eslint-disable */
/*= require_tree . */
(function() {
......
/* eslint-disable */
(function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
//= require vue
//= require vue-resource
//= require Sortable
......
/* eslint-disable */
//= require ./board_blank_state
//= require ./board_delete
//= require ./board_list
......
/* eslint-disable */
(() => {
const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable */
(() => {
const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable */
(() => {
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
......
/* eslint-disable */
//= require ./board_card
//= require ./board_new_issue
......
/* eslint-disable */
(() => {
const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable */
$(() => {
const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable */
((w) => {
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
......
/* eslint-disable */
class ListIssue {
constructor (obj) {
this.id = obj.iid;
......
/* eslint-disable */
class ListLabel {
constructor (obj) {
this.id = obj.id;
......
/* eslint-disable */
class List {
constructor (obj) {
this.id = obj.id;
......
/* eslint-disable */
class ListUser {
constructor (user) {
this.id = user.id;
......
/* eslint-disable */
class BoardService {
constructor (root, boardId) {
this.lists = Vue.resource(`${root}/${boardId}/lists{/id}`, {}, {
......
/* eslint-disable */
(() => {
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
......
/* eslint-disable */
(function () {
'use strict';
......
/* eslint-disable */
Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
......
/* eslint-disable */
(function() {
this.Breakpoints = (function() {
var BreakpointInstance, instance;
......
/* eslint-disable */
(function() {
$(function() {
var previewPath;
......
/* eslint-disable */
(function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
(function() {
this.BuildArtifacts = (function() {
function BuildArtifacts() {
......
/* eslint-disable */
$(function(){
$('.reveal-variables').off('click').on('click',function(){
$('.js-build').toggle().niceScroll();
......
/* eslint-disable */
(function() {
this.Commit = (function() {
function Commit() {
......
/* eslint-disable */
(function() {
this.CommitFile = (function() {
function CommitFile(file) {
......
/* eslint-disable */
(function() {
this.ImageFile = (function() {
var prepareFrames;
......
/* eslint-disable */
(function() {
this.CommitsList = (function() {
function CommitsList() {}
......
/* eslint-disable */
(function() {
this.Compare = (function() {
function Compare(opts) {
......
/* eslint-disable */
(function() {
this.CompareAutocomplete = (function() {
function CompareAutocomplete() {
......
/* eslint-disable */
(function() {
this.ConfirmDangerModal = (function() {
function ConfirmDangerModal(form, text) {
......
/* eslint-disable */
/*= require clipboard */
......
/* eslint-disable */
(function (w) {
class CreateLabelDropdown {
constructor ($el, namespacePath, projectPath) {
......
/* eslint-disable */
//= require vue
((global) => {
......
/* eslint-disable */
(function() {
this.Diff = (function() {
var UNFOLD_COUNT;
......
/* eslint-disable */
((w) => {
w.CommentAndResolveBtn = Vue.extend({
props: {
......
/* eslint-disable */
(() => {
JumpToDiscussion = Vue.extend({
mixins: [DiscussionMixins],
......
/* eslint-disable */
((w) => {
w.ResolveBtn = Vue.extend({
props: {
......
/* eslint-disable */
((w) => {
w.ResolveCount = Vue.extend({
mixins: [DiscussionMixins],
......
/* eslint-disable */
((w) => {
w.ResolveDiscussionBtn = Vue.extend({
props: {
......
/* eslint-disable */
//= require vue
//= require vue-resource
//= require_directory ./models
......
/* eslint-disable */
((w) => {
w.DiscussionMixins = {
computed: {
......
/* eslint-disable */
class DiscussionModel {
constructor (discussionId) {
this.id = discussionId;
......
/* eslint-disable */
class NoteModel {
constructor (discussionId, noteId, canResolve, resolved, resolved_by) {
this.discussionId = discussionId;
......
/* eslint-disable */
((w) => {
class ResolveServiceClass {
constructor() {
......
/* eslint-disable */
((w) => {
w.CommentsStore = {
state: {},
......
/* eslint-disable */
(function() {
var Dispatcher;
......
/* eslint-disable */
/*= require preview_markdown */
......
/* eslint-disable */
(function(global) {
class DueDateSelect {
constructor({ $dropdown, $loading } = {}) {
......
/* eslint-disable */
Array.prototype.first = function() {
return this[0];
}
......
/* eslint-disable */
Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatches;
Element.prototype.closest = function closest(selector, selectedElement = this) {
......
/* eslint-disable */
// Disable an element and add the 'disabled' Bootstrap class
(function() {
$.fn.extend({
......
/* eslint-disable */
(function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
(function() {
this.Flash = (function() {
var hideFlash;
......
/* eslint-disable */
// Creates the variables for setting up GFM auto-completion
(function() {
if (window.GitLab == null) {
......
/* eslint-disable */
(function() {
var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
......
/* eslint-disable */
((global) => {
/*
* This class overrides the browser's validation error bubbles, displaying custom
......
/* eslint-disable */
(function() {
this.GLForm = (function() {
function GLForm(form) {
......
/* 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
......
/* eslint-disable */
(function() {
this.StatGraph = (function() {
function StatGraph() {}
......
/* eslint-disable */
(function() {
window.ContributorsStatGraphUtil = {
parse_log: function(log) {
......
/* eslint-disable */
(function() {
this.GroupAvatar = (function() {
function GroupAvatar() {
......
/* eslint-disable */
(function() {
var slice = [].slice;
......
/* eslint-disable */
(function() {
this.ImporterStatus = (function() {
function ImporterStatus(jobs_url, import_url) {
......
/* eslint-disable */
(function() {
var issuable_created;
......
/* eslint-disable */
(function() {
this.IssuableContext = (function() {
function IssuableContext(currentUser) {
......
/* eslint-disable */
(function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
/*= require flash */
/*= require jquery.waitforimages */
......
/* eslint-disable */
(function() {
this.IssueStatusSelect = (function() {
function IssueStatusSelect() {
......
/* eslint-disable */
((global) => {
class IssuableBulkActions {
......
/* eslint-disable */
((global) => {
class LabelManager {
......
/* eslint-disable */
(function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
(function() {
this.LabelsSelect = (function() {
function LabelsSelect() {
......
/* eslint-disable */
(function() {
var hideEndFade;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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