Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi1cazenave committed Dec 27, 2023
1 parent 455db3d commit 6862ebd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ window.addEventListener('DOMContentLoaded', () => {
if (key === 'layout') {
if (value) {
fetch(`layouts/${value}.json`)
.then((response) => response.json())
.then((data) => keyboard.setKeyboardLayout(data.keymap, data.deadkeys,
.then(response => response.json())
.then(data => keyboard.setKeyboardLayout(data.keymap, data.deadkeys,
data.geometry.replace('ergo', 'iso')));
input.placeholder = 'type here';
} else {
Expand Down Expand Up @@ -42,7 +42,7 @@ window.addEventListener('DOMContentLoaded', () => {
};
IDs.forEach((key) => {
document.getElementById(key).addEventListener('change',
(event) => updateHashState(key, event.target.value));
event => updateHashState(key, event.target.value));
});
window.addEventListener('hashchange', applyHashState);
applyHashState();
Expand Down
4 changes: 2 additions & 2 deletions src/x-keyboard-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ export function newKeyboardLayout(keyMap = {}, deadKeys = {}, geometry = '') {
},

// keyboard hints
getKey: (char) => getKeyList(keyMap, char)[0],
getKeySequence: (str) => getKeySequence(keyMap, deadKeyDict, str),
getKey: char => getKeyList(keyMap, char)[0],
getKeySequence: str => getKeySequence(keyMap, deadKeyDict, str),

// keyboard emulation
keyUp: (keyCode) => {
Expand Down
8 changes: 4 additions & 4 deletions src/x-keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Keyboard extends HTMLElement {
this._state.layout.platform = this.platform;
this.geometry = this._state.geometry;
Array.from(this.root.querySelectorAll('.key'))
.forEach((key) => drawKey(key, value.keyMap));
.forEach(key => drawKey(key, value.keyMap));
}

setKeyboardLayout(keyMap, deadKeys, geometry) {
Expand Down Expand Up @@ -211,9 +211,9 @@ class Keyboard extends HTMLElement {

clearStyle() {
Array.from(this.root.querySelectorAll('[style]'))
.forEach((element) => element.removeAttribute('style'));
.forEach(element => element.removeAttribute('style'));
Array.from(this.root.querySelectorAll('.press'))
.forEach((element) => element.classList.remove('press'));
.forEach(element => element.classList.remove('press'));
}

showKeys(chars, cssText) {
Expand All @@ -227,7 +227,7 @@ class Keyboard extends HTMLElement {
showHint(keyObj) {
let hintClass = '';
Array.from(this.root.querySelectorAll('.hint'))
.forEach((key) => key.classList.remove('hint'));
.forEach(key => key.classList.remove('hint'));
getKeyChord(this.root, keyObj).forEach((key) => {
key.classList.add('hint');
hintClass += `${key.getAttribute('finger')} `;
Expand Down

0 comments on commit 6862ebd

Please sign in to comment.