-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
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
interface ViewStyle { field1: number }
type Falsy = undefined | null | false | '';
interface RecursiveArray<T>
extends Array<T | ReadonlyArray<T> | RecursiveArray<T>> { }
type RegisteredStyle<T> = number & { __registeredStyleBrand: T };
type StyleProp<T> =
| T
| RegisteredStyle<T>
| RecursiveArray<T | RegisteredStyle<T> | Falsy>
| Falsy;
const ff = (
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
Expected Result
I expected ESLint won't issue Parameter should be a read only type for StyleProp<ViewStyle>.
Actual Result
ESLiint issued Parameter should be a read only type for StyleProp<ViewStyle> until I changed my allow option to be
allow: [
{
from: 'file',
name: ['RecursiveArray', 'RegisteredStyle', 'ViewStyle']
}
]
Additional Info
StyleProp and ViewStyle are types / interfaces from react-native.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
{ "compilerOptions": { // ... } }