From 8a5d2dc1f69a833aa0619c4b19c992d657aa6fd7 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 1 Feb 2021 14:37:10 +1000 Subject: [PATCH] refactor: eslint fix --- .eslintrc.js | 18 +- __tests__/integration.js | 38 +- .../webpack.config.js | 2 +- examples/basic-starter-hapi/src/app.js | 3 +- examples/lambda-edge/webpack.config.js | 2 +- examples/sails/Gruntfile.js | 6 +- examples/sails/config/blueprints.js | 2 - examples/sails/config/bootstrap.js | 2 +- examples/sails/config/datastores.js | 4 +- examples/sails/config/env/production.js | 60 +- examples/sails/config/globals.js | 2 +- examples/sails/config/http.js | 3 +- examples/sails/config/i18n.js | 2 +- examples/sails/config/models.js | 16 +- examples/sails/config/routes.js | 4 +- examples/sails/config/security.js | 1 - examples/sails/config/session.js | 3 +- examples/sails/config/sockets.js | 4 - examples/sails/scripts/local.js | 38 +- examples/sails/tasks/config/babel.js | 4 +- examples/sails/tasks/config/clean.js | 4 +- examples/sails/tasks/config/concat.js | 4 +- examples/sails/tasks/config/copy.js | 6 +- examples/sails/tasks/config/cssmin.js | 4 +- examples/sails/tasks/config/hash.js | 8 +- examples/sails/tasks/config/less.js | 4 +- examples/sails/tasks/config/sails-linker.js | 18 +- examples/sails/tasks/config/sync.js | 4 +- examples/sails/tasks/config/uglify.js | 7 +- examples/sails/tasks/config/watch.js | 4 +- examples/sails/tasks/pipeline.js | 20 +- examples/sails/tasks/register/build.js | 2 +- examples/sails/tasks/register/buildProd.js | 11 +- .../sails/tasks/register/compileAssets.js | 4 +- examples/sails/tasks/register/default.js | 4 - examples/sails/tasks/register/linkAssets.js | 4 +- .../sails/tasks/register/linkAssetsBuild.js | 4 +- .../tasks/register/linkAssetsBuildProd.js | 4 +- examples/sails/tasks/register/polyfill.js | 11 +- examples/sails/tasks/register/prod.js | 9 +- examples/sails/tasks/register/syncAssets.js | 4 +- jest-helpers/alb-event.js | 30 +- jest-helpers/api-gateway-v1-event.js | 100 +- jest-helpers/api-gateway-v2-event.js | 42 +- jest-helpers/index.js | 6 +- jest-helpers/lambda-edge-event.js | 96 +- package-lock.json | 8860 +++++------------ package.json | 10 +- src/event-sources/aws/alb.js | 2 +- src/event-sources/aws/api-gateway-v1.js | 2 +- src/event-sources/aws/lambda-edge.js | 4 +- src/event-sources/utils.js | 18 +- 52 files changed, 3025 insertions(+), 6499 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 4bb962be..a2d613fd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,10 @@ module.exports = { - extends: 'standard', - globals: { - test: true, - expect: true, - describe: true, - beforeEach: true, - jest: true - } -}; \ No newline at end of file + extends: 'standard', + globals: { + test: true, + expect: true, + describe: true, + beforeEach: true, + jest: true + } +} diff --git a/__tests__/integration.js b/__tests__/integration.js index be8428ea..cab03df9 100644 --- a/__tests__/integration.js +++ b/__tests__/integration.js @@ -50,7 +50,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo httpMethod: 'GET' }) const response = await serverlessExpressInstance.handler(event) - const expected = `/` + const expected = '/' expect(response.body).toEqual(expected) const expectedResponse = makeResponse({ eventSourceName, @@ -178,7 +178,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo const response = await serverlessExpressInstance.handler(event) const expectedResponse = makeResponse({ eventSourceName, - body: JSON.stringify({id: '3'}), + body: JSON.stringify({ id: '3' }), multiValueHeaders: { 'content-length': ['10'], etag: ['W/"a-lfm5LdsGBlIttC0+rnSiywX9+Wc"'] @@ -218,7 +218,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo const lastModifiedRegex = /^.* GMT$/ switch (eventSourceName) { case 'alb': - case 'apiGatewayV1': + case 'apiGatewayV1': expect(response.multiValueHeaders.etag.length).toEqual(1) expect(response.multiValueHeaders.etag[0]).toMatch(etagRegex) expect(response.multiValueHeaders['last-modified'].length).toEqual(1) @@ -226,22 +226,22 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo delete response.multiValueHeaders.etag delete response.multiValueHeaders['last-modified'] break - case 'apiGatewayV2': - expect(response.headers.etag).toMatch(etagRegex) - expect(response.headers['last-modified']).toMatch(lastModifiedRegex) - delete response.headers.etag - delete response.headers['last-modified'] - break - case 'lambdaEdge': - expect(response.headers.etag.length).toEqual(1) - expect(response.headers.etag[0].key).toMatch('etag') - expect(response.headers.etag[0].value).toMatch(etagRegex) - expect(response.headers['last-modified'].length).toEqual(1) - expect(response.headers['last-modified'][0].key).toMatch('last-modified') - expect(response.headers['last-modified'][0].value).toMatch(lastModifiedRegex) - delete response.headers.etag - delete response.headers['last-modified'] - break + case 'apiGatewayV2': + expect(response.headers.etag).toMatch(etagRegex) + expect(response.headers['last-modified']).toMatch(lastModifiedRegex) + delete response.headers.etag + delete response.headers['last-modified'] + break + case 'lambdaEdge': + expect(response.headers.etag.length).toEqual(1) + expect(response.headers.etag[0].key).toMatch('etag') + expect(response.headers.etag[0].value).toMatch(etagRegex) + expect(response.headers['last-modified'].length).toEqual(1) + expect(response.headers['last-modified'][0].key).toMatch('last-modified') + expect(response.headers['last-modified'][0].value).toMatch(lastModifiedRegex) + delete response.headers.etag + delete response.headers['last-modified'] + break } expect(response).toEqual(expectedResponse) }) diff --git a/examples/basic-starter-api-gateway-v1/webpack.config.js b/examples/basic-starter-api-gateway-v1/webpack.config.js index bf55198d..db5c4393 100644 --- a/examples/basic-starter-api-gateway-v1/webpack.config.js +++ b/examples/basic-starter-api-gateway-v1/webpack.config.js @@ -16,7 +16,7 @@ module.exports = { new CopyPlugin({ patterns: [ { from: './src/views', to: 'views' }, - { from: './src/sam-logo.png' }, + { from: './src/sam-logo.png' } ] }) ] diff --git a/examples/basic-starter-hapi/src/app.js b/examples/basic-starter-hapi/src/app.js index 693d84b7..c35cd061 100644 --- a/examples/basic-starter-hapi/src/app.js +++ b/examples/basic-starter-hapi/src/app.js @@ -8,8 +8,7 @@ server.route({ method: 'GET', path: '/', handler: (request, h) => { - - return 'Hello World!'; + return 'Hello World!' } }) module.exports = server.listener._events.request diff --git a/examples/lambda-edge/webpack.config.js b/examples/lambda-edge/webpack.config.js index bf55198d..db5c4393 100644 --- a/examples/lambda-edge/webpack.config.js +++ b/examples/lambda-edge/webpack.config.js @@ -16,7 +16,7 @@ module.exports = { new CopyPlugin({ patterns: [ { from: './src/views', to: 'views' }, - { from: './src/sam-logo.png' }, + { from: './src/sam-logo.png' } ] }) ] diff --git a/examples/sails/Gruntfile.js b/examples/sails/Gruntfile.js index e3b28473..8ebed791 100644 --- a/examples/sails/Gruntfile.js +++ b/examples/sails/Gruntfile.js @@ -12,12 +12,10 @@ * For more information see: * https://sailsjs.com/anatomy/Gruntfile.js */ -module.exports = function(grunt) { - - var loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks'); +module.exports = function (grunt) { + const loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks'); // Load Grunt task configurations (from `tasks/config/`) and Grunt // task registrations (from `tasks/register/`). loadGruntTasks(__dirname, grunt); - }; diff --git a/examples/sails/config/blueprints.js b/examples/sails/config/blueprints.js index e8552ef4..8ef26d73 100644 --- a/examples/sails/config/blueprints.js +++ b/examples/sails/config/blueprints.js @@ -19,7 +19,6 @@ module.exports.blueprints = { // actions: false, - /*************************************************************************** * * * Automatically expose RESTful routes for your models? * @@ -28,7 +27,6 @@ module.exports.blueprints = { // rest: true, - /*************************************************************************** * * * Automatically expose CRUD "shortcut" routes to GET requests? * diff --git a/examples/sails/config/bootstrap.js b/examples/sails/config/bootstrap.js index fb1c17f1..4d8766d6 100644 --- a/examples/sails/config/bootstrap.js +++ b/examples/sails/config/bootstrap.js @@ -9,7 +9,7 @@ * https://sailsjs.com/config/bootstrap */ -module.exports.bootstrap = async function() { +module.exports.bootstrap = async function () { // By convention, this is a good place to set up fake data during development. // diff --git a/examples/sails/config/datastores.js b/examples/sails/config/datastores.js index 38531843..42646484 100644 --- a/examples/sails/config/datastores.js +++ b/examples/sails/config/datastores.js @@ -15,7 +15,6 @@ module.exports.datastores = { - /*************************************************************************** * * * Your app's default datastore. * @@ -51,7 +50,6 @@ module.exports.datastores = { // adapter: 'sails-mysql', // url: 'mysql://user:password@host:port/database', - }, - + } }; diff --git a/examples/sails/config/env/production.js b/examples/sails/config/env/production.js index f358bb8d..55fe582d 100644 --- a/examples/sails/config/env/production.js +++ b/examples/sails/config/env/production.js @@ -21,7 +21,6 @@ module.exports = { - /************************************************************************** * * * Tell Sails what database(s) it should use in production. * @@ -49,7 +48,7 @@ module.exports = { default: { // adapter: 'sails-mysql', // url: 'mysql://user:password@host:port/database', - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- // /\ To avoid checking it in to version control, you might opt to set // || sensitive credentials like `url` using an environment variable. // @@ -57,7 +56,7 @@ module.exports = { // ``` // sails_datastores__default__url=mysql://admin:myc00lpAssw2D@db.example.com:3306/my_prod_db // ``` - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- /**************************************************************************** *                         * @@ -72,12 +71,10 @@ module.exports = { ****************************************************************************/ // ssl: true, - }, + } }, - - models: { /*************************************************************************** @@ -90,7 +87,7 @@ module.exports = { * https://sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate * * * ***************************************************************************/ - migrate: 'safe', + migrate: 'safe' /*************************************************************************** * * @@ -105,8 +102,6 @@ module.exports = { }, - - /************************************************************************** * * * Always disable "shortcut" blueprint routes. * @@ -118,11 +113,9 @@ module.exports = { * * ***************************************************************************/ blueprints: { - shortcuts: false, + shortcuts: false }, - - /*************************************************************************** * * * Configure your security settings for production. * @@ -151,12 +144,10 @@ module.exports = { // allowOrigins: [ // 'https://example.com', // ] - }, + } }, - - /*************************************************************************** * * * Configure how your app handles sessions in production. * @@ -186,7 +177,7 @@ module.exports = { ***************************************************************************/ // adapter: '@sailshq/connect-redis', // url: 'redis://user:password@localhost:6379/databasenumber', - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- // /\ OR, to avoid checking it in to version control, you might opt to // || set sensitive credentials like this using an environment variable. // @@ -195,9 +186,7 @@ module.exports = { // sails_session__url=redis://admin:myc00lpAssw2D@bigsquid.redistogo.com:9562/0 // ``` // - //-------------------------------------------------------------------------- - - + // -------------------------------------------------------------------------- /*************************************************************************** * * @@ -222,13 +211,11 @@ module.exports = { ***************************************************************************/ cookie: { // secure: true, - maxAge: 24 * 60 * 60 * 1000, // 24 hours - }, + maxAge: 24 * 60 * 60 * 1000 // 24 hours + } }, - - /************************************************************************** * * * Set up Socket.io for your production environment. * @@ -255,7 +242,6 @@ module.exports = { // 'https://staging.example.com', // ], - /*************************************************************************** * * * If you are deploying a cluster of multiple servers and/or processes, * @@ -270,7 +256,7 @@ module.exports = { ***************************************************************************/ // adapter: '@sailshq/socket.io-redis', // url: 'redis://user:password@bigsquid.redistogo.com:9562/databasenumber', - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- // /\ OR, to avoid checking it in to version control, you might opt to // || set sensitive credentials like this using an environment variable. // @@ -278,12 +264,10 @@ module.exports = { // ``` // sails_sockets__url=redis://admin:myc00lpAssw2D@bigsquid.redistogo.com:9562/0 // ``` - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- }, - - /************************************************************************** * * * Set the production log level. * @@ -295,8 +279,6 @@ module.exports = { level: 'debug' }, - - http: { /*************************************************************************** @@ -305,7 +287,7 @@ module.exports = { * (the "max-age" to include in the "Cache-Control" response header) * * * ***************************************************************************/ - cache: 365.25 * 24 * 60 * 60 * 1000, // One year + cache: 365.25 * 24 * 60 * 60 * 1000 // One year /*************************************************************************** * * @@ -326,8 +308,6 @@ module.exports = { }, - - /************************************************************************** * * * Lift the server on port 80. * @@ -339,8 +319,6 @@ module.exports = { ***************************************************************************/ // port: 80, - - /************************************************************************** * * * Configure an SSL certificate * @@ -360,8 +338,6 @@ module.exports = { **************************************************************************/ // ssl: undefined, - - /************************************************************************** * * * Production overrides for any custom settings specific to your app. * @@ -372,12 +348,12 @@ module.exports = { ***************************************************************************/ custom: { baseUrl: 'https://example.com', - internalEmailAddress: 'support@example.com', + internalEmailAddress: 'support@example.com' // mailgunDomain: 'mg.example.com', // mailgunSecret: 'key-prod_fake_bd32301385130a0bafe030c', // stripeSecret: 'sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm', - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- // /\ OR, to avoid checking them in to version control, you might opt to // || set sensitive credentials like these using environment variables. // @@ -387,10 +363,8 @@ module.exports = { // sails_custom__mailgunSecret=key-prod_fake_bd32301385130a0bafe030c // sails_custom__stripeSecret=sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm // ``` - //-------------------------------------------------------------------------- - - }, - + // -------------------------------------------------------------------------- + } }; diff --git a/examples/sails/config/globals.js b/examples/sails/config/globals.js index f63701f9..14b9059e 100644 --- a/examples/sails/config/globals.js +++ b/examples/sails/config/globals.js @@ -47,6 +47,6 @@ module.exports.globals = { * * ****************************************************************************/ - sails: true, + sails: true }; diff --git a/examples/sails/config/http.js b/examples/sails/config/http.js index 3cf438f1..32b1ae6c 100644 --- a/examples/sails/config/http.js +++ b/examples/sails/config/http.js @@ -40,7 +40,6 @@ module.exports.http = { // 'favicon', // ], - /*************************************************************************** * * * The body parser that will handle incoming multipart HTTP requests. * @@ -55,6 +54,6 @@ module.exports.http = { // return middlewareFn; // })(), - }, + } }; diff --git a/examples/sails/config/i18n.js b/examples/sails/config/i18n.js index 0b652d26..6c06bb9c 100644 --- a/examples/sails/config/i18n.js +++ b/examples/sails/config/i18n.js @@ -20,7 +20,7 @@ module.exports.i18n = { * * ***************************************************************************/ - locales: ['en', 'es', 'fr', 'de'], + locales: ['en', 'es', 'fr', 'de'] /**************************************************************************** * * diff --git a/examples/sails/config/models.js b/examples/sails/config/models.js index b6822839..7dcbf589 100644 --- a/examples/sails/config/models.js +++ b/examples/sails/config/models.js @@ -15,7 +15,6 @@ module.exports.models = { - /*************************************************************************** * * * Whether model methods like `.create()` and `.update()` should ignore * @@ -37,7 +36,6 @@ module.exports.models = { // schema: true, - /*************************************************************************** * * * How and whether Sails will attempt to automatically rebuild the * @@ -55,7 +53,6 @@ module.exports.models = { // migrate: 'alter', - /*************************************************************************** * * * Base attributes that are included in all of your models by default. * @@ -69,10 +66,10 @@ module.exports.models = { ***************************************************************************/ attributes: { - createdAt: { type: 'number', autoCreatedAt: true, }, - updatedAt: { type: 'number', autoUpdatedAt: true, }, - id: { type: 'number', autoIncrement: true, }, - //-------------------------------------------------------------------------- + createdAt: { type: 'number', autoCreatedAt: true }, + updatedAt: { type: 'number', autoUpdatedAt: true }, + id: { type: 'number', autoIncrement: true } + // -------------------------------------------------------------------------- // /\ Using MongoDB? // || Replace `id` above with this instead: // @@ -82,10 +79,9 @@ module.exports.models = { // // Plus, don't forget to configure MongoDB as your default datastore: // https://sailsjs.com/docs/tutorials/using-mongo-db - //-------------------------------------------------------------------------- + // -------------------------------------------------------------------------- }, - /****************************************************************************** * * * The set of DEKs (data encryption keys) for at-rest encryption. * @@ -104,7 +100,6 @@ module.exports.models = { default: 'Xtm/TmTbBlH12Cz06FdLaBtQJ5gKWu5TimN3SN2G4Y4=' }, - /*************************************************************************** * * * Whether or not implicit records for associations should be cleaned up * @@ -120,5 +115,4 @@ module.exports.models = { cascadeOnDestroy: true - }; diff --git a/examples/sails/config/routes.js b/examples/sails/config/routes.js index 14155b08..c18dbc25 100644 --- a/examples/sails/config/routes.js +++ b/examples/sails/config/routes.js @@ -19,8 +19,7 @@ module.exports.routes = { * * ***************************************************************************/ - '/': { view: 'pages/homepage' }, - + '/': { view: 'pages/homepage' } /*************************************************************************** * * @@ -33,5 +32,4 @@ module.exports.routes = { * * ***************************************************************************/ - }; diff --git a/examples/sails/config/security.js b/examples/sails/config/security.js index bd576316..3b5d0932 100644 --- a/examples/sails/config/security.js +++ b/examples/sails/config/security.js @@ -34,7 +34,6 @@ module.exports.security = { // allowCredentials: false, // }, - /**************************************************************************** * * * By default, Sails' built-in CSRF protection is disabled to facilitate * diff --git a/examples/sails/config/session.js b/examples/sails/config/session.js index c7889db9..f47ccc05 100644 --- a/examples/sails/config/session.js +++ b/examples/sails/config/session.js @@ -18,8 +18,7 @@ module.exports.session = { * of your users, forcing them to log in again. * * * ***************************************************************************/ - secret: '376d0bc170222302c2b8898ec7e19fa7', - + secret: '376d0bc170222302c2b8898ec7e19fa7' /*************************************************************************** * * diff --git a/examples/sails/config/sockets.js b/examples/sails/config/sockets.js index 9f466a04..3647f052 100644 --- a/examples/sails/config/sockets.js +++ b/examples/sails/config/sockets.js @@ -29,7 +29,6 @@ module.exports.sockets = { // transports: [ 'websocket' ], - /*************************************************************************** * * * `beforeConnect` * @@ -50,7 +49,6 @@ module.exports.sockets = { // // }, - /*************************************************************************** * * * `afterDisconnect` * @@ -68,7 +66,6 @@ module.exports.sockets = { // // }, - /*************************************************************************** * * * Whether to expose a 'GET /__getcookie' route that sets an HTTP-only * @@ -78,5 +75,4 @@ module.exports.sockets = { // grant3rdPartyCookie: true, - }; diff --git a/examples/sails/scripts/local.js b/examples/sails/scripts/local.js index 49f53d20..948555cf 100644 --- a/examples/sails/scripts/local.js +++ b/examples/sails/scripts/local.js @@ -1,31 +1,31 @@ -const lambdaFunction = require('../lambda.js') -const apiGatewayEvent = require('../api-gateway-event.json') +const lambdaFunction = require('../lambda.js'); +const apiGatewayEvent = require('../api-gateway-event.json'); const context = { succeed: v => { - console.info(v) - process.exit(0) + console.info(v); + process.exit(0); } -} +}; const callback = (e, v) => { - if (e) console.error(e) - if (v) console.info(v) - process.exit(0) -} -const server = lambdaFunction.handler(apiGatewayEvent, context, callback) + if (e) console.error(e); + if (v) console.info(v); + process.exit(0); +}; +const server = lambdaFunction.handler(apiGatewayEvent, context, callback); -process.stdin.resume() +process.stdin.resume(); -function exitHandler(options, err) { +function exitHandler (options, err) { if (options.cleanup && server && server.close) { - server.close() + server.close(); } - if (err) console.error(err.stack) - if (options.exit) process.exit() + if (err) console.error(err.stack); + if (options.exit) process.exit(); } -process.on('exit', exitHandler.bind(null, { cleanup: true })) -process.on('SIGINT', exitHandler.bind(null, { exit: true })) // ctrl+c event -process.on('SIGTSTP', exitHandler.bind(null, { exit: true })) // ctrl+v event -process.on('uncaughtException', exitHandler.bind(null, { exit: true })) +process.on('exit', exitHandler.bind(null, { cleanup: true })); +process.on('SIGINT', exitHandler.bind(null, { exit: true })); // ctrl+c event +process.on('SIGTSTP', exitHandler.bind(null, { exit: true })); // ctrl+v event +process.on('uncaughtException', exitHandler.bind(null, { exit: true })); diff --git a/examples/sails/tasks/config/babel.js b/examples/sails/tasks/config/babel.js index c9720a1b..c9bdbbea 100644 --- a/examples/sails/tasks/config/babel.js +++ b/examples/sails/tasks/config/babel.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/babel.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('babel', { dist: { options: { @@ -50,5 +49,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-babel'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/clean.js b/examples/sails/tasks/config/clean.js index a267b8df..0bebe9f5 100644 --- a/examples/sails/tasks/config/clean.js +++ b/examples/sails/tasks/config/clean.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/clean.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('clean', { dev: ['.tmp/public/**'], build: ['www'], @@ -48,5 +47,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-clean'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/concat.js b/examples/sails/tasks/config/concat.js index 4a3530ce..58c9ae62 100644 --- a/examples/sails/tasks/config/concat.js +++ b/examples/sails/tasks/config/concat.js @@ -10,8 +10,7 @@ * https://sailsjs.com/anatomy/tasks/config/concat.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('concat', { js: { src: require('../pipeline').jsFilesToInject, @@ -46,5 +45,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-concat'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/copy.js b/examples/sails/tasks/config/copy.js index f06c50b7..7f03d49f 100644 --- a/examples/sails/tasks/config/copy.js +++ b/examples/sails/tasks/config/copy.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/copy.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('copy', { dev: { files: [{ @@ -35,7 +34,7 @@ module.exports = function(grunt) { src: ['**/*'], dest: '.tmp/public/dist' }] - }, + } }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -61,5 +60,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-copy'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/cssmin.js b/examples/sails/tasks/config/cssmin.js index e3f3edf5..1925e1c9 100644 --- a/examples/sails/tasks/config/cssmin.js +++ b/examples/sails/tasks/config/cssmin.js @@ -11,8 +11,7 @@ * https://sailsjs.com/anatomy/tasks/config/cssmin.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('cssmin', { dist: { src: ['.tmp/public/concat/production.css'], @@ -43,5 +42,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-cssmin'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/hash.js b/examples/sails/tasks/config/hash.js index 41435ac8..31dae191 100644 --- a/examples/sails/tasks/config/hash.js +++ b/examples/sails/tasks/config/hash.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/hash.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('hash', { options: { mapping: '', @@ -18,9 +17,9 @@ module.exports = function(grunt) { destBasePath: '', flatten: false, hashLength: 8, - hashFunction: function(source, encoding){ + hashFunction: function (source, encoding) { if (!source || !encoding) { - throw new Error('Consistency violation: Cannot compute unique hash for production .css/.js cache-busting suffix, because `source` and/or `encoding` are falsey-- but they should be truthy strings! Here they are, respectively:\nsource: '+require('util').inspect(source, {depth:null})+'\nencoding: '+require('util').inspect(encoding, {depth:null})); + throw new Error('Consistency violation: Cannot compute unique hash for production .css/.js cache-busting suffix, because `source` and/or `encoding` are falsey-- but they should be truthy strings! Here they are, respectively:\nsource: ' + require('util').inspect(source, { depth: null }) + '\nencoding: ' + require('util').inspect(encoding, { depth: null })); } return require('crypto').createHash('sha1').update(source, encoding).digest('hex'); } @@ -58,5 +57,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-hash'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/less.js b/examples/sails/tasks/config/less.js index 06e3a080..be17df0f 100644 --- a/examples/sails/tasks/config/less.js +++ b/examples/sails/tasks/config/less.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/less.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('less', { dev: { files: [{ @@ -46,5 +45,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-less'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/sails-linker.js b/examples/sails/tasks/config/sails-linker.js index c197efbf..eec25e44 100644 --- a/examples/sails/tasks/config/sails-linker.js +++ b/examples/sails/tasks/config/sails-linker.js @@ -11,11 +11,9 @@ * https://sailsjs.com/anatomy/tasks/config/sails-linker.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('sails-linker', { - // ╦╔═╗╦ ╦╔═╗╔═╗╔═╗╦═╗╦╔═╗╔╦╗ // ║╠═╣╚╗╔╝╠═╣╚═╗║ ╠╦╝║╠═╝ ║ // ╚╝╩ ╩ ╚╝ ╩ ╩╚═╝╚═╝╩╚═╩╩ ╩ @@ -41,7 +39,7 @@ module.exports = function(grunt) { startTag: '', endTag: '', fileTmpl: '', - appRoot: '.tmp/public', + appRoot: '.tmp/public' // relative: true // ^^ Uncomment this if compiling assets for use in PhoneGap, CDN, etc. // (but be note that this can break custom font URLs) @@ -72,7 +70,7 @@ module.exports = function(grunt) { startTag: '', endTag: '', fileTmpl: '', - appRoot: '.tmp/public', + appRoot: '.tmp/public' // relative: true // ^^ Uncomment this if compiling assets for use in PhoneGap, CDN, etc. // (but be note that this can break custom font URLs) @@ -84,7 +82,6 @@ module.exports = function(grunt) { } }, - // ╔═╗╔╦╗╦ ╦╦ ╔═╗╔═╗╦ ╦╔═╗╔═╗╔╦╗╔═╗ // ╚═╗ ║ ╚╦╝║ ║╣ ╚═╗╠═╣║╣ ║╣ ║ ╚═╗ // ╚═╝ ╩ ╩ ╩═╝╚═╝╚═╝╩ ╩╚═╝╚═╝ ╩ ╚═╝ @@ -111,7 +108,7 @@ module.exports = function(grunt) { startTag: '', endTag: '', fileTmpl: '', - appRoot: '.tmp/public', + appRoot: '.tmp/public' // relative: true // ^^ Uncomment this if compiling assets for use in PhoneGap, CDN, etc. // (but be note that this can break custom font URLs) @@ -143,7 +140,7 @@ module.exports = function(grunt) { startTag: '', endTag: '', fileTmpl: '', - appRoot: '.tmp/public', + appRoot: '.tmp/public' // relative: true // ^^ Uncomment this if compiling assets for use in PhoneGap, CDN, etc. // (but be note that this can break custom font URLs) @@ -153,9 +150,9 @@ module.exports = function(grunt) { 'views/**/*.html': ['.tmp/public/dist/*.css'], 'views/**/*.ejs': ['.tmp/public/dist/*.css'] } - }, + } - });// + });// // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // This Grunt plugin is part of the default asset pipeline in Sails, @@ -180,5 +177,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-sails-linker'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/sync.js b/examples/sails/tasks/config/sync.js index 23ff3b87..c3514896 100644 --- a/examples/sails/tasks/config/sync.js +++ b/examples/sails/tasks/config/sync.js @@ -10,8 +10,7 @@ * https://sailsjs.com/anatomy/tasks/config/sync.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('sync', { dev: { files: [{ @@ -45,5 +44,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-sync'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/config/uglify.js b/examples/sails/tasks/config/uglify.js index 34f591c7..15f4a22e 100644 --- a/examples/sails/tasks/config/uglify.js +++ b/examples/sails/tasks/config/uglify.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/uglify.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('uglify', { dist: { src: ['.tmp/public/concat/production.js'], @@ -26,7 +25,7 @@ module.exports = function(grunt) { 'FileList', 'FormData', 'Location', - 'RttcRefPlaceholder', + 'RttcRefPlaceholder' ], keep_fnames: true//eslint-disable-line }, @@ -59,6 +58,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-uglify'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; - diff --git a/examples/sails/tasks/config/watch.js b/examples/sails/tasks/config/watch.js index 611e2977..fc861c55 100644 --- a/examples/sails/tasks/config/watch.js +++ b/examples/sails/tasks/config/watch.js @@ -9,8 +9,7 @@ * https://sailsjs.com/anatomy/tasks/config/watch.js * */ -module.exports = function(grunt) { - +module.exports = function (grunt) { grunt.config.set('watch', { assets: { @@ -52,5 +51,4 @@ module.exports = function(grunt) { // grunt.loadNpmTasks('grunt-contrib-watch'); // ``` // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; diff --git a/examples/sails/tasks/pipeline.js b/examples/sails/tasks/pipeline.js index 65047d7f..c191defc 100644 --- a/examples/sails/tasks/pipeline.js +++ b/examples/sails/tasks/pipeline.js @@ -10,8 +10,6 @@ * https://sailsjs.com/anatomy/tasks/pipeline.js */ - - // ██████╗ ██╗ █████╗ ██╗███╗ ██╗ ██████╗███████╗███████╗ // ██╔══██╗██║ ██╔══██╗██║████╗ ██║ ██╔════╝██╔════╝██╔════╝ // ██████╔╝██║ ███████║██║██╔██╗ ██║ ██║ ███████╗███████╗ @@ -31,7 +29,7 @@ // > Note: if you're using built-in LESS support with default settings, // > you'll want to change `assets/styles/importer.less` instead. // -var cssFilesToInject = [ +const cssFilesToInject = [ // Bring in `.css` files for themes and style guides (e.g. Bootstrap, Foundation) 'dependencies/**/*.css', @@ -42,7 +40,6 @@ var cssFilesToInject = [ 'styles/**/*.css' ]; - // ██████╗██╗ ██╗███████╗███╗ ██╗████████╗ ███████╗██╗██████╗ ███████╗ // ██╔════╝██║ ██║██╔════╝████╗ ██║╚══██╔══╝ ██╔════╝██║██╔══██╗██╔════╝ // ██║ ██║ ██║█████╗ ██╔██╗ ██║ ██║█████╗███████╗██║██║ ██║█████╗ @@ -59,7 +56,7 @@ var cssFilesToInject = [ // // Client-side javascript files to inject as