mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Merge branch 'fix-eslint-config' into fix-mocha-config
This commit is contained in:
commit
82cda33f7e
12
.eslintrc.js
12
.eslintrc.js
@ -5,12 +5,12 @@ module.exports = {
|
||||
"rules": {
|
||||
"func-names": "off",
|
||||
"global-require": "off", // Interfers with optional and eventual circular references
|
||||
|
||||
// doesn't work in node v4 :(
|
||||
"strict": "off",
|
||||
"prefer-rest-params": "off",
|
||||
"react/require-extension": "off",
|
||||
"import/no-extraneous-dependencies": "off"
|
||||
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/scripts/**", "**/tests/**"]}],
|
||||
"react/require-extension": "off", // Forced by airbnb, not applicable (also deprecated)
|
||||
"strict": ["error", "safe"], // airbnb implies we're transpiling with babel, we're not
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "script", // airbnb assumes ESM, while we're CJS
|
||||
},
|
||||
"env": {
|
||||
"mocha": true,
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const fileExists = require('./fileExists');
|
||||
const readFile = require('./readFile');
|
||||
const BbPromise = require('bluebird');
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const consoleLog = function () {
|
||||
console.log(arguments); // eslint-disable-line no-console
|
||||
const consoleLog = function (...args) {
|
||||
console.log(args); // eslint-disable-line no-console
|
||||
};
|
||||
|
||||
module.exports = consoleLog;
|
||||
|
||||
@ -4,11 +4,10 @@ const _ = require('lodash');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const fileLog = function () {
|
||||
const fileLog = function (...args) {
|
||||
// TODO BRN: This does not guarentee order, is not multi process safe,
|
||||
// TODO BRN: and is not guarenteed to complete before exit.
|
||||
fs.appendFileSync(path.join(process.cwd(), 'sls.log'),
|
||||
_.join(Array.prototype.slice.call(arguments)) + '\n'); // eslint-disable-line prefer-template
|
||||
fs.appendFileSync(path.join(process.cwd(), 'sls.log'), `${_.join(args)}\n`);
|
||||
};
|
||||
|
||||
module.exports = fileLog;
|
||||
|
||||
@ -9,8 +9,8 @@ const loggers = [
|
||||
fileLog,
|
||||
];
|
||||
|
||||
const log = function () {
|
||||
_.each(loggers, (logger) => logger.apply(null, arguments)); // eslint-disable-line prefer-spread
|
||||
const log = function (...args) {
|
||||
_.each(loggers, (logger) => logger(...args));
|
||||
};
|
||||
|
||||
module.exports = log;
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fse = require('fs-extra');
|
||||
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const raven = require('raven');
|
||||
const ci = require('ci-info');
|
||||
const configUtils = require('./config');
|
||||
|
||||
@ -13,8 +13,8 @@ const TRACK_URL = 'https://serverless.com/api/framework/track';
|
||||
const IDENTIFY_URL = 'https://serverless.com/api/framework/identify';
|
||||
const DEBUG = false;
|
||||
|
||||
function debug() {
|
||||
if (DEBUG) console.log(arguments);
|
||||
function debug(...args) {
|
||||
if (DEBUG) console.log(args);
|
||||
}
|
||||
|
||||
/* note tracking swallows errors */
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
// timeout is set to 5 minutes
|
||||
// eslint-disable-next-line no-undef
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 300000;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user