Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Nov 6, 2023
1 parent f4ed1a6 commit e3ab365
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
16 changes: 1 addition & 15 deletions tests/lib/eslint/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2404,21 +2404,7 @@ describe("ESLint", () => {
*/
function deleteCacheDir() {
try {

/*
* `fs.rmdir(path, { recursive: true })` is deprecated and will be removed.
* Use `fs.rm(path, { recursive: true })` instead.
* When supporting Node.js 14.14.0+, the compatibility condition can be removed for `fs.rmdir`.
*/
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- just checking if it exists
if (typeof fs.rm === "function") {

// eslint-disable-next-line n/no-unsupported-features/node-builtins -- conditionally used
fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} else {
fs.rmdirSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
}

fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} catch {

/*
Expand Down
16 changes: 1 addition & 15 deletions tests/lib/eslint/flat-eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2300,21 +2300,7 @@ describe("FlatESLint", () => {
*/
function deleteCacheDir() {
try {

/*
* `fs.rmdir(path, { recursive: true })` is deprecated and will be removed.
* Use `fs.rm(path, { recursive: true })` instead.
* When supporting Node.js 14.14.0+, the compatibility condition can be removed for `fs.rmdir`.
*/
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- just checking if it exists
if (typeof fs.rm === "function") {

// eslint-disable-next-line n/no-unsupported-features/node-builtins -- conditionally used
fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} else {
fs.rmdirSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
}

fs.rmSync(path.resolve(cwd, "tmp/.cacheFileDir/"), { recursive: true, force: true });
} catch {

/*
Expand Down

0 comments on commit e3ab365

Please sign in to comment.