fix no-case-declarations

pull/8592/head
Niklas Fiekas 2021-04-07 16:23:33 +02:00
parent 6263140b99
commit 65c66b7093
5 changed files with 15 additions and 10 deletions

View File

@ -16,9 +16,11 @@
],
"rules": {
"linebreak-style": ["error", "unix"],
"no-duplicate-imports": ["error"],
"no-var": "off",
"no-duplicate-imports": "error",
"eqeqeq": "off",
"prefer-const": "off",
"no-var": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
@ -32,7 +34,6 @@
"no-empty": "off",
"@typescript-eslint/no-empty-function": "off",
"no-self-assign": "off",
"no-case-declarations": "off",
"no-constant-condition": "off",
"no-prototype-builtins": "off",
"no-extra-boolean-cast": "off",

View File

@ -84,11 +84,12 @@ export default class GamebookPlayCtrl {
case 'bad':
this.retry();
break;
case 'end':
case 'end': {
const s = this.root.study!,
c = s.nextChapter();
if (c) s.setChapter(c.id);
break;
}
default:
this.next();
}

View File

@ -49,12 +49,13 @@ export default function (root: AnalyseCtrl, goal: Goal, nbMoves: number): boolea
case 'evalIn':
if (nbMoves >= goal.moves!) return isWinning(node, goal.cp!, root.bottomColor());
break;
case 'mateIn':
case 'mateIn': {
if (nbMoves > goal.moves!) return false;
const mateIn = myMateIn(node, root.bottomColor());
if (mateIn === null) return null;
if (!mateIn || (mateIn as number) + nbMoves > goal.moves!) return false;
break;
}
case 'promotion':
if (!node.uci[4]) return null;
return isWinning(node, goal.cp!, root.bottomColor());

View File

@ -65,11 +65,10 @@ export function underboard(ctrl: StudyCtrl): MaybeVNodes {
else if (!ctrl.data.chapter.practice) return [descView(ctrl, true)];
switch (p.success()) {
case true:
const next = ctrl.nextChapter();
return [
h(
'a.feedback.win',
next
ctrl.nextChapter()
? {
hook: bind('click', p.goToNext),
}

View File

@ -25,7 +25,7 @@ export default function (ctrl: RacerCtrl): VNode {
const selectScreen = (ctrl: RacerCtrl): MaybeVNodes => {
const noarg = ctrl.trans.noarg;
switch (ctrl.status()) {
case 'pre':
case 'pre': {
const povMsg = h('p.racer__pre__message__pov', ctrl.trans(povMessage(ctrl.run)));
return ctrl.race.lobby
? [
@ -50,7 +50,8 @@ const selectScreen = (ctrl: RacerCtrl): MaybeVNodes => {
]),
comboZone(ctrl),
];
case 'racing':
}
case 'racing': {
const clock = renderClock(ctrl.run, ctrl.end, false);
return ctrl.isPlayer()
? [playerScore(ctrl), h('div.puz-clock', [clock, renderSkip(ctrl)]), comboZone(ctrl)]
@ -62,12 +63,14 @@ const selectScreen = (ctrl: RacerCtrl): MaybeVNodes => {
]),
comboZone(ctrl),
];
case 'post':
}
case 'post': {
const nextRace = ctrl.race.lobby ? lobbyNext(ctrl) : friendNext(ctrl);
const raceComplete = h('h2', noarg('raceComplete'));
return ctrl.isPlayer()
? [playerScore(ctrl), h('div.racer__post', [raceComplete, yourRank(ctrl), nextRace]), comboZone(ctrl)]
: [spectating(noarg), h('div.racer__post', [raceComplete, nextRace]), comboZone(ctrl)];
}
}
};