diff --git a/.eslintrc.js b/.eslintrc.js index 2abfe3ba790..6dd1ec82cf1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,6 +25,9 @@ module.exports = { 'no-shadow': 'off', '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/indent': 'off', + // disabled due to incompatibility with Record + // See https://github.com/Microsoft/TypeScript/issues/15300#issuecomment-702872440 + '@typescript-eslint/consistent-type-definitions': 'off', // TODO re-enable most of these rules '@typescript-eslint/no-non-null-assertion': 'off', diff --git a/src/BaseControllerV2.test.ts b/src/BaseControllerV2.test.ts index 96dc07197c5..5dd8f66aa23 100644 --- a/src/BaseControllerV2.test.ts +++ b/src/BaseControllerV2.test.ts @@ -3,9 +3,9 @@ import * as sinon from 'sinon'; import { BaseController } from './BaseControllerV2'; -interface MockControllerState { +type MockControllerState = { count: number; -} +}; class MockController extends BaseController { update(callback: (state: Draft) => void | MockControllerState) { diff --git a/src/BaseControllerV2.ts b/src/BaseControllerV2.ts index d87507cfa34..5c57ef227fc 100644 --- a/src/BaseControllerV2.ts +++ b/src/BaseControllerV2.ts @@ -14,7 +14,7 @@ export type Listener = (state: T, patches: Patch[]) => void; /** * Controller class that provides state management and subscriptions */ -export class BaseController> { +export class BaseController> { private internalState: S; private internalListeners: Set> = new Set();