現在以下のようなコードが有るのですが、eslint-typescriptに@typescript-eslint/no-namespace
と言われます。
typescript
1export class Foo { 2 foo1: string; 3 constructor(){ 4 this.foo1 = 'aaa'; 5 } 6} 7export namespace Foo { 8 export interface Bar { 9 isHoge?:boolean; 10 } 11}
new Foo()
したいしFoo.Bar
と書けるようにしたいのでこんな感じに書いているのですが、lintに怒られるということはあまり良くなさそうです。
typescript-eslint/no-namespace.md at master · typescript-eslint/typescript-eslint
をみるとdeclare module 'foo' {}
がどうのと書いているのですが、正直よくわかりません。
どうすればいいのでしょうか?

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。