diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c5d685b18ff..20acb78d2f02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: check-hooks-apply - id: check-useless-excludes - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.1.2 + rev: v2.2.0 hooks: - id: prettier files: "\\.(\ @@ -61,7 +61,7 @@ repos: - id: eslint args: ["--format=compact"] additional_dependencies: - - prettier@2.1.2 + - prettier@2.2.0 - eslint@>=6.2.2 - eslint-plugin-import@>=2.18.0 - eslint-plugin-node@>=9.1.0 @@ -78,7 +78,7 @@ repos: - stylelint@latest - stylelint-config-prettier@latest - stylelint-prettier@latest - - prettier@2.1.2 + - prettier@2.2.0 exclude: "^.*\\.(\ csv|\ diff --git a/weblate/static/editor/full.js b/weblate/static/editor/full.js index 7e7bd2f93feb..0c72fad0d014 100644 --- a/weblate/static/editor/full.js +++ b/weblate/static/editor/full.js @@ -42,12 +42,13 @@ window.location = $("#button-end").attr("href"); return false; }); - Mousetrap.bindGlobal(["alt+pagedown", "mod+down", "alt+down"], function ( - e - ) { - window.location = $("#button-next").attr("href"); - return false; - }); + Mousetrap.bindGlobal( + ["alt+pagedown", "mod+down", "alt+down"], + function (e) { + window.location = $("#button-next").attr("href"); + return false; + } + ); Mousetrap.bindGlobal(["alt+pageup", "mod+up", "alt+up"], function (e) { window.location = $("#button-prev").attr("href"); return false; @@ -367,12 +368,13 @@ .find(".check-number") .html(' ' + key + ""); - Mousetrap.bindGlobal(["mod+i " + key, "mod+i mod+" + key], function ( - e - ) { - $this.find(".check-dismiss-single").click(); - return false; - }); + Mousetrap.bindGlobal( + ["mod+i " + key, "mod+i mod+" + key], + function (e) { + $this.find(".check-dismiss-single").click(); + return false; + } + ); } else { $(this).find(".check-number").html(""); } diff --git a/weblate/static/loader-codemirror.js b/weblate/static/loader-codemirror.js index 1e71fe6d5f0b..8febeac55dc5 100644 --- a/weblate/static/loader-codemirror.js +++ b/weblate/static/loader-codemirror.js @@ -30,29 +30,30 @@ }); } - CodeMirror.registerHelper("hint", "userSuggestions", function ( - editor, - callback - ) { - var cur = editor.getCursor(); - var curLine = editor.getLine(cur.line); + CodeMirror.registerHelper( + "hint", + "userSuggestions", + function (editor, callback) { + var cur = editor.getCursor(); + var curLine = editor.getLine(cur.line); - var end = cur.ch; - var start = curLine.lastIndexOf("@") + 1; - // Extract the current word from the current line using 'start' / 'end' value pair - var curWord = start !== end && curLine.slice(start, end); + var end = cur.ch; + var start = curLine.lastIndexOf("@") + 1; + // Extract the current word from the current line using 'start' / 'end' value pair + var curWord = start !== end && curLine.slice(start, end); - if (curWord && curWord.length > 2) { - // If there is current word set, We can filter out users from the - // main list and display them - getUserList( - curWord, - CodeMirror.Pos(cur.line, start), - CodeMirror.Pos(cur.line, end), - callback - ); + if (curWord && curWord.length > 2) { + // If there is current word set, We can filter out users from the + // main list and display them + getUserList( + curWord, + CodeMirror.Pos(cur.line, start), + CodeMirror.Pos(cur.line, end), + callback + ); + } } - }); + ); CodeMirror.hint.userSuggestions.async = true;