Skip to content

Commit

Permalink
fix: eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Jul 29, 2019
1 parent 5ec4e0d commit a3afebb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/test
/coverage
2 changes: 2 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

module.exports = {
extends: ["@commitlint/config-conventional"]
};
30 changes: 19 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use strict";

// Require Node.js dependencies
const { readFile, readdir } = require("fs").promises;
const { normalize, join } = require("path");
const { readFile } = require("fs").promises;
const { join } = require("path");

// Require Third-party dependencies
const { get, post } = require("httpie");
Expand All @@ -11,6 +13,12 @@ const constants = {
registry_url: new URL("http://localhost:1338")
};

/**
* @function isString
* @param {string} arg
* @param {string} argName
* @returns {void}
*/
function isString(arg, argName) {
if (typeof arg !== "string") {
throw new TypeError(`${argName} must be a string`);
Expand All @@ -22,7 +30,7 @@ function isString(arg, argName) {
*/

/**
* @typedef {Object} MetaData
* @typedef {object} MetaData
* @property {number} uptime Service metadata.
*/

Expand All @@ -44,7 +52,7 @@ async function meta() {
* @memberof RegistrySDK#
* @param {!string} username User name
* @param {!string} password User password
* @returns {Promise<String>} Object of the request with access_token key
* @returns {Promise<string>} Object of the request with access_token key
*
* @throws {TypeError}
*/
Expand All @@ -60,7 +68,7 @@ async function login(username, password) {
}

/**
* @typedef {Object} userId
* @typedef {object} userId
* @property {number} userId user Id in number
*/

Expand All @@ -87,7 +95,7 @@ async function createAccount(username, password, email) {
}

/**
* @typedef {Object} addonId
* @typedef {object} addonId
* @property {number} addonId Addon id
*/

Expand Down Expand Up @@ -135,7 +143,7 @@ async function publishAddon(addonDirectory, token) {
* @function getAllAddons
* @description Get all available addons.
* @memberof RegistrySDK#
* @returns {Promise<Array<String>>} Addon array
* @returns {Promise<Array<string>>} Addon array
*/
async function getAllAddons() {
return (await get(new URL("/addon", constants.registry_url))).data;
Expand All @@ -147,7 +155,7 @@ async function getAllAddons() {
* @description Get a given addon by his name.
* @memberof RegistrySDK#
* @param {!string} addonName Addon name
* @returns {Promise<Object>} Object with addon infos
* @returns {Promise<object>} Object with addon infos
*
* @throws {TypeError}
*/
Expand All @@ -158,7 +166,7 @@ async function getOneAddon(addonName) {
}

/**
* @typedef {Object} listOrgas
* @typedef {object} listOrgas
* @property {string} name
*/
/**
Expand All @@ -178,7 +186,7 @@ async function getAllOrganizations() {
* @description Get an organisation by his name
* @memberof RegistrySDK#
* @param {!string} orgaName Organisation name
* @returns {Promise<Object>} Object with organisation infos
* @returns {Promise<object>} Object with organisation infos
*
* @throws {TypeError}
*/
Expand All @@ -196,7 +204,7 @@ async function getOneOrganization(orgaName) {
* @param {!string} orgaName Organisation name
* @param {!string} username User name
* @param {!string} token User token
* @returns {Promise<Object>} Object with organisation and user infos
* @returns {Promise<object>} Object with organisation and user infos
*
* @throws {TypeError}
*/
Expand Down

0 comments on commit a3afebb

Please sign in to comment.