Enforce space before code block

This commit is contained in:
Pierre Ossman 2018-09-06 17:29:26 +02:00
parent 0ae5c54ab3
commit 3f1cda2e37
4 changed files with 7 additions and 6 deletions

View File

@ -39,5 +39,6 @@
"keyword-spacing": ["error"], "keyword-spacing": ["error"],
"no-trailing-spaces": ["error"], "no-trailing-spaces": ["error"],
"semi": ["error"], "semi": ["error"],
"space-before-blocks": ["error"],
} }
} }

View File

@ -5,7 +5,7 @@ import DOMKeyTable from "./domkeytable.js";
import * as browser from "../util/browser.js"; import * as browser from "../util/browser.js";
// Get 'KeyboardEvent.code', handling legacy browsers // Get 'KeyboardEvent.code', handling legacy browsers
export function getKeycode(evt){ export function getKeycode(evt) {
// Are we getting proper key identifiers? // Are we getting proper key identifiers?
// (unfortunately Firefox and Chrome are crappy here and gives // (unfortunately Firefox and Chrome are crappy here and gives
// us an empty string on some platforms, rather than leaving it // us an empty string on some platforms, rather than leaving it
@ -125,7 +125,7 @@ export function getKey(evt) {
} }
// Get the most reliable keysym value we can get from a key event // Get the most reliable keysym value we can get from a key event
export function getKeysym(evt){ export function getKeysym(evt) {
const key = getKey(evt); const key = getKey(evt);
if (key === 'Unidentified') { if (key === 'Unidentified') {

View File

@ -115,8 +115,8 @@ describe('WebUtil', function() {
window.chrome = { window.chrome = {
storage: { storage: {
sync: { sync: {
get(cb){ cb(settings); }, get(cb) { cb(settings); },
set(){}, set() {},
remove() {} remove() {}
} }
} }

View File

@ -50,7 +50,7 @@ const codepoints = {};
for (let i = 0; i < arr.length; ++i) { for (let i = 0; i < arr.length; ++i) {
const result = re.exec(arr[i]); const result = re.exec(arr[i]);
if (result){ if (result) {
const keyname = result[1]; const keyname = result[1];
const keysym = parseInt(result[2], 16); const keysym = parseInt(result[2], 16);
const remainder = result[3]; const remainder = result[3];
@ -59,7 +59,7 @@ for (let i = 0; i < arr.length; ++i) {
if (unicodeRes) { if (unicodeRes) {
const unicode = parseInt(unicodeRes[1], 16); const unicode = parseInt(unicodeRes[1], 16);
// The first entry is the preferred one // The first entry is the preferred one
if (!codepoints[unicode]){ if (!codepoints[unicode]) {
codepoints[unicode] = { keysym: keysym, name: keyname }; codepoints[unicode] = { keysym: keysym, name: keyname };
} }
} }