Skip to content

Commit 3aa0ec6

Browse files
qwerty541devantler
authored andcommitted
Refactor: Top langs card: Use typedef tags to resolve eslint errors (anuraghazra#3040)
1 parent c79074c commit 3aa0ec6

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/cards/top-languages-card.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,13 +661,18 @@ const renderDonutLayout = (langs, width, totalLanguageSize) => {
661661
`;
662662
};
663663

664+
/**
665+
* @typedef {import("./types").TopLangOptions} TopLangOptions
666+
* @typedef {TopLangOptions["layout"]} Layout
667+
*/
668+
664669
/**
665670
* Creates the no languages data SVG node.
666671
*
667672
* @param {object} props Object with function properties.
668673
* @param {string} props.color No languages data text color.
669674
* @param {string} props.text No languages data translated text.
670-
* @param {import("./types").TopLangOptions["layout"] | undefined} props.layout Card layout.
675+
* @param {Layout | undefined} props.layout Card layout.
671676
* @returns {string} No languages data SVG node string.
672677
*/
673678
const noLanguagesDataNode = ({ color, text, layout }) => {
@@ -682,7 +687,7 @@ const noLanguagesDataNode = ({ color, text, layout }) => {
682687
* Get default languages count for provided card layout.
683688
*
684689
* @param {object} props Function properties.
685-
* @param {import("./types").TopLangOptions["layout"]=} props.layout Input layout string.
690+
* @param {Layout=} props.layout Input layout string.
686691
* @param {boolean=} props.hide_progress Input hide_progress parameter value.
687692
* @returns {number} Default languages count for input layout.
688693
*/
@@ -700,11 +705,15 @@ const getDefaultLanguagesCountByLayout = ({ layout, hide_progress }) => {
700705
}
701706
};
702707

708+
/**
709+
* @typedef {import('../fetchers/types').TopLangData} TopLangData
710+
*/
711+
703712
/**
704713
* Renders card that display user's most frequently used programming languages.
705714
*
706-
* @param {import('../fetchers/types').TopLangData} topLangs User's most frequently used programming languages.
707-
* @param {Partial<import("./types").TopLangOptions>} options Card options.
715+
* @param {TopLangData} topLangs User's most frequently used programming languages.
716+
* @param {Partial<TopLangOptions>} options Card options.
708717
* @returns {string} Language card SVG object.
709718
*/
710719
const renderTopLanguages = (topLangs, options = {}) => {

0 commit comments

Comments
 (0)