From dc5d23e1874ba07698cd47dc663bcae876aaffe1 Mon Sep 17 00:00:00 2001 From: Alexandr Garbuzov Date: Wed, 2 Aug 2023 09:58:37 +0300 Subject: [PATCH] Refactor: Wakatime card: Use @typedef to resolve eslint errors (#3033) --- src/cards/wakatime-card.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cards/wakatime-card.js b/src/cards/wakatime-card.js index 861b7a137fffc..4ea69f732808d 100644 --- a/src/cards/wakatime-card.js +++ b/src/cards/wakatime-card.js @@ -36,11 +36,15 @@ const noCodingActivityNode = ({ color, text }) => { `; }; +/** + * @typedef {import('../fetchers/types').WakaTimeLang} WakaTimeLang + */ + /** * Create compact WakaTime layout. * * @param {Object} args The function arguments. - * @param {import("../fetchers/types").WakaTimeLang} args.lang The languages array. + * @param {WakaTimeLang} args.lang The languages array. * @param {number} args.x The x position of the language node. * @param {number} args.y The y position of the language node. * @returns {string} The compact layout language SVG node. @@ -62,7 +66,7 @@ const createCompactLangNode = ({ lang, x, y }) => { * Create WakaTime language text node item. * * @param {Object} args The function arguments. - * @param {import("../fetchers/types").WakaTimeLang[]} args.langs The language objects. + * @param {WakaTimeLang[]} args.langs The language objects. * @param {number} args.y The y position of the language node. * @returns {string[]} The language text node items. */ @@ -140,7 +144,7 @@ const createTextNode = ({ * Recalculating percentages so that, compact layout's progress bar does not break when * hiding languages. * - * @param {import("../fetchers/types").WakaTimeLang[]} languages The languages array. + * @param {WakaTimeLang[]} languages The languages array. * @returns {void} The recalculated languages array. */ const recalculatePercentages = (languages) => {