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

Restore previous FORCE_COLOR=0 behavior #16362

Merged
merged 2 commits into from Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/babel-code-frame/src/index.ts
@@ -1,7 +1,12 @@
import highlight, { shouldHighlight } from "@babel/highlight";

import colors, { createColors } from "picocolors";
import _colors, { createColors } from "picocolors";
import type { Colors, Formatter } from "picocolors/types";
// See https://github.com/alexeyraspopov/picocolors/issues/62
const colors =
typeof process === "object" && process.env.FORCE_COLOR === "0"
? createColors(false)
: _colors;

const compose: <T, U, V>(f: (gv: U) => V, g: (v: T) => U) => (v: T) => V =
(f, g) => v =>
Expand Down
7 changes: 6 additions & 1 deletion packages/babel-highlight/src/index.ts
Expand Up @@ -8,8 +8,13 @@ import {
isKeyword,
} from "@babel/helper-validator-identifier";

import colors, { createColors } from "picocolors";
import _colors, { createColors } from "picocolors";
import type { Colors, Formatter } from "picocolors/types";
// See https://github.com/alexeyraspopov/picocolors/issues/62
const colors =
typeof process === "object" && process.env.FORCE_COLOR === "0"
? createColors(false)
: _colors;

const compose: <T, U, V>(f: (gv: U) => V, g: (v: T) => U) => (v: T) => V =
(f, g) => v =>
Expand Down