Skip to content

Commit

Permalink
Update eslint from 1.x to 2.6.0, lodash 4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
klimashkin committed Apr 3, 2016
1 parent 7933398 commit a5f1c92
Show file tree
Hide file tree
Showing 18 changed files with 2,955 additions and 2,167 deletions.
178 changes: 0 additions & 178 deletions .eslintrc

This file was deleted.

133 changes: 133 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
module.exports = {
'root': true,
'parser': 'babel-eslint',

'env': {
'es6': true,
'amd': true,
'jest': true,
'node': true,
'jquery': true,
'browser': true,
'serviceworker': true,
},

'parserOptions': {
'ecmaVersion': 7,
'sourceType': 'module',
'ecmaFeatures': {
'objectLiteralDuplicateProperties': false
}
},

'globals': {
'analytics': true,
'init': true,
'ga': true
},

'rules': {
// enforce or disallow variable initializations at definition
'init-declarations': 0,
// disallow the catch clause parameter name being the same as a variable in the outer scope
'no-catch-shadow': 2,
// disallow deletion of variables
'no-delete-var': 2,
// disallow var and named functions in global scope
'no-implicit-globals': 2,
// disallow labels that share a name with a variable
'no-label-var': 2,
// disallow self assignment
// http://eslint.org/docs/rules/no-self-assign
'no-self-assign': 2,
// disallow shadowing of names such as arguments
'no-shadow-restricted-names': 2,
// disallow declaration of variables already declared in the outer scope
'no-shadow': [0, {'builtinGlobals': false, 'hoist': 'functions', 'allow': []}],
// disallow use of undefined when initializing variables
'no-undef-init': 0,
// disallow use of undeclared variables unless mentioned in a /*global */ block
'no-undef': 2,
// disallow use of undefined variable
'no-undefined': 0,
// disallow declaration of variables that are not used in the code
'no-unused-vars': [2, {'vars': 'all', 'args': 'after-used'}],
// disallow use of variables before they are defined
'no-use-before-define': [2, {'functions': false, 'classes': true}],
// require spaces around operators
'space-infix-ops': 2,
// require use of semicolons where they are valid instead of ASI
'semi': [2, 'always'],
// Disallow duplicate imports
'no-duplicate-imports': 2,
// Disallow unnecessary escape usage
'no-useless-escape': 2,
// Creating objects with duplicate keys in objects can cause unexpected behavior in your application
'no-dupe-keys': 2,

'arrow-body-style': [2, 'as-needed'],
// require parens in arrow function arguments
'arrow-parens': 0,
// require space before/after arrow function's arrow
'arrow-spacing': [2, {'before': true, 'after': true}],
// require trailing commas in multiline object literals
'comma-dangle': [2, 'never'],
// verify super() callings in constructors
'constructor-super': 0,
// enforce the spacing around the * in generator functions
'generator-star-spacing': 0,
// disallow modifying variables of class declarations
'no-class-assign': 0,
// disallow arrow functions where they could be confused with comparisons
'no-confusing-arrow': 0,
// disallow modifying variables that are declared using const
'no-const-assign': 2,
// disallow symbol constructor
'no-new-symbol': 2,
// disallow specific globals
'no-restricted-globals': 0,
// disallow specific imports
'no-restricted-imports': 0,
// disallow to use this/super before super() calling in constructors.
'no-this-before-super': 0,
'no-var': 2,
// disallow unnecessary constructor
'no-useless-constructor': 2,
'object-shorthand': [2, 'always'],
// suggest using arrow functions as callbacks
'prefer-arrow-callback': 0,
// suggest using of const declaration for variables that are never modified after declared
// destructuring:all means if some variable within destructuring is modified later(let), even if others never(const), whole destructuring can be defined as let
'prefer-const': [2, {'destructuring': 'all'}],
// suggest using the spread operator instead of .apply()
'prefer-spread': 2,
// suggest using Reflect methods where applicable
'prefer-reflect': 0,
// use rest parameters instead of arguments
'prefer-rest-params': 2,
// suggest using template literals instead of string concatenation
'prefer-template': 0,
// disallow generator functions that do not have yield
'require-yield': 0,
// import sorting
'sort-imports': 0,
// enforce usage of spacing in template strings
'template-curly-spacing': 2,
// enforce spacing around the * in yield* expressions
'yield-star-spacing': [2, 'after'],

// babel inserts `'use strict';` for us
'strict': [2, 'never'],

// specify the maximum depth that blocks can be nested
'max-depth': [0, 4],
// limits the number of parameters that can be used in the function declaration.
'max-params': [0, 3],
// specify the maximum number of statement allowed in a function
'max-statements': [0, 10],
// disallow use of bitwise operators
'no-bitwise': 0,
// disallow use of unary operators, ++ and --
'no-plusplus': 0,
}
};
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
registry = http://registry.npmjs.org
registry = https://registry.npmjs.org
save-exact=true
1 change: 0 additions & 1 deletion config/browsers.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
module.exports = function (config/* , appRequire */) {
config.browsers = {

Expand Down
4 changes: 1 addition & 3 deletions config/default.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Default server configuration
'use strict';

var ms = require('ms');
const ms = require('ms');

module.exports = {
env: 'development', // Enviroment: development, testing, production
Expand Down
2 changes: 1 addition & 1 deletion config/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* You can override any specific parameter through console, for example, --no-gzip
*/
'use strict';
'use strict'; // eslint-disable-line strict

const os = require('os');
const fs = require('fs');
Expand Down
5 changes: 2 additions & 3 deletions controllers/coreclient.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import net from 'net';
import _ from 'lodash';
import EventEmitter from 'events';

export class Client extends EventEmitter {
constructor(logger) {
constructor(logger, ...args) {
super();

this.logger = logger || console;
this.socketClosed = true;
this.connectargs = _.toArray(arguments);
this.connectargs = args;
this.promiseDescriptors = new Map();
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { env, mail: mailConf } = config;

const logger = log4js.getLogger('mail.js');
const logoBuf = new Buffer('iVBORw0KGgoAAAANSUhEUgAAAC8AAAAxCAIAAADFmWcQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAnkSURBVFhHzZjbcxPXHcf7X/StoTN96PShD512MkMN2LIs2ZIlS7KktaTVSitLWl1sWbJkfMVYNhhsx9xTcLhMJ/SlDJP0oeT+kF5SJjQPLQkhaQgEjO8YY4Ppa7+/PevVai0bwmSmzHxnRz7ec87n/G7n7PnRTy29L49eepodDT3ys1vb+INrR/1eXQukpwEKo9legi19xJ14j5duivG5uLScSCwlktNdPUGLNF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3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const emailValidator = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
export const sender = {
noreply: 'PastVu ★<[email protected]>'
};
Expand Down
4 changes: 2 additions & 2 deletions controllers/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export function responseHeaderHook() {
next = Utils.dummyFn;
}

res.writeHead = function () {
res.writeHead = function (...args) {
res.setHeader('X-Response-Time', `${Date.now() - start}ms`);
writeHeadOriginal.apply(res, arguments);
writeHeadOriginal.apply(res, args);
};
next();
};
Expand Down
2 changes: 1 addition & 1 deletion controllers/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const privateDir = path.join(config.storePath, 'private/avatars/');
const publicDir = path.join(config.storePath, 'public/avatars/');
const mkdirpAsync = Bluebird.promisify(mkdirp);
const execAsync = Bluebird.promisify(exec);
const emailRegexp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const emailRegexp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

const getUserByLogin = async function (login) {
const usObjOnline = session.getOnline({ login });
Expand Down
Loading

0 comments on commit a5f1c92

Please sign in to comment.