mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
refactor: remove eslint ignore rules comments
This commit is contained in:
@@ -1,14 +1,7 @@
|
|||||||
/* eslint-disable class-methods-use-this */
|
|
||||||
/* eslint-disable consistent-return */
|
|
||||||
import Emitter from 'tiny-emitter';
|
import Emitter from 'tiny-emitter';
|
||||||
import listen from 'good-listener';
|
import listen from 'good-listener';
|
||||||
import ClipboardAction from './clipboard-action';
|
import ClipboardAction from './clipboard-action';
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class which takes one or more elements, adds event listeners to them,
|
|
||||||
* and instantiates a new `ClipboardAction` on each click.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to retrieve attribute value.
|
* Helper function to retrieve attribute value.
|
||||||
* @param {String} suffix
|
* @param {String} suffix
|
||||||
@@ -23,6 +16,11 @@ function getAttributeValue(suffix, element) {
|
|||||||
|
|
||||||
return element.getAttribute(attribute);
|
return element.getAttribute(attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class which takes one or more elements, adds event listeners to them,
|
||||||
|
* and instantiates a new `ClipboardAction` on each click.
|
||||||
|
*/
|
||||||
class Clipboard extends Emitter {
|
class Clipboard extends Emitter {
|
||||||
/**
|
/**
|
||||||
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
||||||
@@ -113,7 +111,6 @@ class Clipboard extends Emitter {
|
|||||||
const actions = typeof action === 'string' ? [action] : action;
|
const actions = typeof action === 'string' ? [action] : action;
|
||||||
let support = !!document.queryCommandSupported;
|
let support = !!document.queryCommandSupported;
|
||||||
|
|
||||||
// eslint-disable-next-line no-shadow
|
|
||||||
actions.forEach((action) => {
|
actions.forEach((action) => {
|
||||||
support = support && !!document.queryCommandSupported(action);
|
support = support && !!document.queryCommandSupported(action);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
|
||||||
import Emitter from 'tiny-emitter';
|
import Emitter from 'tiny-emitter';
|
||||||
import ClipboardAction from '../src/clipboard-action';
|
import ClipboardAction from '../src/clipboard-action';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user