Closed mrazauskas closed 3 years ago
Improved formatting for plugin template. Improves readily of the rendered plugin file (see bellow). Follows ESLint rules of the repository.
Before:
const SPRITES = { "dreams": () => import('../../assets/sprite/gen/dreams.svg'),"empty-defs": () => import('../../assets/sprite/gen/empty-defs.svg'),"love": () => import('../../assets/sprite/gen/love.svg'),"icons": () => import('../../assets/sprite/gen/icons.svg') } export default function(context, inject) { inject('svgSprite', svgSprite({ importSprite: key => SPRITES[key] ? SPRITES[key]() : Promise.resolve(""), defaultSprite: 'icons', spriteClassPrefix: 'sprite-', spriteClass: 'icon', })) }
After:
const SPRITES = { 'dreams': () => import('../../assets/sprite/gen/dreams.svg'), 'empty-defs': () => import('../../assets/sprite/gen/empty-defs.svg'), 'love': () => import('../../assets/sprite/gen/love.svg'), 'icons': () => import('../../assets/sprite/gen/icons.svg') } export default function (_, inject) { inject('svgSprite', svgSprite({ importSprite: key => SPRITES[key] ? SPRITES[key]() : Promise.resolve(''), defaultSprite: 'icons', spriteClassPrefix: 'sprite-', spriteClass: 'icon' })) }
Improved formatting for plugin template. Improves readily of the rendered plugin file (see bellow). Follows ESLint rules of the repository.
Before:
After: