- KY
The current types trigger the [@typescript-eslint/no-unsafe-assignment rule](https://github.com/typescript-eslint/typescript-eslint/blob/v3.4.0/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md).
I believe this change covers all cases.
- KY
Thanks for the super helpful project! π
- CC
# [Codecov](https://codecov.io/gh/lukeed/clsx/pull/22?src=pr&el=h1) Report > Merging [#22](https://codecov.io/gh/lukeed/clsx/pull/22?src=pr&el=desc) into [master](https://codecov.io/gh/lukeed/clsx/commit/c5b2b21ab8aea48ff0b48649f386a2c7280fabf2&el=desc) will **not change** coverage. > The diff coverage is `n/a`.
[](https://codecov.io/gh/lukeed/clsx/pull/22?src=pr&el=tree)
```diff @@ Coverage Diff @@ ## master #22 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 1 1 Lines 22 22 ========================================= Hits 22 22 ```
------
[Continue to review full report at Codecov](https://codecov.io/gh/lukeed/clsx/pull/22?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Ξ = absolute <relative> (impact)`, `ΓΈ = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/lukeed/clsx/pull/22?src=pr&el=footer). Last update [c5b2b21...b110995](https://codecov.io/gh/lukeed/clsx/pull/22?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
- LU
Thank you :)
Unfortunately I can't accept this. It is, in fact, any. It literally reacts to any data type and only makes a determination based on the truthiness of the value. Functions, dates, regexps, ...etc are all valid. I don't want to redefine all other TS types just to avoid an eslint rule.
Appreciate the consideration, but `any` _is_ a valid choice in some cases. (You also probably shouldn't be linting vendor/dependency code.)
Hope you understand π
- KY
Completely understand. π I'll find another way.
Thanks for the (very) quick and helpful response!
- LU
No problem!
You can provide custom types for `clsx` if you're unable to ignore node_modules. It's obviously not ideal, but you can copy/paste the definitions into `src/@types` or wherever and (re)declare the `clsx` module with your preferred types