Closed rseiffert closed 8 months ago
@rseiffert Thanks for opening that, currently TS typings are prepared externally, and I was not involved into their preparation (I'm not even sure of their state).
If issue is specific to TS typings I'll be happy to accept a PR that accomodates proper TS typings in context of this repository (in similar manner as it was done here: https://github.com/medikoo/type/pull/6). However if issue is in plain JS layer (not TS involved) I'll be grateful for some reproduction case.
@medikoo I'm afraid that this is not really a Typescript problem, as I suspected. I just tried it in a pure JavaScript based Node project.
Here is a really complicated example code ;-)
const clc = require("cli-color");
console.info(clc.bgGreen.yellow('Warming up..............................'));
console.info(clc.red('Warming up..............................'));
Unfortunately, I now also see warnings for not-mixed usages
Unresolved variable bgGreen
Unresolved function or method yellow()
Unresolved function or method red()
IDE is IntelliJ IDEA 2023.3.5
@rseiffert neither JavaScript engine (V8) nor Node.js produces such messages.
It's definitely related to some extra tooling which probably tries to rely on TS typings.
See how it works in Node.js v20:
First of all: Thank you for your quick answers!
I think it has something to do with the config of my intelliJ IDE. The warnings are not visible if i run the code, but the warnings show up in the IDE in the so called Problems view.
So feel free to close my issue
If styles are mixed like in this example
console.log(clc.red.bgWhite("Red text on white background."));
I am seeing a minor warningUnresolved function or method bgWhite()
This happens in a Typescript Project.
node: 21.7.1 cli-color: 2.0.4 @types/cli-color: 2.0.6