remove some useless regex escapes

pull/8592/head
Niklas Fiekas 2021-04-07 20:47:56 +02:00
parent 63aa27f78d
commit 94b447d343
4 changed files with 6 additions and 7 deletions

View File

@ -13,18 +13,17 @@
"rules": {
"linebreak-style": ["error", "unix"],
"no-duplicate-imports": "error",
"prefer-spread": "off",
"prefer-rest-params": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"eqeqeq": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"prefer-spread": "off",
"prefer-rest-params": "off",
"no-useless-escape": "off",
"no-constant-condition": "off",
"no-async-promise-executor": "off"
}

View File

@ -351,7 +351,7 @@ export default class AnalyseCtrl {
if (this.node.san!.includes('x')) this.sound.capture();
else this.sound.move();
}
if (/\+|\#/.test(this.node.san!)) this.sound.check();
if (/\+|#/.test(this.node.san!)) this.sound.check();
}
this.threatMode(false);
this.ceval.stop();

View File

@ -31,7 +31,7 @@ function autoLink(html: string) {
return html.replace(userPattern, userLinkReplace).replace(linkPattern, linkReplace);
}
const movePattern = /\b(\d+)\s*(\.+)\s*(?:[o0-]+[o0]|[NBRQKP\u2654\u2655\u2656\u2657\u2658\u2659]?[a-h]?[1-8]?[x@]?[a-z][1-8](?:=[NBRQK\u2654\u2655\u2656\u2657\u2658\u2659])?)\+?\#?[!\?=]{0,5}/gi;
const movePattern = /\b(\d+)\s*(\.+)\s*(?:[o0-]+[o0]|[NBRQKP\u2654\u2655\u2656\u2657\u2658\u2659]?[a-h]?[1-8]?[x@]?[a-z][1-8](?:=[NBRQK\u2654\u2655\u2656\u2657\u2658\u2659])?)\+?#?[!\?=]{0,5}/gi;
function moveReplacer(match: string, turn: number, dots: string) {
if (turn < 1 || turn > 200) return match;
const ply = turn * 2 - (dots.length > 1 ? 0 : 1);

View File

@ -382,7 +382,7 @@ export default function (opts: PuzzleOpts, redraw: Redraw): Controller {
if (vm.node.san!.includes('x')) sound.capture();
else sound.move();
}
if (/\+|\#/.test(vm.node.san!)) sound.check();
if (/\+|#/.test(vm.node.san!)) sound.check();
}
threatMode(false);
ceval.stop();