From 11f1e1c14be50711e692f4f61fa360ba7b00ca1f Mon Sep 17 00:00:00 2001 From: AngelaLu Date: Fri, 22 Jan 2021 21:05:36 -0800 Subject: [PATCH 1/5] change fsaccess back to existsSync --- src/init.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/init.js b/src/init.js index 2e1c2ef13..160757eab 100644 --- a/src/init.js +++ b/src/init.js @@ -68,7 +68,8 @@ module.exports = async function initHandler(argv) { async function asyncPackageInit() { // use existing package.json if found - const hasPackage = await fs.access('package.json'); + // eslint-disable-next-line node/no-sync + const hasPackage = fs.existsSync('package.json'); if (hasPackage) { @@ -90,7 +91,8 @@ async function asyncPackageInit() { } // exit if yarn.lock is found, or we'll be in trouble - const usesYarn = await fs.access('yarn.lock'); + // eslint-disable-next-line node/no-sync + const usesYarn = fs.existsSync('yarn.lock'); if (usesYarn) { logError( From 53310d2fb4ec49ff3356c15226ec2753778b1685 Mon Sep 17 00:00:00 2001 From: AngelaLu Date: Sun, 24 Jan 2021 17:37:09 -0800 Subject: [PATCH 2/5] import existsSync --- src/init.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init.js b/src/init.js index 160757eab..0e7e6b044 100644 --- a/src/init.js +++ b/src/init.js @@ -1,5 +1,5 @@ -const { promises: fs } = require('fs'); +const { promises: fs, existsSync } = require('fs'); const pathUtils = require('path'); const packageInit = require('init-package-json'); @@ -69,7 +69,7 @@ async function asyncPackageInit() { // use existing package.json if found // eslint-disable-next-line node/no-sync - const hasPackage = fs.existsSync('package.json'); + const hasPackage = existsSync('package.json'); if (hasPackage) { @@ -92,7 +92,7 @@ async function asyncPackageInit() { // exit if yarn.lock is found, or we'll be in trouble // eslint-disable-next-line node/no-sync - const usesYarn = fs.existsSync('yarn.lock'); + const usesYarn = existsSync('yarn.lock'); if (usesYarn) { logError( From f3017d4fe5e0b42e3a98daadf853f4b8538638fc Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 25 Jan 2021 00:14:01 -0800 Subject: [PATCH 3/5] Remove unnecessary eslint comment --- src/init.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/init.js b/src/init.js index 0e7e6b044..5dff34122 100644 --- a/src/init.js +++ b/src/init.js @@ -68,7 +68,6 @@ module.exports = async function initHandler(argv) { async function asyncPackageInit() { // use existing package.json if found - // eslint-disable-next-line node/no-sync const hasPackage = existsSync('package.json'); if (hasPackage) { From 7b4e8e89f6a558127e1268bc2b3182d4f57ee60c Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 25 Jan 2021 00:14:22 -0800 Subject: [PATCH 4/5] Remove unnecessary eslint comment --- src/init.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/init.js b/src/init.js index 5dff34122..b29aa117d 100644 --- a/src/init.js +++ b/src/init.js @@ -90,7 +90,6 @@ async function asyncPackageInit() { } // exit if yarn.lock is found, or we'll be in trouble - // eslint-disable-next-line node/no-sync const usesYarn = existsSync('yarn.lock'); if (usesYarn) { From d6d8d348b15dd0b51d851dc435223899eb1def92 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 25 Jan 2021 00:14:32 -0800 Subject: [PATCH 5/5] Update src/init.js --- src/init.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/init.js b/src/init.js index b29aa117d..311dc88c4 100644 --- a/src/init.js +++ b/src/init.js @@ -1,4 +1,3 @@ - const { promises: fs, existsSync } = require('fs'); const pathUtils = require('path'); const packageInit = require('init-package-json');