Commit 37d54854 authored by Eric Eastwood's avatar Eric Eastwood

Re-enable CI linting/validation

parent 0ce4b9d4
......@@ -4,7 +4,7 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 2017,
"sourceType": "script"
},
"plugins": [
......@@ -113,7 +113,7 @@
"node/no-unsupported-features": [
"error",
{
"version": 6
"version": 10
}
]
}
......
......@@ -25,9 +25,8 @@ validate:
<<: *node_job
stage: build_unit_test
script:
# TODO: Skip for now because we have new eslint failures
- "echo 'TODO: Skip validation for now because we have new eslint failures'"
#- make validate
- make validate
test:
......
/* eslint complexity: ["error", 14] */
/* eslint complexity: ["error", 15] */
"use strict";
......@@ -386,6 +386,7 @@ function findChatMessagesForTroupe(troupeId, options = {}, callback) {
}
return findMarker
// eslint-disable-next-line max-statements
.then(function(markerId) {
if(!markerId && !options.aroundId) {
var q = ChatMessage
......
......@@ -6,6 +6,7 @@ var avatars = require('gitter-web-avatars');
var getGitlabAccessTokenFromUser = require('./get-gitlab-access-token-from-user');
var getPublicTokenFromPool = require('./get-public-token-from-pool');
// eslint-disable-next-line complexity
function standardizeResponse(response) {
var state = '';
if(response.state === 'opened' || response.state === 'reopened') {
......
......@@ -4,6 +4,7 @@ var isGitHubUsername = require('./is-github-username');
var LEGACY_DEFAULT_SCOPE = {'user': 1, 'user:email': 1, 'user:follow': 1, 'repo': 1, 'public_repo': 1};
// eslint-disable-next-line complexity
function hasGitHubScope(user, scope) {
var githubToken = user.githubToken;
var githubScopes = user.githubScopes;
......
......@@ -61,6 +61,7 @@ function validateTransformation(Model, sd, newType, groupId) {
}
}
// eslint-disable-next-line complexity
function transform(Model, sd, newType, options) {
var groupId = options && options.groupId;
// Idempotent?
......
......@@ -196,6 +196,7 @@ function setIds(array) {
* associated with doing this, so only the trivial case is attempted.
*
*/
// eslint-disable-next-line complexity
function conjunctionIds(terms, termIdentifiers) {
if (!terms.length) return { $or: terms };
if (terms.length < 3) return { $or: terms };
......
......@@ -61,6 +61,7 @@ function getShortFromUserName(user) {
return displayName.trim();
}
// eslint-disable-next-line complexity
function summarizeChatsInRoom(troupe, chats, options) {
var appendText = options && options.appendText;
var maxMessageLength = options && options.maxMessageLength || MAX_NOTIFICATION_TEXT;
......
......@@ -106,6 +106,7 @@ function bulkInsertTroupeUsers(troupeId, userIds, membershipStrategy) {
});
}
// eslint-disable-next-line complexity
function createTroupe(fixtureName, f, fixture) {
var oneToOneUsers;
......
......@@ -6287,38 +6287,53 @@
}
}
},
"eslint-plugin-es": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz",
"integrity": "sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==",
"dev": true,
"requires": {
"eslint-utils": "^1.3.0",
"regexpp": "^2.0.1"
}
},
"eslint-plugin-jquery": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jquery/-/eslint-plugin-jquery-1.3.1.tgz",
"integrity": "sha512-ymFQ6K7BXPg9z6ZWVGnaRObsxS5rZ1w6Cwgg4GW6lWaMBS5XO2rW34ddlOEccG6DANQyNrpt70nVSuaqKb0uzQ==",
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-jquery/-/eslint-plugin-jquery-1.3.2.tgz",
"integrity": "sha512-iWOZzxvXeE/lDdy3n5wMx5Ne9naxAOSEE/+mAcJdsdsj+YYgZAW1JyaXYoWyPJnXx4WoTOMWsNtyF9B0ECdGVQ==",
"dev": true
},
"eslint-plugin-mocha": {
"version": "4.12.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-4.12.1.tgz",
"integrity": "sha512-hxWtYHvLA0p/PKymRfDYh9Mxt5dYkg2Goy1vZDarTEEYfELP9ksga7kKG1NUKSQy27C8Qjc7YrSWTLUhOEOksA==",
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-5.2.0.tgz",
"integrity": "sha512-4VTX/qIoxUFRnXLNm6bEhEJyfGnGagmQzV4TWXKzkZgIYyP2FSubEdCjEFTyS/dGwSVRWCWGX7jO7BK8R0kppg==",
"dev": true,
"requires": {
"ramda": "^0.25.0"
}
},
"eslint-plugin-node": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz",
"integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==",
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.0.tgz",
"integrity": "sha512-Y+ln8iQ52scz9+rSPnSWRaAxeWaoJZ4wIveDR0vLHkuSZGe44Vk1J4HX7WvEP5Cm+iXPE8ixo7OM7gAO3/OKpQ==",
"dev": true,
"requires": {
"ignore": "^3.3.6",
"eslint-plugin-es": "^1.3.1",
"eslint-utils": "^1.3.1",
"ignore": "^5.0.2",
"minimatch": "^3.0.4",
"resolve": "^1.3.3",
"semver": "5.3.0"
"resolve": "^1.8.1",
"semver": "^5.5.0"
},
"dependencies": {
"semver": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=",
"dev": true
"resolve": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
"integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
"dev": true,
"requires": {
"path-parse": "^1.0.5"
}
}
}
},
......@@ -10353,9 +10368,9 @@
"integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q="
},
"ignore": {
"version": "3.3.8",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz",
"integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==",
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.4.tgz",
"integrity": "sha512-WLsTMEhsQuXpCiG173+f3aymI43SXa+fB1rSfbzyP4GkPP+ZFVuO0/3sFUGNBtifisPeDcl/uD/Y2NxZ7xFq4g==",
"dev": true
},
"ignore-by-default": {
......
......@@ -9,6 +9,7 @@ module.exports = (function() {
var toString = ObjProto.toString;
// Internal recursive comparison function for `isEqual`.
// eslint-disable-next-line complexity, max-statements
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
......
......@@ -42,6 +42,7 @@ DNDCtrl.prototype = _.extend(DNDCtrl.prototype, Backbone.Events, {
this.drag.containers.splice(index, 1);
},
// eslint-disable-next-line complexity
onItemDropped: function(el, target, source, sibling) {//jshint unused: true
//guard against no drop target
if(!target || !target.dataset) { return }
......
......@@ -57,7 +57,8 @@ module.exports = Backbone.Model.extend({
Backbone.Model.prototype.constructor.call(this, attrs, options);
},
initialize: function(attrs) { // eslint-disable-line max-statements
// eslint-disable-next-line max-statements
initialize: function(attrs) {
this.set('panelOpenState', this.get('roomMenuIsPinned'));
if (!attrs || !attrs.bus) {
......
......@@ -7,6 +7,7 @@
var supportsPassiveOption = false;
try {
var opts = Object.defineProperty({}, 'passive', {
// eslint-disable-next-line getter-return
get: function() {
supportsPassiveOption = true;
}
......
......@@ -136,6 +136,7 @@ module.exports = (function() {
}, self.options.delay.hide)
}
// eslint-disable-next-line complexity
, show: function () {
var $tip
, pos
......
......@@ -14,6 +14,7 @@ function customValueOfFunction(f) {
}
// Internal recursive comparison function for `isEqual`.
// eslint-disable-next-line complexity, max-statements
function eq(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
......
......@@ -32,6 +32,7 @@ WidgetManager.prototype.destroy = function() {
this._widgets = [];
};
// eslint-disable-next-line complexity
function render(template, data, view) {
if (!template) {
var pseudoSelectorString = '';
......
......@@ -273,6 +273,7 @@ module.exports = (function() {
}
},
// eslint-disable-next-line complexity
onCopy: function(e) {
if (!window.getSelection /* ios8 */) return;
......
......@@ -270,6 +270,7 @@ module.exports = (function() {
return false;
},
// eslint-disable-next-line complexity
updateRender: function(changes) {
if (this._requiresFullRender(changes)) {
return this.render();
......
......@@ -186,6 +186,7 @@ var IssueModel = Backbone.Model.extend({
sync: SyncMixin.sync
});
// eslint-disable-next-line complexity
function getAnchorUrl(githubRepo, issueNumber) {
var currentRoom = context.troupe();
var currentGroup = context.group();
......
......@@ -101,6 +101,7 @@ module.exports = (function() {
this.updateRender(null); // Null means its the initial render
},
// eslint-disable-next-line complexity
updateRender: function(model) {
var changed = model && model.changed;
var attributes = model && model.attributes || this.model.attributes;
......
......@@ -412,6 +412,7 @@ var CreateRoomView = Marionette.LayoutView.extend({
var associatedGithubProject = this.model.get('associatedGithubProject');
var security = this.model.get('security');
// eslint-disable-next-line complexity
fastdom.mutate(function() {
// Room name
this.ui.nameInput[0].value = roomName;
......
......@@ -261,6 +261,7 @@ var PermissionsView = Marionette.LayoutView.extend({
},
// eslint-disable-next-line complexity
getPermissionOptions: function() {
var entity = this.model.get('entity');
var sd = this.model.get('securityDescriptor');
......
......@@ -253,6 +253,7 @@ var Popover = Marionette.ItemView.extend({
},
// eslint-disable-next-line complexity, max-statements
applyPlacement: function(offset, placement){
var $e = this.$el;
var e = $e[0];
......
......@@ -5,7 +5,7 @@
var userService = require('gitter-web-users');
var troupeService = require('gitter-web-rooms/lib/troupe-service');
var unreadItemService = require('gitter-web-unread-items');
var categoriseUsersInRoom = require('gitter-web-unread-item/lib/categorise-users-in-room');
var categoriseUsersInRoom = require('gitter-web-unread-items/lib/categorise-users-in-room');
var collections = require('gitter-web-utils/lib/collections');
var oneToOneRoomService = require('gitter-web-rooms/lib/one-to-one-room-service');
var Promise = require('bluebird');
......
......@@ -5,7 +5,7 @@
var userService = require('gitter-web-users');
var troupeService = require('gitter-web-rooms/lib/troupe-service');
var oneToOneRoomService = require('gitter-web-rooms/lib/one-to-one-room-service');
var categoriseUsersInRoom = require('gitter-web-unread-item/lib/categorise-users-in-room');
var categoriseUsersInRoom = require('gitter-web-unread-items/lib/categorise-users-in-room');
var roomMembershipService = require('gitter-web-rooms/lib/room-membership-service');
var collections = require('gitter-web-utils/lib/collections');
var Promise = require('bluebird');
......
......@@ -24,6 +24,7 @@ function parseLookups(lookups) {
module.exports = {
id: 'chatMessageId',
// eslint-disable-next-line complexity
index: function(req) {
var skip = req.query.skip;
var limit = req.query.limit;
......
......@@ -54,6 +54,8 @@ function renderChat(req, res, next, options) {
options.fetchUsers === false ? null : restful.serializeUsersForTroupe(troupe.id, userId, userSerializerOptions),
generateRightToolbarSnapshot(req),
generateUserThemeSnapshot(req),
// eslint-disable-next-line complexity
]).spread(function (troupeContext, chats, activityEvents, users, rightToolbarSnapshot, userThemeSnapshot) {
var initialChat = _.find(chats, function(chat) { return chat.initial; });
var initialBottom = !initialChat;
......
......@@ -260,6 +260,7 @@ function TroupeStrategy(options) {
}
}
// eslint-disable-next-line complexity
this.map = function(item) {
var id = item.id || item._id
var uri = item.uri;
......
......@@ -155,6 +155,7 @@ function UserStrategy(options) {
return options.exposeRawDisplayName ? user.displayName : user.displayName || user.username
}
// eslint-disable-next-line complexity
this.map = function(user) {
if (!user) return null;
var scopes;
......
......@@ -7,6 +7,7 @@ var oauthService = require('../../services/oauth-service');
var validateUserAgentFromReq = require('../validate-user-agent-from-req');
var checkAlreadyOnUnauthorizedUrl = require('../../utils/check-already-on-unauthorized-url');
// eslint-disable-next-line complexity
function getAccessToken(req) {
if(req.headers && req.headers['authorization']) {
......
......@@ -48,6 +48,7 @@ function updateUserTzInfo(user, timezoneInfo) {
.done();
}
// eslint-disable-next-line complexity
module.exports = function(req, res, next) {
/** Parse the cookie if one exists */
var parsed = parseTimezoneCookie(req.cookies.gitter_tz);
......
......@@ -4,7 +4,7 @@
"shared-node-browser": true
},
"parserOptions": {
"ecmaVersion": 5,
"ecmaVersion": 6,
"sourceType": "script"
},
"rules": {
......
/* eslint complexity: ["error", 15] */
/* eslint complexity: ["error", 17] */
'use strict';
var _ = require('underscore');
......
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