Skip to content

Commit 50f95b3

Browse files
committed
refactor: remove supports-color
1 parent 659c85c commit 50f95b3

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

bin/lint-staged.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import fs from 'node:fs'
44
import path from 'node:path'
55
import { fileURLToPath } from 'node:url'
66

7+
import { isColorSupported } from 'colorette'
78
import { Option, program } from 'commander'
89
import debug from 'debug'
9-
import supportsColor from 'supports-color'
1010

1111
import lintStaged from '../lib/index.js'
1212
import { CONFIG_STDIN_ERROR } from '../lib/messages.js'
1313

1414
// Force colors for packages that depend on https://www.npmjs.com/package/supports-color
15-
if (supportsColor.stdout) {
16-
process.env.FORCE_COLOR = supportsColor.stdout.level.toString()
15+
if (isColorSupported) {
16+
process.env.FORCE_COLOR = '1'
1717
}
1818

1919
// Do not terminate main Listr process on SIGINT

package-lock.json

-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"object-inspect": "^1.12.2",
4545
"pidtree": "^0.5.0",
4646
"string-argv": "^0.3.1",
47-
"supports-color": "^9.2.2",
4847
"yaml": "^2.1.1"
4948
},
5049
"devDependencies": {

0 commit comments

Comments
 (0)