@iobroker/repochecker 4.3.0-alpha.0 → 5.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/doc/issues.json +0 -6
- package/index.js +37 -37
- package/lib/{M000_PackageJson.js → M0000_PackageJson.js} +184 -162
- package/lib/{M100_IOPackageJson.js → M1000_IOPackageJson.js} +246 -242
- package/lib/{M250_Npm.js → M2000_Npm.js} +36 -20
- package/lib/{M300_Testing.js → M3000_Testing.js} +8 -8
- package/lib/{M400_Repository.js → M4000_Repository.js} +117 -110
- package/lib/{M500_Code.js → M5000_Code.js} +89 -85
- package/lib/{M500__JsonConfig.js → M5500__JsonConfig.js} +30 -30
- package/lib/{M600_Readme.js → M6000_Readme.js} +28 -21
- package/lib/{M700_License.js → M7000_License.js} +12 -12
- package/lib/{M800_Github.js → M8000_Github.js} +12 -12
- package/lib/{M900_GitNpmIgnore.js → M9000_GitNpmIgnore.js} +25 -25
- package/lib/common.js +9 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This module is a support module for iobroker.repochecker
|
|
4
4
|
|
|
5
5
|
Area checked: Adapter Code
|
|
6
|
-
Numbering :
|
|
6
|
+
Numbering : 5000 - 5499
|
|
7
7
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ const compareVersions = require('compare-versions');
|
|
|
14
14
|
const JSON5 = require('json5');
|
|
15
15
|
|
|
16
16
|
const common = require('./common.js');
|
|
17
|
-
const
|
|
17
|
+
const M5500__jsonConfig = require('./M5500__JsonConfig.js');
|
|
18
18
|
|
|
19
19
|
// utility to parse words.js
|
|
20
20
|
function extractWords(words) {
|
|
@@ -67,7 +67,7 @@ function getAllFiles(context, dirPath, root, filesList) {
|
|
|
67
67
|
|
|
68
68
|
// E5xx
|
|
69
69
|
async function checkCode(context) {
|
|
70
|
-
console.log('\n[
|
|
70
|
+
console.log('\n[E5000 - E5999] checkCode');
|
|
71
71
|
|
|
72
72
|
const readFiles = [
|
|
73
73
|
'/.npmignore',
|
|
@@ -173,7 +173,7 @@ async function checkCode(context) {
|
|
|
173
173
|
const found = [];
|
|
174
174
|
if (fileName.match(/^\/node_modules\//) && !found.includes('node_module')) {
|
|
175
175
|
context.errors.push(
|
|
176
|
-
'[
|
|
176
|
+
'[E5000] Directory node_modules found in root of repository. Please delete directory.',
|
|
177
177
|
);
|
|
178
178
|
found.push('node_modules');
|
|
179
179
|
}
|
|
@@ -251,7 +251,7 @@ async function checkCode(context) {
|
|
|
251
251
|
(context.ioPackageJson.common.adminUI.config !== 'json' &&
|
|
252
252
|
context.ioPackageJson.common.adminUI.config !== 'none'))
|
|
253
253
|
) {
|
|
254
|
-
context.warnings.push('[
|
|
254
|
+
context.warnings.push('[S5022] Please consider migrating to admin 5 UI (jsonConfig) or react based UI.');
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
if (
|
|
@@ -263,7 +263,7 @@ async function checkCode(context) {
|
|
|
263
263
|
context['/admin/index_m.html'].includes('selectID.js') &&
|
|
264
264
|
!context.filesList.includes('/admin/img/info-big.png')
|
|
265
265
|
) {
|
|
266
|
-
context.errors.push('[
|
|
266
|
+
context.errors.push('[E5002] "/admin/img/info-big.png" not found, but selectID.js used in index_m.html ');
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
if (context['/admin/words.js']) {
|
|
@@ -273,18 +273,18 @@ async function checkCode(context) {
|
|
|
273
273
|
const problem = Object.keys(words).filter(word => !words[word].de || !words[word].ru);
|
|
274
274
|
if (problem.length > 3) {
|
|
275
275
|
context.errors.push(
|
|
276
|
-
`[
|
|
276
|
+
`[E5006] More non translated in german or russian words found in admin/words.js. You can use https://translator.iobroker.in/ for translations`,
|
|
277
277
|
);
|
|
278
278
|
} else {
|
|
279
279
|
problem.forEach(word => {
|
|
280
280
|
if (!words[word].de) {
|
|
281
281
|
context.errors.push(
|
|
282
|
-
`[
|
|
282
|
+
`[E5006] Word "${word}" is not translated to german in admin/words.js. You can use https://translator.iobroker.in/ for translations`,
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
if (!words[word].ru) {
|
|
286
286
|
context.errors.push(
|
|
287
|
-
`[
|
|
287
|
+
`[E5006] Word "${word}" is not translated to russian in admin/words.js. You can use https://translator.iobroker.in/ for translations`,
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
290
|
});
|
|
@@ -304,12 +304,12 @@ async function checkCode(context) {
|
|
|
304
304
|
: JSON5.parse(context['/admin/jsonConfig.json5']);
|
|
305
305
|
} catch (e) {
|
|
306
306
|
context.errors.push(
|
|
307
|
-
`[
|
|
307
|
+
`[E5007] Cannot parse "/admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}": ${e}`,
|
|
308
308
|
);
|
|
309
309
|
}
|
|
310
310
|
} else {
|
|
311
311
|
context.errors.push(
|
|
312
|
-
`[
|
|
312
|
+
`[E5008] "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}" not found, but admin support is declared`,
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
315
|
|
|
@@ -320,27 +320,27 @@ async function checkCode(context) {
|
|
|
320
320
|
try {
|
|
321
321
|
JSON.parse(context[`/admin/i18n/${lang}/translations.json`]);
|
|
322
322
|
} catch (e) {
|
|
323
|
-
context.errors.push(`[
|
|
323
|
+
context.errors.push(`[E5009] Cannot parse "admin/i18n/${lang}/translations.json": ${e}`);
|
|
324
324
|
}
|
|
325
325
|
} else if (context[`/admin/i18n/${lang}.json`]) {
|
|
326
326
|
try {
|
|
327
327
|
JSON.parse(context[`/admin/i18n/${lang}.json`]);
|
|
328
328
|
} catch (e) {
|
|
329
|
-
context.errors.push(`[
|
|
329
|
+
context.errors.push(`[E5009] Cannot parse "admin/i18n/${lang}.json": ${e}`);
|
|
330
330
|
}
|
|
331
331
|
} else {
|
|
332
332
|
context.errors.push(
|
|
333
|
-
`[
|
|
333
|
+
`[E5010] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared. Please add.`,
|
|
334
334
|
);
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
} else if (jsonConfig.i18n === false) {
|
|
338
|
-
context.warnings.push(`[
|
|
338
|
+
context.warnings.push(`[W5015] Why did you decide to disable i18n support?`);
|
|
339
339
|
} else {
|
|
340
|
-
context.warnings.push(`[
|
|
340
|
+
context.warnings.push(`[W5022] Why did you decide not to use i18n support?`);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
|
|
343
|
+
M5500__jsonConfig.checkJsonConfig(
|
|
344
344
|
context,
|
|
345
345
|
`admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}`,
|
|
346
346
|
jsonConfig,
|
|
@@ -360,29 +360,29 @@ async function checkCode(context) {
|
|
|
360
360
|
: JSON5.parse(context['/admin/jsonCustom.json5']);
|
|
361
361
|
} catch (e) {
|
|
362
362
|
context.errors.push(
|
|
363
|
-
`[
|
|
363
|
+
`[E5011] Cannot parse "/admin/jsonCustom.json${context['/admin/jsonCustom.json'] ? '' : '5'}": ${e}`,
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
} else {
|
|
367
367
|
context.errors.push(
|
|
368
|
-
`[
|
|
368
|
+
`[E5012] "/admin/jsonCustom.json${context['/admin/jsonCustom.json'] ? '' : '5'}" not found, but custom support is declared`,
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
if (context.ioPackageJson.common.blockly && !context['/admin/blockly.js']) {
|
|
374
|
-
context.errors.push('[
|
|
374
|
+
context.errors.push('[E5014] "/admin/blockly.js" not found, but blockly support is declared');
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
if (context.ioPackageJson.common.javascriptRules) {
|
|
378
378
|
if (!context.ioPackageJson.common.javascriptRules.url) {
|
|
379
379
|
context.errors.push(
|
|
380
|
-
'[
|
|
380
|
+
'[E5017] JavaScript-Rules support is declared, but no location in property common.javascriptRules.url defined',
|
|
381
381
|
);
|
|
382
382
|
}
|
|
383
383
|
if (!context.filesList.includes(`/admin/${context.ioPackageJson.common.javascriptRules.url}`)) {
|
|
384
384
|
context.errors.push(
|
|
385
|
-
`[
|
|
385
|
+
`[E5016] "/admin/${context.ioPackageJson.common.javascriptRules.url}" not found, but JavaScript-Rules support is declared`,
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -391,13 +391,13 @@ async function checkCode(context) {
|
|
|
391
391
|
|
|
392
392
|
forbiddenFiles.forEach(file => {
|
|
393
393
|
if (context.filesList.includes(file)) {
|
|
394
|
-
context.errors.push(`[
|
|
394
|
+
context.errors.push(`[E5003] File "${file}" found in repo! Please remove file.`);
|
|
395
395
|
}
|
|
396
396
|
});
|
|
397
397
|
|
|
398
398
|
if (!context.filesList.includes('/package-lock.json')) {
|
|
399
399
|
context.warnings.push(
|
|
400
|
-
'[
|
|
400
|
+
'[S5023] "package-lock.json" not found in repo! Please consider to commit it to github repository.',
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
403
|
|
|
@@ -408,24 +408,24 @@ async function checkCode(context) {
|
|
|
408
408
|
if (context['/gulpfile.js']) {
|
|
409
409
|
if (!context.packageJson.devDependencies['gulp']) {
|
|
410
410
|
context.warnings.push(
|
|
411
|
-
'[
|
|
411
|
+
'[W5020] "gulpfile.js" found in repo but "gulp" not found at devDependencies at package.json. Check whether it can be removed.',
|
|
412
412
|
);
|
|
413
413
|
} else if (!usesReact) {
|
|
414
414
|
// Check if @iobroker/adapter-dev is present in devDependencies
|
|
415
415
|
if (context.packageJson.devDependencies && context.packageJson.devDependencies['@iobroker/adapter-dev']) {
|
|
416
416
|
context.warnings.push(
|
|
417
|
-
'[
|
|
417
|
+
'[S5031] "gulpfile.js" found in repo while @iobroker/adapter-dev already used. Please check if gulp is still needed.',
|
|
418
418
|
);
|
|
419
419
|
} else {
|
|
420
420
|
context.warnings.push(
|
|
421
|
-
'[
|
|
421
|
+
'[W5013] "gulpfile.js" found in repo! Think about migrating to @iobroker/adapter-dev package',
|
|
422
422
|
);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
} else {
|
|
426
426
|
if (context.packageJson.devDependencies['gulp']) {
|
|
427
427
|
context.warnings.push(
|
|
428
|
-
'[
|
|
428
|
+
'[W5021] "gulp" found at devDependencies at package.json but no "gulpfile.js" found. Is this dependency really required?',
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
}
|
|
@@ -435,7 +435,7 @@ async function checkCode(context) {
|
|
|
435
435
|
if (compareVersions.compareVersions(version, '3.0.0') >= 0) {
|
|
436
436
|
if (!context['/.releaseconfig.json']) {
|
|
437
437
|
context.errors.push(
|
|
438
|
-
'[
|
|
438
|
+
'[E5018] "@alcalzone/release-script" (>=3.0.0) is used, but ".releaseconfig.json" not found. Please create.',
|
|
439
439
|
);
|
|
440
440
|
} else {
|
|
441
441
|
common.debug(`context[/.releaseconfig.json: ${context['/.releaseconfig.json']}`);
|
|
@@ -447,35 +447,37 @@ async function checkCode(context) {
|
|
|
447
447
|
common.debug(`plugins: ${plugins}`);
|
|
448
448
|
if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-iobroker']) {
|
|
449
449
|
context.errors.push(
|
|
450
|
-
'[
|
|
450
|
+
'[E5024] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-iobroker". Please add.',
|
|
451
451
|
);
|
|
452
452
|
} else {
|
|
453
453
|
if (!plugins.includes('iobroker')) {
|
|
454
|
-
context.errors.push(
|
|
454
|
+
context.errors.push(
|
|
455
|
+
'[E5027] Plugin "iobroker" missing at .releaseconfig.json. Please add.',
|
|
456
|
+
);
|
|
455
457
|
}
|
|
456
458
|
}
|
|
457
459
|
if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-license']) {
|
|
458
460
|
context.errors.push(
|
|
459
|
-
'[
|
|
461
|
+
'[E5025] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-license". Please add.',
|
|
460
462
|
);
|
|
461
463
|
} else {
|
|
462
464
|
if (!plugins.includes('license')) {
|
|
463
|
-
context.errors.push('[
|
|
465
|
+
context.errors.push('[E5028] Plugin "license" missing at .releaseconfig.json. Please add.');
|
|
464
466
|
}
|
|
465
467
|
}
|
|
466
468
|
if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-manual-review']) {
|
|
467
469
|
context.warnings.push(
|
|
468
|
-
'[
|
|
470
|
+
'[S5026] Consider adding plugin "@alcalzone/release-script-plugin-manual-review".',
|
|
469
471
|
);
|
|
470
472
|
} else {
|
|
471
473
|
if (!plugins.includes('manual-review')) {
|
|
472
474
|
context.warnings.push(
|
|
473
|
-
'[
|
|
475
|
+
'[W5029] Plugin "manual-review" missing at .releaseconfig.json. Please add.',
|
|
474
476
|
);
|
|
475
477
|
}
|
|
476
478
|
}
|
|
477
479
|
} catch (e) {
|
|
478
|
-
context.errors.push(`[
|
|
480
|
+
context.errors.push(`[E5030] .releaseconfig.json is no valid json file - ${e}.`);
|
|
479
481
|
}
|
|
480
482
|
}
|
|
481
483
|
}
|
|
@@ -485,7 +487,7 @@ async function checkCode(context) {
|
|
|
485
487
|
if (!context[`/${context.packageJson.main}`]) {
|
|
486
488
|
if (!context.ioPackageJson.common.nogit) {
|
|
487
489
|
context.errors.push(
|
|
488
|
-
`[
|
|
490
|
+
`[E5019] "${context.packageJson.main}" found in package.json, but not found as file`,
|
|
489
491
|
);
|
|
490
492
|
}
|
|
491
493
|
} else {
|
|
@@ -496,11 +498,11 @@ async function checkCode(context) {
|
|
|
496
498
|
if (context.ioPackageJson.common.compact) {
|
|
497
499
|
// if compact mode supported, it is critical
|
|
498
500
|
context.errors.push(
|
|
499
|
-
`[
|
|
501
|
+
`[E5004] setInterval found in "${context.packageJson.main}", but no clearInterval detected`,
|
|
500
502
|
);
|
|
501
503
|
} else {
|
|
502
504
|
context.warnings.push(
|
|
503
|
-
`[
|
|
505
|
+
`[W5004] setInterval found in "${context.packageJson.main}", but no clearInterval detected`,
|
|
504
506
|
);
|
|
505
507
|
}
|
|
506
508
|
}
|
|
@@ -510,13 +512,13 @@ async function checkCode(context) {
|
|
|
510
512
|
) {
|
|
511
513
|
if (context.ioPackageJson.common.compact) {
|
|
512
514
|
// if compact mode supported, it is critical
|
|
513
|
-
// context.errors.push(`[
|
|
515
|
+
// context.errors.push(`[E5005] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected`);
|
|
514
516
|
context.warnings.push(
|
|
515
|
-
`[
|
|
517
|
+
`[W5005] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected`,
|
|
516
518
|
);
|
|
517
519
|
} else {
|
|
518
520
|
context.warnings.push(
|
|
519
|
-
`[
|
|
521
|
+
`[W5005] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected`,
|
|
520
522
|
);
|
|
521
523
|
}
|
|
522
524
|
}
|
|
@@ -547,7 +549,9 @@ async function checkCode(context) {
|
|
|
547
549
|
}
|
|
548
550
|
|
|
549
551
|
if (!isUsed) {
|
|
550
|
-
context.warnings.push(
|
|
552
|
+
context.warnings.push(
|
|
553
|
+
'[S5032] "lib/tools.js" found in repo but not used anywhere. Consider removing file.',
|
|
554
|
+
);
|
|
551
555
|
}
|
|
552
556
|
}
|
|
553
557
|
|
|
@@ -707,7 +711,7 @@ async function checkCode(context) {
|
|
|
707
711
|
// Only warn if we're in an adapter class context
|
|
708
712
|
if (isInAdapterClassContext(lines, i)) {
|
|
709
713
|
context.warnings.push(
|
|
710
|
-
`[
|
|
714
|
+
`[W5033] method "${method}()" is deprecated and will be removed with future js-controller version. Please use "set/deleteObject()" instead.`,
|
|
711
715
|
);
|
|
712
716
|
reportedMethods.add(method);
|
|
713
717
|
break; // Only warn once per line
|
|
@@ -726,7 +730,7 @@ async function checkCode(context) {
|
|
|
726
730
|
// Warn if we're NOT in an adapter class context (outside any class)
|
|
727
731
|
if (!isInAdapterClassContext(lines, i)) {
|
|
728
732
|
context.warnings.push(
|
|
729
|
-
`[
|
|
733
|
+
`[W5033] method "${method}()" is deprecated and will be removed with future js-controller version. Please use "set/deleteObject()" instead.`,
|
|
730
734
|
);
|
|
731
735
|
reportedMethods.add(method);
|
|
732
736
|
break; // Only warn once per line
|
|
@@ -749,45 +753,45 @@ exports.checkCode = checkCode;
|
|
|
749
753
|
// List of error and warnings used at this module
|
|
750
754
|
// ----------------------------------------------
|
|
751
755
|
|
|
752
|
-
// [
|
|
753
|
-
// [
|
|
754
|
-
// [
|
|
755
|
-
// [
|
|
756
|
-
// [
|
|
757
|
-
// [
|
|
758
|
-
// [
|
|
759
|
-
// [
|
|
760
|
-
// [
|
|
761
|
-
// [
|
|
762
|
-
// [
|
|
763
|
-
// [
|
|
764
|
-
// [
|
|
765
|
-
// [
|
|
766
|
-
// [
|
|
767
|
-
// [
|
|
768
|
-
// [
|
|
769
|
-
// [
|
|
770
|
-
// [
|
|
771
|
-
// [
|
|
772
|
-
// [
|
|
773
|
-
// [
|
|
774
|
-
// [
|
|
775
|
-
// [
|
|
776
|
-
// [
|
|
777
|
-
// [
|
|
778
|
-
// [
|
|
779
|
-
// [
|
|
780
|
-
// [
|
|
781
|
-
// [
|
|
782
|
-
// [
|
|
783
|
-
// [
|
|
784
|
-
// [
|
|
785
|
-
// [
|
|
786
|
-
// [
|
|
787
|
-
// [
|
|
788
|
-
// [
|
|
789
|
-
// [
|
|
790
|
-
// [
|
|
791
|
-
// [
|
|
756
|
+
// [5000] node_modules found in repo. Please delete it
|
|
757
|
+
// [5001] Cannot get ${context.branch}.zip on github
|
|
758
|
+
// [5002] "admin/img/info-big.png" not found, but selectID.js used in index_m.html
|
|
759
|
+
// [5003] File "${file}" found in repo! Please remove file.
|
|
760
|
+
// [5004] setInterval found in "${context.packageJson.main}", but no clearInterval detected
|
|
761
|
+
// [5004] setInterval found in "${context.packageJson.main}", but no clearInterval detected
|
|
762
|
+
// [5005] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected
|
|
763
|
+
// [5005] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected
|
|
764
|
+
// [5005] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected
|
|
765
|
+
// [5006] More non translated in german or russian words found in admin/words.js. You can use https://translator.iobroker.in/ for translations
|
|
766
|
+
// [5006] Word "${word}" is not translated to german in admin/words.js. You can use https://translator.iobroker.in/ for translations
|
|
767
|
+
// [5006] Word "${word}" is not translated to russian in admin/words.js. You can use https://translator.iobroker.in/ for translations
|
|
768
|
+
// [5007] Cannot parse "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}": ${e}
|
|
769
|
+
// [5008] "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}" not found, but admin support is declared
|
|
770
|
+
// [5009] Cannot parse "admin/i18n/${lang}.json": ${e}
|
|
771
|
+
// [5009] Cannot parse "admin/i18n/${lang}/translations.json": ${e}
|
|
772
|
+
// [5010] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared. Please add.
|
|
773
|
+
// [5011] Cannot parse "admin/jsonCustom.json${context['/admin/jsonCustom.json'] ? '' : '5'}": ${e}
|
|
774
|
+
// [5012] "admin/jsonCustom.json${context['/admin/jsonCustom.json'] ? '' : '5'}" not found, but custom support is declared
|
|
775
|
+
// [5013] "gulpfile.js" found in repo! Think about migrating to @iobroker/adapter-dev package
|
|
776
|
+
// [5014] "admin/blockly.js" not found, but blockly support is declared
|
|
777
|
+
// [5015] Why did you decide to disable i18n support?
|
|
778
|
+
// [5016] "${context.ioPackageJson.common.javascriptRules.url}" not found, but JavaScript-Rules support is declared
|
|
779
|
+
// [5017] JavaScript-Rules support is declared, but no location in property common.javascriptRules.url defined
|
|
780
|
+
// [5018] "@alcalzone/release-script" (>=3.0.0) is used, but ".releaseconfig.json" not found. Please create.
|
|
781
|
+
// [5019] "${context.packageJson.main}" found in package.json, but not found as file
|
|
782
|
+
// [5020] "gulpfile.js" found in repo but "gulp" not found at devDependencies at package.json. Check whether it can be removed.
|
|
783
|
+
// [5021] "gulp" found at devDependencies at package.json but no "gulpfile.js" found. Is this dependency really required?
|
|
784
|
+
// [5022] "Why did you decide not to use i18n support?"
|
|
785
|
+
// [5023] "package-lock.json" not found in repo! Please remove from .gitignore!
|
|
786
|
+
// [5024] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-iobroker". Please add.
|
|
787
|
+
// [5025] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-license". Please add.
|
|
788
|
+
// [5026] Consider adding plugin "@alcalzone/release-script-plugin-manual-review".
|
|
789
|
+
// [5027] Plugin "iobroker" missing at .releaseconfig.json. Please add.
|
|
790
|
+
// [5028] Plugin "license" missing at .releaseconfig.json. Please add.
|
|
791
|
+
// [5029] Plugin "manual-review" missing at .releaseconfig.json. Please add.
|
|
792
|
+
// [5030] .releaseconfig.json is no valid json file - ${e}.
|
|
793
|
+
// [5031] "gulpfile.js" found in repo with @iobroker/adapter-dev. Check if gulp is still needed.
|
|
794
|
+
// [5032] "lib/tools.js" found in repo but not used anywhere. Consider removing this outdated file.
|
|
795
|
+
// [5033] method "${method}()" is deprecated and will be removed with future js-controller version. Please use "set/deleteObject()" instead.
|
|
792
796
|
|
|
793
797
|
// [550 - ] see M500_jsonConfig.js
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This module is a support module for iobroker.repochecker
|
|
4
4
|
|
|
5
5
|
Area checked: Adapter Code
|
|
6
|
-
Numbering :
|
|
6
|
+
Numbering : 5500 - 5999
|
|
7
7
|
|
|
8
8
|
Extension to check jsonConfig
|
|
9
9
|
|
|
@@ -127,7 +127,7 @@ function handleResponsiveError(context, msg) {
|
|
|
127
127
|
responsiveErrorLimit--;
|
|
128
128
|
if (responsiveErrorLimit === 0) {
|
|
129
129
|
context.errors.push(
|
|
130
|
-
`[
|
|
130
|
+
`[E5510] responsive check: maximum issues reached, please fix reported ones and recheck`,
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -139,7 +139,7 @@ function handleResponsiveWarning(context, msg) {
|
|
|
139
139
|
responsiveWarningLimit--;
|
|
140
140
|
if (responsiveWarningLimit === 0) {
|
|
141
141
|
context.warnings.push(
|
|
142
|
-
`[
|
|
142
|
+
`[W5510] responsive check: maximum issues reached, please fix reported ones and recheck`,
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -164,7 +164,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
164
164
|
if (missing.length) {
|
|
165
165
|
handleResponsiveError(
|
|
166
166
|
context,
|
|
167
|
-
`[
|
|
167
|
+
`[E5507] missing size attributes [${missing.join(',')}] for ${component} at ${path}`,
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -173,7 +173,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
173
173
|
if (jsonConfig[size] !== undefined && (jsonConfig[size] > 12 || jsonConfig[size] <= 0)) {
|
|
174
174
|
handleResponsiveError(
|
|
175
175
|
context,
|
|
176
|
-
`[
|
|
176
|
+
`[E5511] invalid size attributes "${size}":"${jsonConfig[size]}" for ${component} at ${path}. Value must be 1 to 12.`,
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -181,7 +181,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
181
181
|
if (!opts.sizesOptional && jsonConfig.xs && jsonConfig.xs != 12) {
|
|
182
182
|
handleResponsiveWarning(
|
|
183
183
|
context,
|
|
184
|
-
`[
|
|
184
|
+
`[W5508] attribute "xs" for ${component} should specify a value of "12" at ${path}`,
|
|
185
185
|
);
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -192,7 +192,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
192
192
|
if (jsonConfig.sm && jsonConfig.sm > ii) {
|
|
193
193
|
handleResponsiveError(
|
|
194
194
|
context,
|
|
195
|
-
`[
|
|
195
|
+
`[E5509] "sm" value (${jsonConfig.sm}) for ${component} greater then value for smaller displays`,
|
|
196
196
|
);
|
|
197
197
|
} else {
|
|
198
198
|
ii = jsonConfig.sm;
|
|
@@ -200,7 +200,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
200
200
|
if (jsonConfig.md && jsonConfig.md > ii) {
|
|
201
201
|
handleResponsiveError(
|
|
202
202
|
context,
|
|
203
|
-
`[
|
|
203
|
+
`[E5509] "md" value (${jsonConfig.md}) for ${component} greater then value for smaller displays`,
|
|
204
204
|
);
|
|
205
205
|
} else {
|
|
206
206
|
ii = jsonConfig.md;
|
|
@@ -208,7 +208,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
208
208
|
if (jsonConfig.lg && jsonConfig.lg > ii) {
|
|
209
209
|
handleResponsiveError(
|
|
210
210
|
context,
|
|
211
|
-
`[
|
|
211
|
+
`[E5509] "lg" value (${jsonConfig.lg}) for ${component} greater then value for smaller displays`,
|
|
212
212
|
);
|
|
213
213
|
} else {
|
|
214
214
|
ii = jsonConfig.lg;
|
|
@@ -216,7 +216,7 @@ function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
|
216
216
|
if (jsonConfig.xl && jsonConfig.xl > ii) {
|
|
217
217
|
handleResponsiveError(
|
|
218
218
|
context,
|
|
219
|
-
`[
|
|
219
|
+
`[E5509] "xl" value (${jsonConfig.xl}) for ${component} greater then value for smaller displays`,
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -481,12 +481,12 @@ function checkComponent(context, path, jsonConfig) {
|
|
|
481
481
|
|
|
482
482
|
const type = jsonConfig.type;
|
|
483
483
|
if (!type) {
|
|
484
|
-
context.errors.push(`[
|
|
484
|
+
context.errors.push(`[E5502] no type specified at ${path}`);
|
|
485
485
|
}
|
|
486
486
|
common.debug(` type ${type}`);
|
|
487
487
|
|
|
488
488
|
if (validComponents[type] === undefined) {
|
|
489
|
-
context.errors.push(`[
|
|
489
|
+
context.errors.push(`[E5504] unexpected component "${type}" detected at ${path}`);
|
|
490
490
|
} else if (typeof validComponents[type] === 'function') {
|
|
491
491
|
validComponents[type](context, path, jsonConfig, false);
|
|
492
492
|
} else {
|
|
@@ -510,7 +510,7 @@ function checkPanel(context, path, jsonConfig, isRoot) {
|
|
|
510
510
|
common.debug(` scanning ${key}`);
|
|
511
511
|
|
|
512
512
|
if (!validAttributes.includes(key)) {
|
|
513
|
-
context.errors.push(`[
|
|
513
|
+
context.errors.push(`[E5503] unexpected type "${key}" detected at ${path}`);
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
if (key === 'type') {
|
|
@@ -525,7 +525,7 @@ function checkPanel(context, path, jsonConfig, isRoot) {
|
|
|
525
525
|
const type = jsonConfig['items'][subkey].type;
|
|
526
526
|
common.debug(` item ${subkey} / ${type}`);
|
|
527
527
|
if (!type) {
|
|
528
|
-
context.errors.push(`[
|
|
528
|
+
context.errors.push(`[E5502] no type specified at ${path}`);
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
if (type === 'panel') {
|
|
@@ -561,10 +561,10 @@ function checkTabs(context, path, jsonConfig) {
|
|
|
561
561
|
const type = jsonConfig[key].type;
|
|
562
562
|
common.debug(` item ${key} / ${type}`);
|
|
563
563
|
if (!type) {
|
|
564
|
-
context.errors.push(`[
|
|
564
|
+
context.errors.push(`[E5502] no type specified at ${path}; expected "panel"`);
|
|
565
565
|
}
|
|
566
566
|
if (type !== 'panel') {
|
|
567
|
-
context.errors.push(`[
|
|
567
|
+
context.errors.push(`[E5503] unexpected type "${key}" detected at ${path}; expected "panel"`);
|
|
568
568
|
} else {
|
|
569
569
|
checkPanel(context, `${path}/${key}`, jsonConfig[key]);
|
|
570
570
|
}
|
|
@@ -590,7 +590,7 @@ function checkJsonConfig(context, path, jsonConfig) {
|
|
|
590
590
|
baseType = jsonConfig['type'];
|
|
591
591
|
common.debug(` base type ${baseType}`);
|
|
592
592
|
if (!validTypes.includes(baseType)) {
|
|
593
|
-
context.errors.push(`[
|
|
593
|
+
context.errors.push(`[E5500] unexpected base type "!${baseType}" detected at ${path}`);
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
|
|
@@ -606,7 +606,7 @@ function checkJsonConfig(context, path, jsonConfig) {
|
|
|
606
606
|
common.debug(``);
|
|
607
607
|
common.debug(`scanning base attribute ${key}`);
|
|
608
608
|
if (!validAttributes.includes(key)) {
|
|
609
|
-
context.errors.push(`[
|
|
609
|
+
context.errors.push(`[E5501] unexpected attribute "${key}" detected at ${path}`);
|
|
610
610
|
}
|
|
611
611
|
if (key === 'items') {
|
|
612
612
|
if (baseType == 'panel') {
|
|
@@ -625,15 +625,15 @@ exports.checkJsonConfig = checkJsonConfig;
|
|
|
625
625
|
// List of error and warnings used at this module
|
|
626
626
|
// ----------------------------------------------
|
|
627
627
|
|
|
628
|
-
// [
|
|
629
|
-
// [
|
|
630
|
-
// [
|
|
631
|
-
// [
|
|
632
|
-
// [
|
|
633
|
-
// [
|
|
634
|
-
// [
|
|
635
|
-
// [
|
|
636
|
-
// [
|
|
637
|
-
// [
|
|
638
|
-
// [
|
|
639
|
-
// [
|
|
628
|
+
// [5500] unexpected base type "!${baseType}" detected at ${path}
|
|
629
|
+
// [5501] unexpected attribute "${key}" detected at ${path}
|
|
630
|
+
// [5502] no type specified at ${path}
|
|
631
|
+
// [5503] unexpected type "${key}" detected at ${path}
|
|
632
|
+
// [5504] unexpected component "${type}" detected at ${path}
|
|
633
|
+
// [5505]
|
|
634
|
+
// [5506]
|
|
635
|
+
// [5507] responsive check: missing size attributes [${missing.join(',')}] at ${path}
|
|
636
|
+
// [5508] responsive check: attribute "xs" should specify a value of "12" at ${path}
|
|
637
|
+
// [5509] responsive check: "sm" value (${jsonConfig.sm}) greater then value for smaller displays
|
|
638
|
+
// [5510] responsive check: maximum issues reached, please fix reported ones and recheck
|
|
639
|
+
// [5511] invalid size attributes "${size}":"${jsonConfig[size]}" for ${component} at ${path}. Value must be 1 to 12.
|