Skip to content

Commit

Permalink
fix: eslint overzealousness with jsdoc/tag-lines
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron committed Aug 3, 2023
1 parent 57beafe commit bdf3a75
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 9 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@
},
"parserOptions": {
"ecmaVersion": "latest"
}
},
"rules": {
"jsdoc/tag-lines": [
// The Error level should be `error`, `warn`, or `off` (or 2, 1, or 0)
"error",
"never",
{
"startLines": null
}
]
}
}
5 changes: 5 additions & 0 deletions src/TemplatesCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const terminalSize = require('term-size')
class TemplatesCommand extends AddCommand {
/**
* Gets a list of templates from the Template Registry API using the criteria provided.
*
* @param {object} searchCriteria the Template Registry API search criteria
* @param {object} orderByCriteria the Template Registry API orderBy criteria
* @param {object} [templateRegistryConfig={}] the optional Template Registry API config
Expand All @@ -44,6 +45,7 @@ class TemplatesCommand extends AddCommand {

/**
* Select templates from the Template Registry API, via a cli table.
*
* @param {object} searchCriteria the Template Registry API search criteria
* @param {object} orderByCriteria the Template Registry API orderBy criteria
* @param {Array<object>} orgSupportedServices Services supported by the org
Expand Down Expand Up @@ -131,6 +133,7 @@ class TemplatesCommand extends AddCommand {

/**
* Install the templates.
*
* @param {object} templateData the template data
* @param {boolean} [templateData.useDefaultValues=false] use default values when installing the template
* @param {boolean} [templateData.installConfig=true] process the install.yml of the template
Expand Down Expand Up @@ -192,6 +195,7 @@ class TemplatesCommand extends AddCommand {

/**
* Get templates by extension point ids.
*
* @param {Array<string>} extensionsToInstall an array of extension point ids to install.
* @param {object} [templateRegistryConfig={}] the optional Template Registry API config
* @returns {object} returns the result
Expand Down Expand Up @@ -227,6 +231,7 @@ class TemplatesCommand extends AddCommand {

/**
* Install templates by extension point ids.
*
* @param {Array<string>} extensionsToInstall an array of extension point ids to install.
* @param {Array<string>} extensionsAlreadyImplemented an array of extension point ids that have already been implemented (to filter)
* @param {boolean} [useDefaultValues=false] use default values when installing the template
Expand Down
5 changes: 5 additions & 0 deletions src/commands/app/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class Pack extends BaseCommand {

/**
* Creates the deploy.yaml file
*
* @param {object} appConfig the app's configuration file
*/
async createDeployYamlFile (appConfig) {
Expand Down Expand Up @@ -174,6 +175,7 @@ class Pack extends BaseCommand {

/**
* Copies a list of files to a folder.
*
* @param {string} destinationFolder the destination folder for the files
* @param {Array<string>} filesList a list of files to copy
*/
Expand All @@ -191,6 +193,7 @@ class Pack extends BaseCommand {

/**
* Zip a file/folder using archiver
*
* @param {string} filePath path of file/folder to zip
* @param {string} out output path
* @param {boolean} pathInZip internal path in zip
Expand Down Expand Up @@ -227,6 +230,7 @@ class Pack extends BaseCommand {
* Gets a list of files that are to be packed.
*
* This runs `npm pack` to get the list.
*
* @param {Array<string>} filesToExclude a list of files to exclude
* @param {string} workingDirectory the working directory to run `npm pack` in
* @returns {Array<string>} a list of files that are to be packed
Expand All @@ -244,6 +248,7 @@ class Pack extends BaseCommand {
* An annotation called code-download will be added to all actions in app.config.yaml
* (and linked yaml configs for example in extensions). This value will be set to false.
* The annotation will by default be true if not set.
*
* @param {object} appConfig the app's configuration file
*/
async addCodeDownloadAnnotation (appConfig) {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/actions-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const deployActions = require('./deploy-actions')

/**
* Create a watcher.
*
* @param {WatcherOptions} watcherOptions the options for the watcher
* @returns {WatchReturnObject} the WatchReturnObject
*/
Expand All @@ -55,6 +56,7 @@ module.exports = async (watcherOptions) => {

/**
* Builds and deploy the app.
*
* @param {WatcherOptions} watcherOptions the options for the watcher
* @param {Array<string>} filterActions add filters to deploy only specified OpenWhisk actions
*/
Expand All @@ -66,6 +68,7 @@ async function buildAndDeploy (watcherOptions, filterActions) {

/**
* Create the onchange handler for the watcher.
*
* @param {WatcherOptions} watcherOptions the options for the watcher
* @returns {Function} the onchange handler for the watcher
*/
Expand Down Expand Up @@ -110,6 +113,7 @@ function createChangeHandler (watcherOptions) {

/**
* Util function which returns the actionName from the filePath.
*
* @param {string} filePath path of the file
* @param {WatcherOptions} watcherOptions the options for the watcher
* @returns {Array<string>} All of the actions which match the modified path
Expand Down
12 changes: 12 additions & 0 deletions src/lib/app-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ async function runInProcess (hookPath, config) {

/**
* Runs a package script in a child process
*
* @param {string} command to run
* @param {string} dir to run command in
* @param {string[]} cmdArgs args to pass to command
Expand Down Expand Up @@ -193,6 +194,7 @@ async function getCliInfo () {

/**
* Joins url path parts
*
* @param {...string} args url parts
* @returns {string} joined url
*/
Expand All @@ -208,6 +210,7 @@ function urlJoin (...args) {

/**
* Removes the protocol prefix from a URL string
*
* @param {string} url the input url string
* @returns {string} the url without the protocol prefix
*/
Expand All @@ -219,6 +222,7 @@ function removeProtocolFromURL (url) {

/**
* Tests that a file exists, if not throws an error
*
* @param {string} filePath path to a file
*/
function checkFile (filePath) {
Expand All @@ -230,6 +234,7 @@ function checkFile (filePath) {

/**
* Writes an object to a file
*
* @param {string} file path
* @param {object} config object to write
*/
Expand Down Expand Up @@ -353,6 +358,7 @@ async function runOpenWhiskJar (jarFile, runtimeConfigFile, apihost, waitInitTim
/**
*
*Converts a service array to an input string that can be consumed by generator-aio-app
*
* @param {Array} services array of services [{ code: 'xxx', name: 'xxx' }, ...]
* @returns {string} 'code1,code2,code3'
*/
Expand All @@ -362,6 +368,7 @@ function servicesToGeneratorInput (services) {

/**
* Log a warning when overwriting services in the Production Workspace
*
* @param {string} projectName project name, needed for warning message
* @param {string} workspaceName workspace name
*/
Expand All @@ -376,6 +383,7 @@ function warnIfOverwriteServicesInProductionWorkspace (projectName, workspaceNam

/**
* Set the services attached to the current workspace in the .aio config
*
* @param {Array} serviceProperties service properties obtained via LibConsoleCLI.prototype.getServicePropertiesFromWorkspace
*/
function setWorkspaceServicesConfig (serviceProperties) {
Expand All @@ -389,6 +397,7 @@ function setWorkspaceServicesConfig (serviceProperties) {

/**
* Set the services supported by the organization in the .aio config
*
* @param {Array} supportedServices org services obtained via LibConsoleCLI.prototype.getEnabledServicesForOrg
*/
function setOrgServicesConfig (supportedServices) {
Expand All @@ -403,6 +412,7 @@ function setOrgServicesConfig (supportedServices) {

/**
* Gets fresh service list from Console Workspace and builds metadata to be associated with the view operation for dx/excshell/1 extensions
*
* @param {object} libConsoleCLI an instance of LibConsoleCli to get latest services, the user must be logged in
* @param {object} aioConfig loaded aio config
* @returns {object} op['view'] metadata OR null
Expand Down Expand Up @@ -437,6 +447,7 @@ async function buildExcShellViewExtensionMetadata (libConsoleCLI, aioConfig) {

/**
* Build extension points payload from configuration all extension configurations
*
* @param {Array} extConfigs array resulting from BaseCommand.getAppExtConfigs
* @returns {object} extension registry payload
*/
Expand Down Expand Up @@ -544,6 +555,7 @@ function getObjectProp (obj, key) {

/**
* Get a value in an object by dot notation.
*
* @param {object} obj the object to wrap
* @param {string} key the key
* @returns {object} the value
Expand Down
1 change: 1 addition & 0 deletions src/lib/build-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { buildActions } = require('@adobe/aio-lib-runtime')

/**
* Builds actions.
*
* @param {object} config see src/lib/config-loader.js
* @param {Array<string>} filterActions add filters to deploy only specified OpenWhisk actions
* @param {boolean} [forceBuild=false] force a build (skip file changed hash check)
Expand Down
1 change: 1 addition & 0 deletions src/lib/bundle-serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-

/**
* Serves the bundled web source via Parcel.
*
* @param {object} bundler the Parcel bundler object
* @param {object} [options] the Parcel bundler options
* @param {Function} [log] the app logger
Expand Down
1 change: 1 addition & 0 deletions src/lib/deploy-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { deployActions } = require('@adobe/aio-lib-runtime')

/**
* Deploys actions.
*
* @param {object} config see src/lib/config-loader.js
* @param {boolean} isLocalDev default false, set to true if it's a local deploy
* @param {Function} [log] a log function
Expand Down
Loading

0 comments on commit bdf3a75

Please sign in to comment.