diff --git a/.eslintrc b/.eslintrc index 01ecd76..f9e36fd 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,6 +10,7 @@ "jasmine": true }, "rules": { + "object-curly-newline": 0, "linebreak-style": 0, "arrow-body-style": 0, "max-len": 0, diff --git a/src/main.js b/src/main.js index 4c7bc07..9c06f53 100644 --- a/src/main.js +++ b/src/main.js @@ -7,10 +7,9 @@ let _scope = 'all'; // 默认热键范围 const elementHasBindEvent = []; // 已绑定事件的节点记录 // 返回键码 -const code = x => - _keyMap[x.toLowerCase()] || - _modifier[x.toLowerCase()] || - x.toUpperCase().charCodeAt(0); +const code = (x) => _keyMap[x.toLowerCase()] + || _modifier[x.toLowerCase()] + || x.toUpperCase().charCodeAt(0); // 设置获取当前范围(默认为'所有') function setScope(scope) { @@ -33,8 +32,8 @@ function filter(event) { let flag = true; // ignore: isContentEditable === 'true', and