diff --git a/.eslintrc.js b/.eslintrc.js index 9eeb4cb1325..7dac0879994 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -32,7 +32,6 @@ module.exports = { 'promise/no-return-wrap': 0, 'promise/prefer-await-to-callbacks': 0, 'promise/prefer-await-to-then': 0, - 'you-dont-need-lodash-underscore/get': 0, 'unicorn/prefer-spread': 0, 'unicorn/consistent-destructuring': 0, 'unicorn/no-array-push-push': 0, diff --git a/src/commands/deploy.js b/src/commands/deploy.js index d00c2d01492..3ef29db0bbc 100644 --- a/src/commands/deploy.js +++ b/src/commands/deploy.js @@ -4,9 +4,8 @@ const process = require('process') const { flags: flagsLib } = require('@oclif/command') const chalk = require('chalk') const cliSpinnerNames = Object.keys(require('cli-spinners')) -const dotProp = require('dot-prop') +const { get } = require('dot-prop') const inquirer = require('inquirer') -const get = require('lodash/get') const isObject = require('lodash/isObject') const logSymbols = require('log-symbols') const ora = require('ora') @@ -193,7 +192,7 @@ const hasErrorMessage = (actual, expected) => { return false } -const getJsonErrorMessage = (error) => dotProp.get(error, 'json.message', '') +const getJsonErrorMessage = (error) => get(error, 'json.message', '') const reportDeployError = ({ error, warn, failAndExit }) => { switch (true) { diff --git a/src/commands/status/hooks.js b/src/commands/status/hooks.js index 12aa746ce9b..d0edd1d529b 100644 --- a/src/commands/status/hooks.js +++ b/src/commands/status/hooks.js @@ -1,4 +1,4 @@ -const get = require('lodash/get') +const { get } = require('dot-prop') const prettyjson = require('prettyjson') const Command = require('../../utils/command') diff --git a/src/commands/status/index.js b/src/commands/status/index.js index 317040ea7e7..d133b7398a1 100644 --- a/src/commands/status/index.js +++ b/src/commands/status/index.js @@ -1,7 +1,6 @@ const { flags: flagsLib } = require('@oclif/command') const chalk = require('chalk') const clean = require('clean-deep') -const get = require('lodash/get') const prettyjson = require('prettyjson') const Command = require('../../utils/command') @@ -31,8 +30,7 @@ class StatusCommand extends Command { let user try { - accounts = await api.listAccountsForUser() - user = await this.netlify.api.getCurrentUser() + ;[accounts, user] = await Promise.all([api.listAccountsForUser(), api.getCurrentUser()]) } catch (error) { if (error.status === 401) { this.error( @@ -43,11 +41,8 @@ class StatusCommand extends Command { const ghuser = this.netlify.globalConfig.get(`users.${current}.auth.github.user`) const accountData = { - Name: get(user, 'full_name'), - // 'Account slug': get(personal, 'slug'), - // 'Account id': get(personal, 'id'), - // Name: get(personal, 'billing_name'), - Email: get(user, 'email'), + Name: user.full_name, + Email: user.email, Github: ghuser, } const teamsData = {} diff --git a/src/utils/proxy.js b/src/utils/proxy.js index 809c084128e..877009aa02c 100644 --- a/src/utils/proxy.js +++ b/src/utils/proxy.js @@ -5,11 +5,11 @@ const { URL, URLSearchParams } = require('url') const contentType = require('content-type') const cookie = require('cookie') +const { get } = require('dot-prop') const httpProxy = require('http-proxy') const { createProxyMiddleware } = require('http-proxy-middleware') const jwtDecode = require('jwt-decode') const locatePath = require('locate-path') -const get = require('lodash/get') const isEmpty = require('lodash/isEmpty') const pFilter = require('p-filter') const toReadableStream = require('to-readable-stream')