diff --git a/src/featherity.js b/src/featherity.js index 653e7cef7..297ab220d 100644 --- a/src/featherity.js +++ b/src/featherity.js @@ -1,25 +1,26 @@ import replaceElement from './replaceElement'; import icons from './icons'; -/* eslint-disable */ /* Main library entry */ export default ({ icons = {}, nameAttr = 'data-feather', attrs = {} }) => { - if (!Object.values(icons).length) { - throw new Error( - "Please provide an icons object.\nIf you want to use all the icons you can import it like:\n `import featherity, { icons } from 'featherity';\nfeather({icons});`", - ); - } + if (!Object.values(icons).length) { + throw new Error( + "Please provide an icons object.\nIf you want to use all the icons you can import it like:\n `import featherity, { icons } from 'featherity';\nfeather({icons});`", + ); + } - if (typeof document === 'undefined') { - throw new Error('`feather.replace()` only works in a browser environment.'); - } + if (typeof document === 'undefined') { + throw new Error('`feather.replace()` only works in a browser environment.'); + } - const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`); + const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`); - Array.from(elementsToReplace).forEach(element => replaceElement(element, {nameAttr, icons, attrs})); - }; + Array.from(elementsToReplace).forEach(element => + replaceElement(element, { nameAttr, icons, attrs }), + ); +}; /* Icons exports.