[improvement] optimize eslint-disable (#4070)

This commit is contained in:
neverland
2019-08-08 20:01:41 +08:00
committed by GitHub
parent 5777762249
commit c74d90c561
13 changed files with 9 additions and 20 deletions
+3 -3
View File
@@ -1,21 +1,21 @@
/* eslint-disable no-empty */
/* eslint-disable getter-return */
/* eslint-disable import/no-mutable-exports */
import { isServer } from '..';
import { EventHandler } from '../types';
// eslint-disable-next-line import/no-mutable-exports
export let supportsPassive = false;
if (!isServer) {
try {
const opts = {};
Object.defineProperty(opts, 'passive', {
// eslint-disable-next-line getter-return
get() {
/* istanbul ignore next */
supportsPassive = true;
}
});
window.addEventListener('test-passive', null as any, opts);
// eslint-disable-next-line no-empty
} catch (e) {}
}