代码之家  ›  专栏  ›  技术社区  ›  Carl Patenaude Poulin

使用ES2015模块语法扩展全局对象

  •  0
  • Carl Patenaude Poulin  · 技术社区  · 3 年前

    我有以下声明用于使用新匹配器扩展Jest,它可以工作,但会触发lint @typescript-eslint/no-namespace :

    declare global {
      namespace jest {
        interface Matchers<R> {
          toHave: <K>(key: K) => R;
        }
      }
    }
    

    0 回复  |  直到 3 年前