From afb37c36ac3db2d929767307a75e09262bcfb721 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 10 Jun 2024 15:46:21 +0200 Subject: [PATCH] Document addNamedImport util --- eslint-plugin-expensify/utils/imports.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eslint-plugin-expensify/utils/imports.js b/eslint-plugin-expensify/utils/imports.js index 59141db..8abecc3 100644 --- a/eslint-plugin-expensify/utils/imports.js +++ b/eslint-plugin-expensify/utils/imports.js @@ -1,3 +1,14 @@ +/** + * Adds a named import to the import statement or creates a new import statement if it doesn't exist. + * + * @param {Object} context - The ESLint rule context. + * @param {Object} fixer - The ESLint fixer object. + * @param {ASTNode} importNode - The import statement node. + * @param {string} importName - The name of the import. + * @param {string} importPath - The path of the import. + * @param {boolean} [importAsType=false] - Whether the import should be treated as a type import. + * @returns {Array} An array of fixes to be applied by the fixer. + */ function addNamedImport(context, fixer, importNode, importName, importPath, importAsType = false) { const fixes = [];