Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
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 havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
interfaceViewStyle{field1:number}typeFalsy=undefined|null|false|'';interfaceRecursiveArray<T>extendsArray<T|ReadonlyArray<T>|RecursiveArray<T>>{}typeRegisteredStyle<T>=number&{__registeredStyleBrand:T};typeStyleProp<T>=|T|RegisteredStyle<T>|RecursiveArray<T|RegisteredStyle<T>|Falsy>|Falsy;constff=(arg1:ViewStyle,arg2:StyleProp<ViewStyle>):void=>{console.log(arg1,arg2)}
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/prefer-readonly-parameter-types":["error",{"allow":[{"from":"file","name":["StyleProp","ViewStyle"]}]}]},};
tsconfig
{"compilerOptions": {// ... }}Expected Result
I expected ESLint won't issueParameter should be a read only type forStyleProp<ViewStyle>.
Actual Result
ESLiint issuedParameter should be a read only type forStyleProp<ViewStyle> until I changed myallow option to be
allow: [ { from: 'file', name: ['RecursiveArray', 'RegisteredStyle', 'ViewStyle'] } ]Additional Info
StyleProp andViewStyle are types / interfaces fromreact-native.