agiledigital-labs / agiledigital-labs/eslint-plugin-total-functions

no-unsafe-readonly-mutable-assignment failing to identify a ReadonlyShallow correctly

オープン
#745 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
92
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

説明

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;
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。