diff --git a/.vscode/settings.json b/.vscode/settings.json index 52d6a46d33..1a31612182 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,8 @@ "eslint.validate": [ "javascript", { "language": "typescript", "autoFix": true } - ] + ], + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } } diff --git a/__tests__/pinia/stores/user.ts b/__tests__/pinia/stores/user.ts index 67ca840fc3..4697483a9d 100644 --- a/__tests__/pinia/stores/user.ts +++ b/__tests__/pinia/stores/user.ts @@ -2,7 +2,7 @@ import { createStore } from '../../../src' export const useUserStore = createStore('user', () => ({ name: 'Eduardo', - isAdmin: true as boolean, + isAdmin: true, })) export function logout() { diff --git a/src/types.ts b/src/types.ts index 58052fb97c..ea88e470e0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,24 +1,6 @@ import { Ref } from '@vue/composition-api' -interface JSONSerializable { - toJSON(): string -} - -export type StateTreeValue = - | string - | symbol - | number - | boolean - | null - | void - | Function - | StateTree - | StateTreeArray - | JSONSerializable - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface StateTree - extends Record {} +export type StateTree = Record export function isPlainObject( // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -32,16 +14,6 @@ export function isPlainObject( ) } -// symbol is not allowed yet https://github.com/Microsoft/TypeScript/issues/1863 -// export interface StateTree { -// [x: number]: StateTreeValue -// [x: symbol]: StateTreeValue -// [x: string]: StateTreeValue -// } - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -interface StateTreeArray extends Array {} - export interface StoreGetter { (state: S): T }