Skip to content

Commit

Permalink
Refactor: Wakatime card: Use @typedef to resolve eslint errors (anura…
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty541 authored Aug 2, 2023
1 parent 6d086b4 commit dc5d23e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cards/wakatime-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit dc5d23e

Please sign in to comment.