Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove dependency shelljs #83

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"lint-staged": "^12.1.2",
"memfs": "^3.4.0",
"mocha": "^9.1.3",
"shelljs": "^0.8.4",
"sinon": "^12.0.1",
"yorkie": "^2.0.0"
},
Expand Down
16 changes: 8 additions & 8 deletions tests/init/config-initializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// Requirements
//------------------------------------------------------------------------------

import fsp from "node:fs/promises";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're rewriting it in another PR, and this file will be removed.

I can remove shelljs in that PR, thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍🏻 It looks like shelljs isn't used at all in that branch, so you could simply remove the package.json dependency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 4602713.

import chai from "chai";
import fs from "fs";
import path from "path";
import sinon from "sinon";
import sh from "shelljs";
import esmock from "esmock";
import { fileURLToPath } from "url";
import * as npmUtils from "../../lib/init/npm-utils.js";
Expand Down Expand Up @@ -65,15 +65,15 @@ describe("configInitializer", () => {


// copy into clean area so as not to get "infected" by this project's .eslintrc files
before(() => {
before(async () => {
const __filename = fileURLToPath(import.meta.url); // eslint-disable-line no-underscore-dangle -- Conventional

fixtureDir = path.join(__filename, "../../../tmp/eslint/fixtures/config-initializer");
localInstalledEslintDir = path.join(fixtureDir, "./node_modules/eslint");
sh.mkdir("-p", localInstalledEslintDir);
sh.cp("-r", "./tests/fixtures/config-initializer/.", fixtureDir);
sh.cp("-r", "./tests/fixtures/eslint/.", localInstalledEslintDir);
fixtureDir = fs.realpathSync(fixtureDir);
await fsp.mkdir(localInstalledEslintDir, { recursive: true });
await fsp.cp("./tests/fixtures/config-initializer/.", fixtureDir, { recursive: true });
await fsp.cp("./tests/fixtures/eslint/.", localInstalledEslintDir, { recursive: true });
fixtureDir = await fsp.realpath(fixtureDir);
});

beforeEach(async () => {
Expand Down Expand Up @@ -115,8 +115,8 @@ describe("configInitializer", () => {
npmFetchPeerDependenciesStub.resetHistory();
});

after(() => {
sh.rm("-r", fixtureDir);
after(async () => {
await fsp.rm(path.join(fixtureDir, "../../.."), { recursive: true });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also remove "tmp" in the current directory, not just "tmp/eslint/fixtures/config-initializer".

});

describe("processAnswers()", () => {
Expand Down
Loading