-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Closed as not planned
Copy link
Labels
awaiting responseIssues waiting for a reply from the OP or another partyIssues waiting for a reply from the OP or another partybugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
export function someDemoFunction(
styleDictionary: DeepReadonly<StyleDictionary.Core>,
name: string,
): Named<SomeGroup> {
return someOtherFunction(
{
name: `demo/${name}`,
someObject: styleDictionary.someGroup[name],
}
);
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/prefer-readonly-parameter-types": [
"error",
{ ignoreInferredTypes: true },
],
},
};
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#L59
ts-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
Metadata
Metadata
Assignees
Labels
awaiting responseIssues waiting for a reply from the OP or another partyIssues waiting for a reply from the OP or another partybugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin