Skip to content

Commit 671be63

Browse files
authored
Remove strip-ansi in favor of stripVTControlCharacters (#1188)
1 parent 5dd2bf1 commit 671be63

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

.changeset/thick-donkeys-flash.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/eslint-plugin/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@types/semver": "^7.5.8",
4141
"glob": "^10.4.5",
4242
"jest-file-snapshot": "^0.7.0",
43-
"strip-ansi": "^6.0.1",
4443
"typescript": "^5.7.2",
4544
"typescript-5.4": "npm:typescript@~5.4.0-0",
4645
"typescript-5.5": "npm:typescript@~5.5.0-0"

packages/eslint-plugin/test/eslint.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { ESLint, Linter } from "eslint";
22
import path from "path";
3-
import stripAnsi from "strip-ansi";
43
import { globSync } from "glob";
54
import { fixtureRoot } from "./util";
65
import { toMatchFile } from "jest-file-snapshot";
76
import * as plugin from "../src/index";
87
import fs from "fs";
98
import { normalizeSlashes } from "@definitelytyped/utils";
9+
import { stripVTControlCharacters } from "util";
1010

1111
expect.extend({ toMatchFile });
1212
const snapshotDir = path.join(__dirname, "__file_snapshots__");
@@ -40,7 +40,7 @@ for (const fixture of allFixtures) {
4040
}
4141
const formatter = await eslint.loadFormatter("stylish");
4242
const formatted = await formatter.format(results);
43-
const resultText = stripAnsi(formatted).trim() || "No errors";
43+
const resultText = stripVTControlCharacters(formatted).trim() || "No errors";
4444
expect(resultText).not.toContain("Parsing error");
4545
const newOutput = formatResultsWithInlineErrors(results);
4646
expect(normalizeSnapshot(resultText + "\n\n" + newOutput)).toMatchFile(getLintSnapshotPath(fixture));

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)