From 7ed5f2e458cfc248667b94fd60f344468a8af139 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 7 Apr 2021 16:36:52 +0200 Subject: [PATCH] fix no-prototype-builtins --- .eslintrc.json | 1 - ui/analyse/src/study/chapterEditForm.ts | 2 +- ui/puzzle/src/moveTest.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 99fa60af8e..de8eb7c9fa 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -35,7 +35,6 @@ "@typescript-eslint/no-empty-function": "off", "no-self-assign": "off", "no-constant-condition": "off", - "no-prototype-builtins": "off", "no-async-promise-executor": "off" } } diff --git a/ui/analyse/src/study/chapterEditForm.ts b/ui/analyse/src/study/chapterEditForm.ts index 07a861e958..e44222e328 100644 --- a/ui/analyse/src/study/chapterEditForm.ts +++ b/ui/analyse/src/study/chapterEditForm.ts @@ -146,7 +146,7 @@ export function view(ctrl: StudyChapterEditFormCtrl): VNode | undefined { } function isLoaded(data: StudyChapterMeta | StudyChapterConfig): data is StudyChapterConfig { - return data.hasOwnProperty('orientation'); + return 'orientation' in data; } function viewLoaded(ctrl: StudyChapterEditFormCtrl, data: StudyChapterConfig): VNode[] { diff --git a/ui/puzzle/src/moveTest.ts b/ui/puzzle/src/moveTest.ts index 1bb04ab54f..0dee8f4ad1 100644 --- a/ui/puzzle/src/moveTest.ts +++ b/ui/puzzle/src/moveTest.ts @@ -8,7 +8,7 @@ type MoveTestReturn = undefined | 'fail' | 'win' | MoveTest; type AltCastle = keyof typeof altCastles; function isAltCastle(str: string): str is AltCastle { - return altCastles.hasOwnProperty(str); + return str in altCastles; } export default function moveTest(vm: Vm, puzzle: Puzzle): MoveTestReturn {