From fcc79346106d74cbf04fea9a43e0f97b85b5edbc Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 5 Sep 2019 18:34:41 +0200 Subject: [PATCH] fix lint errors --- lib/module.js | 4 ++-- test/_utils.js | 4 ++-- test/fixture/api.js | 2 +- test/fixture/store/index.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/module.js b/lib/module.js index 2f2985f..5f5fb3d 100755 --- a/lib/module.js +++ b/lib/module.js @@ -4,7 +4,7 @@ const semver = require('semver') const logger = consola.withScope('nuxt:http') -function httpModule(_moduleOptions) { +function httpModule (_moduleOptions) { // Combine options const moduleOptions = { ...this.options.http, ..._moduleOptions } @@ -72,7 +72,7 @@ function httpModule(_moduleOptions) { // Convert http:// to https:// if https option is on if (options.https === true) { - const https = s => s.indexOf('//localhost:') > -1 ? s : s.replace('http://', 'https://') + const https = s => s.includes('//localhost:') ? s : s.replace('http://', 'https://') options.baseURL = https(options.baseURL) options.browserBaseURL = https(options.browserBaseURL) } diff --git a/test/_utils.js b/test/_utils.js index de18128..9a17688 100644 --- a/test/_utils.js +++ b/test/_utils.js @@ -4,7 +4,7 @@ const defaultConfig = require('./fixture/nuxt.config') jest.setTimeout(60000) -async function setupMockNuxt(config) { +async function setupMockNuxt (config) { const nuxt = new Nuxt({ ...defaultConfig, ...config, @@ -24,7 +24,7 @@ async function setupMockNuxt(config) { return nuxt } -async function setupNuxt(config) { +async function setupNuxt (config) { const nuxt = new Nuxt({ ...defaultConfig, ...config, diff --git a/test/fixture/api.js b/test/fixture/api.js index 1cb21ae..0767e31 100644 --- a/test/fixture/api.js +++ b/test/fixture/api.js @@ -1,6 +1,6 @@ module.exports = { path: '/test_api', - handler(req, res) { + handler (req, res) { res.end(JSON.stringify({ url: req.url, method: req.method diff --git a/test/fixture/store/index.js b/test/fixture/store/index.js index e3a41de..485ad3a 100644 --- a/test/fixture/store/index.js +++ b/test/fixture/store/index.js @@ -1,6 +1,6 @@ export default { actions: { - nuxtServerInit({ commit }, ctx) { + nuxtServerInit ({ commit }, ctx) { if (!ctx.$http) { throw new Error('$http is not defined!') }