Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm1957 committed Oct 26, 2024
1 parent 4ec7e4c commit d94fef9
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
40 changes: 20 additions & 20 deletions lib/M100_IOPackageJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const common = require('./common.js');
async function getIOPackageJson(context) {
console.log('\ngetIOPackageJson');

const ioPackageJson = await common.downloadFile(context.githubUrl, '/io-package.json')
const ioPackageJson = await common.downloadFile(context.githubUrl, '/io-package.json');
context.ioPackageJson = ioPackageJson;
if (typeof context.ioPackageJson === 'string') {
try {
Expand Down Expand Up @@ -132,27 +132,27 @@ async function checkIOPackageJson(context) {
context.checks.push('"common.name" is valid in io-package.json');
}

// /*
// if (context.ioPackageJson.common.title) {
// context.warnings.push('[W158] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
// }
// /*
// if (context.ioPackageJson.common.title) {
// context.warnings.push('[W158] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
// }

// if (context.ioPackageJson.common.main) {
// context.warnings.push('[W177] "common.main" is deprecated in io-package.json. For js-controller >= 3.3 please use package.json main and remove "common.main" from io-package.json.');
// }
// if (context.ioPackageJson.common.main) {
// context.warnings.push('[W177] "common.main" is deprecated in io-package.json. For js-controller >= 3.3 please use package.json main and remove "common.main" from io-package.json.');
// }

// if (context.ioPackageJson.common.materialize) {
// context.warnings.push('[W178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"');
// }
// if (context.ioPackageJson.common.materialize) {
// context.warnings.push('[W178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"');
// }

// if (context.ioPackageJson.common.materializeTab) {
// context.warnings.push('[W179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".');
// }
// if (context.ioPackageJson.common.materializeTab) {
// context.warnings.push('[W179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".');
// }

// if (context.ioPackageJson.common.noConfig) {
// context.warnings.push('[W180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".');
// }
// */
// if (context.ioPackageJson.common.noConfig) {
// context.warnings.push('[W180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".');
// }
// */
if (!context.ioPackageJson.common.titleLang) {
context.errors.push('[E104] No "common.titleLang" found in io-package.json');
} else {
Expand Down Expand Up @@ -522,7 +522,7 @@ async function checkIOPackageJson(context) {
} else {
if (!context.ioPackageJson.common.onlyWWW) {
context.errors.push(`[E162] js-controller dependency missing. js-controller ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please add to dependencies at io-package.json.`);
};
}
}
}
}
Expand Down Expand Up @@ -640,7 +640,7 @@ async function checkIOPackageJson(context) {

if (!context.ioPackageJson.common.onlyWWW && context.packageJson.main) {
try {
await common.downloadFile(context.githubUrl, `/${context.packageJson.main}`)
await common.downloadFile(context.githubUrl, `/${context.packageJson.main}`);
context.checks.push(`${context.packageJson.main} could be downloaded`);
} catch (e) {
common.debug (e);
Expand Down
2 changes: 1 addition & 1 deletion lib/M250_Npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function checkNpm(context) {
console.log('\ncheckNpm [E250 - 299]');
let body;
try {
const response = await axios(`https://registry.npmjs.org/iobroker.${context.adapterName}`)
const response = await axios(`https://registry.npmjs.org/iobroker.${context.adapterName}`);
body = response.data;
} catch (e) {
/* */
Expand Down
2 changes: 1 addition & 1 deletion lib/M300_Testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
This module is a support module for iobroker.repochecker
Area checked: Testing
Area checked: Testing
Numbering : 300 - 399
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/M400_Repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function checkRepository(context) {

if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.type) { /* TODO: why check type here ? */
// download latest repo
const response = await axios('https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist.json')
const response = await axios('https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist.json');
let body = response.data;
if (!body) {
context.errors.push('[E400] Cannot download https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist.json');
Expand Down Expand Up @@ -194,7 +194,7 @@ async function checkRepository(context) {
} catch (e) {
context.errors.push(`[E435] Dependency '${dependency}':'${dependencies[dependency]}' cannot be parsed - ${e}`);
}
}
}
}

}
Expand Down
12 changes: 6 additions & 6 deletions lib/M500_Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function extractWords(words) {
// E5xx
async function checkCode(context) {
console.log('\ncheckCode [E5xx]');

const readFiles = [
'.npmignore',
'.gitignore',
Expand Down Expand Up @@ -138,9 +138,9 @@ async function checkCode(context) {
// }

// https://github.com/userName/ioBroker.adaptername/archive/${context.branch}.zip
const data = await common.downloadFile(context.githubUrlOriginal, `/archive/${context.branch}.zip`, true)
const data = await common.downloadFile(context.githubUrlOriginal, `/archive/${context.branch}.zip`, true);
console.log(`${context.branch}.zip ${data.length} bytes`);

let found = false;
const bufferStream = new stream.PassThrough();
bufferStream.end(data);
Expand Down Expand Up @@ -192,7 +192,7 @@ async function checkCode(context) {
common.debug('on.close');
return Promise.all(promises).then(() => _resolve(context));
});
});
});
})();

let usesReact = false;
Expand Down Expand Up @@ -407,7 +407,7 @@ async function checkCode(context) {
if (!plugins.includes('manual-review')) {
context.warnings.push('[W529] Plugin "manual-review" missing at .releaseconfig.json. Please add.');
}
}0
}0;
} catch (e) {
context.errors.push(`[E530] .releaseconfig.json is no valid json file - ${e}.`);
}
Expand Down Expand Up @@ -454,7 +454,7 @@ exports.checkCode = checkCode;

// [500] node_modules found in repo. Please delete it
// [501] Cannot get ${context.branch}.zip on github
// [502] "admin/img/info-big.png" not found, but selectID.js used in index_m.html
// [502] "admin/img/info-big.png" not found, but selectID.js used in index_m.html
// [503] File "${file}" found in repo! Please remove file.
// [504] setInterval found in "${context.packageJson.main}", but no clearInterval detected
// [504] setInterval found in "${context.packageJson.main}", but no clearInterval detected
Expand Down
2 changes: 1 addition & 1 deletion lib/M800_Github.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function getCommitInfos(context) {
} catch (e) {
console.log(`[INTERNAL] error downloading commit info from ${url} - ${e}`);
throw e;
};
}

const lastCommit = response.data;
//common.debug(`Last commit:\n${JSON.stringify(lastCommit)}`);
Expand Down
8 changes: 4 additions & 4 deletions lib/M900_GitNpmIgnore.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
NOTE: requires filesList to be loaded
*/

/*
TODO:
- something is wrong with undefined 'check' variable
/*
TODO:
- something is wrong with undefined 'check' variable
- conversion of github to regex is wrong with multiple stars
*/

Expand Down Expand Up @@ -57,7 +57,7 @@ async function checkGitIgnore(context) {
}
});

/* TODO: something is wrong with undefined 'check' variable
/* TODO: something is wrong with undefined 'check' variable
if (!rules.includes('node_modules') && !rules.includes('/node_modules') && !rules.includes('/node_modules/*') && !rules.includes('node_modules/*')) {
!check && context.errors.push(`[E902] node_modules not found in .npmignore`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function downloadFile(githubUrl, path, binary, noError) {
} catch (e) {
(!noError || gDebug) && console.error(`Cannot download ${githubUrl}${path || ''} ${e}`);
throw e;
}
}

}

Expand Down

0 comments on commit d94fef9

Please sign in to comment.