10000 docs: from option instead of source in prefer-readonly-parameter-type… · yeonjuan/typescript-eslint@e7ec6f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7ec6f0

Browse files
authored
docs: from option instead of source in prefer-readonly-parameter-types (typescript-eslint#8461)
Update prefer-readonly-parameter-types.md
1 parent 46cef96 commit e7ec6f0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ Examples of code for this rule with:
150150
{
151151
"allow": [
152152
"$",
153-
{ "source": "file", "name": "Foo" },
154-
{ "source": "lib", "name": "HTMLElement" },
153+
{ "from": "file", "name": "Foo" },
154+
{ "from": "lib", "name": "HTMLElement" },
155155
{ "from": "package", "name": "Bar", "package": "bar-lib" }
156156
]
157157
}
@@ -161,7 +161,7 @@ Examples of code for this rule with:
161161

162162
#### ❌ Incorrect
163163

164-
```ts option='{"allow":["$",{"source":"file","name":"Foo"},{"source":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
164+
```ts option='{"allow":["$",{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
165165
interface ThisIsMutable {
166166
prop: string;
167167
}
@@ -185,7 +185,7 @@ function fn2(arg: Wrapper) {}
185185
function fn3(arg: WrapperWithOther) {}
186186
```
187187

188-
```ts option='{"allow":["$",{"source":"file","name":"Foo"},{"source":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
188+
```ts option='{"allow":["$",{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
189189
import { Foo } from 'some-lib';
190190
import { Bar } from 'incorrect-lib';
191191

@@ -205,7 +205,7 @@ function fn3(arg: Bar) {}
205205

206206
#### ✅ Correct
207207

208-
```ts option='{"allow":["$",{"source":"file","name":"Foo"},{"source":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
208+
```ts option='{"allow":["$",{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
209209
interface Foo {
210210
prop: string;
211211
}
@@ -222,7 +222,7 @@ function fn1(arg: Foo) {}
222222
function fn2(arg: Wrapper) {}
223223
```
224224

225-
```ts option='{"allow":["$",{"source":"file","name":"Foo"},{"source":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
225+
```ts option='{"allow":["$",{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
226226
import { Bar } from 'bar-lib';
227227

228228
interface Foo {
@@ -239,7 +239,7 @@ function fn2(arg: HTMLElement) {}
239239
function fn3(arg: Bar) {}
240240
```
241241

242-
```ts option='{"allow":["$",{"source":"file","name":"Foo"},{"source":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
242+
```ts option='{"allow":["$",{"from":"file","name":"Foo"},{"from":"lib","name":"HTMLElement"},{"from":"package","name":"Bar","package":"bar-lib"}]}'
243243
import { Foo } from './foo';
244244

245245
// Works because Foo is still a local type - it has to be in the same package

0 commit comments

Comments
 (0)
0