-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bug: [prefer-readonly-parameter-types] Doesn't work on DeepReadonly
from ts-essentials
, utility-types
, and type-fest
#8932
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
Comments
DeepReadonly
from ts-essentials
and utility-types
DeepReadonly
from ts-essentials
, utility-types
, and type-fest
Also, how do I check which in |
Considering this requires a number of different dependencies to reproduce - could you please create an isolated reproduction repo with the required setup to reproduce? Either that or recreate the exact state in the playground. Note that our playground does not download dependencies so it cannot be run off imports. |
I was able to pinpoint the one data type that might have caused this error, which is
Here's my config for ESLint: Link (Go to |
If you can't repro in the playground - then likely your versions don't align. So update your deps. |
I just updated the version to 8.57.0, still getting the same error. |
Of eslint, sure, what about our packages? |
Thank you for pointing this out. I realized that our |
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.4.3&fileType=.tsx&code=JYWwDg9gTgLgBAbzgEQKarAJVQQwCYQB2ANgJ5wC%2BcAZlBCHAOQwDOAtKiy6oTMDsRaMA3AChRqAB6RYNAK6EAxnyJwW9VGhAQAYguXAiAClFw1MUsU3ADRHFFIAuFOiy4CJUgB4AyhavINiqE9qQAdADC0KgAfAA0pnAhIKjOLDBQwIQA5gkAlM4AcjgpeL4aAOJ0cmAxiIlQqDByUIRqGgDyMAAWqFB6SsEmZmYIiSNJJalwAAZ4qNoA9AAkCMmoFDMJE2bqKR0ARgBWqMpp-ta2IQ5he6hVEDUA2usAutsjFIl5Yl9AA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
There shouldn't be any
eslint
errors.Actual Result
Returns the following error for
styleDictionary: DeepReadonly<StyleDictionary.Core>
.34:3 error Parameter should be a read only type @typescript-eslint/prefer-readonly-parameter-types
Additional Info
Data types in
StyleDictionary.Core
: https://github.com/amzn/style-dictionary/blob/main/types/index.d.ts#L59ts-essentials DeepReadonly: https://github.com/ts-essentials/ts-essentials/blob/master/lib/deep-readonly/index.ts
utility-types DeepReadonly: https://github.com/piotrwitek/utility-types/blob/master/src/mapped-types.ts#L407
type-fest ReadonlyDeep (recommended in this issue): https://github.com/sindresorhus/type-fest/blob/main/source/readonly-deep.d.ts
The text was updated successfully, but these errors were encountered: