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

prefer-immutable-types causes ESLint to crash on matrices

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

説明

```ts
const myFunction = (x: number[][]): string => {
return 0;
};
```

Causes the rule to crash:

```
Oops! Something went wrong! :(

ESLint: 8.56.0

RangeError: Maximum call stack size exceeded
Occurred while linting .../src/index.ts:1
Rule: "functional/prefer-immutable-types"
at TypeObject.hasOwn ()
at Function.hasOwn ()
at isTypeNode (.../is-immutable-type/dist/index.cjs:287:19)
at .../is-immutable-type/dist/index.cjs:246:30
at Array.map ()
at typeArgumentsToString (.../is-immutable-type/dist/index.cjs:245:47)
at TypeName.getNameWithArguments (.../is-immutable-type/dist/index.cjs:171:54)
at .../is-immutable-type/dist/index.cjs:253:26
at Array.map ()
at typeArgumentsToString (.../node_modules/is-immutable-type/dist/index.cjs:245:47)
```

While it doesn't crash with a single-depth array `number[]`

```ts
const myFunction = (x: number[]): string => {
return 0;
};
```

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

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

評価

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

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

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