Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module.exports = {
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/indent': 'off',
// disabled due to incompatibility with Record<string, unknown>
// 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',
Expand Down
4 changes: 2 additions & 2 deletions src/BaseControllerV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import * as sinon from 'sinon';

import { BaseController } from './BaseControllerV2';

interface MockControllerState {
type MockControllerState = {
count: number;
}
};

class MockController extends BaseController<MockControllerState> {
update(callback: (state: Draft<MockControllerState>) => void | MockControllerState) {
Expand Down
2 changes: 1 addition & 1 deletion src/BaseControllerV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type Listener<T> = (state: T, patches: Patch[]) => void;
/**
* Controller class that provides state management and subscriptions
*/
export class BaseController<S extends Record<string, any>> {
export class BaseController<S extends Record<string, unknown>> {
private internalState: S;

private internalListeners: Set<Listener<S>> = new Set();
Expand Down