From 02198ef9f2ff2c74634e71023951c95952cd2069 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Mon, 11 Mar 2019 10:45:10 +0100 Subject: [PATCH] Fix ESLint and JSDoc errors And trim some whitespaces --- lib/processors/jsdoc/jsdocGenerator.js | 2 +- .../jsdoc/lib/transform-apijson-for-sdk.js | 22 +++++++++---------- package.json | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/processors/jsdoc/jsdocGenerator.js b/lib/processors/jsdoc/jsdocGenerator.js index a7107e006..6821421d8 100644 --- a/lib/processors/jsdoc/jsdocGenerator.js +++ b/lib/processors/jsdoc/jsdocGenerator.js @@ -60,7 +60,7 @@ const jsdocGenerator = async function({sourcePath, targetPath, tmpPath, options} return Promise.all([ fsTarget.byPath(`/test-resources/${namespace}/designtime/api.json`) // fsTarget.byPath(`/libraries/${options.projectName}.js`) - ]).then((res) => res.filter($=>$)); + ]).then((res) => res.filter(($)=>$)); }; diff --git a/lib/processors/jsdoc/lib/transform-apijson-for-sdk.js b/lib/processors/jsdoc/lib/transform-apijson-for-sdk.js index 58739116c..91a4cbcf9 100644 --- a/lib/processors/jsdoc/lib/transform-apijson-for-sdk.js +++ b/lib/processors/jsdoc/lib/transform-apijson-for-sdk.js @@ -28,13 +28,13 @@ const log = (function() { /* * Transforms the api.json as created by the JSDoc build into a pre-processed api.json file suitable for the SDK. - * - * The pre-processing includes formatting of type references, rewriting of links and other time consuming calculations. - * + * + * The pre-processing includes formatting of type references, rewriting of links and other time consuming calculations. + * * @param {string} sInputFile Path of the original api.json file that should be transformed * @param {string} sOutputFile Path that the transformed api.json file should should be written to * @param {string} sLibraryFile Path to the .library file of the library, used to extract further documentation information - * @param {string|string[]} vDependencyAPIFiles Path of folder that contains api.json files of predecessor libs or + * @param {string|string[]} vDependencyAPIFiles Path of folder that contains api.json files of predecessor libs or * an array of paths of those files * @returns {Promise} A Promise that resolves after the transformation has been completed */ @@ -310,7 +310,7 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles) if (oSymbol.kind === "enum" || oProperty.type === "undefined") { delete oProperty.type; } - + }); } @@ -680,7 +680,7 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles) if ( Array.isArray(vDependencyAPIFiles) ) { return oChainObject; } - + // otherwise, it names a directory that has to be scanned for the files return new Promise(oResolve => { fs.readdir(vDependencyAPIFiles, function (oError, aItems) { @@ -1244,7 +1244,7 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles) let bSAPHosted = /^https?:\/\/(?:www.)?[\w.]*(?:sap|hana\.ondemand|sapfioritrial)\.com/.test(sTarget); return `${sText} -`; }, @@ -1375,9 +1375,9 @@ title="Information published on ${bSAPHosted ? '' : 'non '}SAP site" class="sapU * @param {string} name * @param {string} type * @param {string} className - * @param {string=name} text by default if no text is provided the name will be used - * @param {boolean=false} local - * @param {string=""} hrefAppend + * @param {string} [text=name] by default if no text is provided the name will be used + * @param {boolean} [local=false] + * @param {string} [hrefAppend=""] * @returns {string} link */ createLink: function ({name, type, className, text=name, local=false, hrefAppend=""}) { @@ -1948,7 +1948,7 @@ title="Information published on ${bSAPHosted ? '' : 'non '}SAP site" class="sapU inputFile: sInputFile, outputFile: sOutputFile, libraryFile: sLibraryFile, - aDependentLibraryFiles: Array.isArray(vDependencyAPIFiles) ? vDependencyAPIFiles : null + aDependentLibraryFiles: Array.isArray(vDependencyAPIFiles) ? vDependencyAPIFiles : null }; // Start the work here diff --git a/package.json b/package.json index aeb6a106b..41f6dc93c 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "docs/**", "jsdocs/**", "coverage/**", - "test/**" + "test/**", + "lib/processors/jsdoc/lib/**" ], "check-coverage": true, "statements": 85,