agiledigital-labs / agiledigital-labs/eslint-plugin-total-functions
no-unsafe-readonly-mutable-assignment failing to identify a ReadonlyShallow correctly
- Ngôn ngữ chính
- TypeScript
- Star
- 92
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
This is working:
```ts
type Thing = { a: string };
type OtherThing = { readonly a: string };
// This is correctly inferred to be ReadonlyShallow
type ThingArray = readonly Thing[];
// This is correctly inferred to be ReadonlyDeep
type OtherThingArray = readonly OtherThing[];
// ReadonlyDeep
declare const a: OtherThingArray;
// Flagged (ReadonlyDeep -> ReadonlyShallow)
const b: ThingArray = a;
```
But this isn't:
```ts
type Thing = { a: string };
type OtherThing = { readonly a: string };
// ReadonlyDeep
declare const a: readonly OtherThing[];
// Not flagged (it thinks readonly Thing[] is ReadonlyDeep when it should be ReadonlyShallow)
const b: readonly Thing[] = a;
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.