@iobroker/repochecker 5.10.2 → 5.10.4

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 CHANGED
@@ -25,6 +25,12 @@ Example:
25
25
  Placeholder for the next version (at the beginning of the line):
26
26
  ### **WORK IN PROGRESS**
27
27
  -->
28
+ ### 5.10.4 (2026-04-12)
29
+ - (@copilot) Enhanced E6013 check: detects additional discouraged installation methods in README.md, including `iobroker`/`iob` npm install and url commands, and `npm install`/`npm i` with `owner/iobroker.adaptername` GitHub shorthand. Updated error message to mention "directly from GitHub, directly from npm or using npm commands".
30
+
31
+ ### 5.10.3 (2026-04-11)
32
+ - (@copilot) Fixed false positive W5042 for TypeScript type-only imports: `import type { Foo } from 'pkg'` no longer registers `pkg` as a required runtime dependency. Related to [#833]
33
+
28
34
  ### 5.10.2 (2026-04-11)
29
35
  - (@copilot) Fixed false positive `[E9507]` for i18n directories inside source directories (`src-rules`, `rules-src`, `src-editor`, `src-widgets`, `admin/src`, etc.) by expanding the ignored source directory list and checking the full parent path instead of only the top-level segment. Related to [#828].
30
36
  - (@copilot) Added adapter-specific exceptions to E0050 blacklist: `@iobroker/plugin-sentry` is now allowed as a dependency for `ioBroker.javascript`.
@@ -283,7 +283,9 @@ async function checkTests(context) {
283
283
  if (context.cfg.onlyWWW) {
284
284
  context.checks.push('Job "adapter-tests" check skipped (onlyWWW adapter).');
285
285
  } else if (!jobs['adapter-tests']) {
286
- context.errors.push(`[E3011] Workflow "${WORKFLOW_FILE_SHORT}": job "adapter-tests" is missing. Please add it.`);
286
+ context.errors.push(
287
+ `[E3011] Workflow "${WORKFLOW_FILE_SHORT}": job "adapter-tests" is missing. Please add it.`,
288
+ );
287
289
  } else {
288
290
  context.checks.push('Job "adapter-tests" found.');
289
291
 
package/lib/M5000_Code.js CHANGED
@@ -226,7 +226,9 @@ function extractImports(content) {
226
226
  // import statements are each matched independently.
227
227
  // The negative lookahead (?!\s*\() excludes dynamic imports like import("pkg")
228
228
  // which would otherwise span many lines and falsely match 'from' in string literals.
229
- const fromPattern = /\b(?:import)\b(?!\s*\()[\s\S]*?\bfrom\s+['"`]([^'"`\n]+)['"`]/g;
229
+ // The negative lookahead (?!\s+type\b) excludes TypeScript type-only imports like
230
+ // `import type { Foo } from 'pkg'` which do not require runtime dependencies.
231
+ const fromPattern = /\b(?:import)\b(?!\s*\()(?!\s+type\b)[\s\S]*?\bfrom\s+['"`]([^'"`\n]+)['"`]/g;
230
232
  while ((match = fromPattern.exec(code)) !== null) {
231
233
  common.debug(` import from: found ${match[1]}`);
232
234
  imports.add(match[1]);
@@ -707,7 +709,7 @@ async function checkCode(context) {
707
709
  context.ioPackageJson.common.adminUI.config === 'json' &&
708
710
  context.filesList.includes('/admin/words.js')
709
711
  ) {
710
- common.debug('/admin/words.js detected while jsonConfig is used.')
712
+ common.debug('/admin/words.js detected while jsonConfig is used.');
711
713
  let isWordsJsUsed = false;
712
714
 
713
715
  const excludeFiles = [
@@ -717,7 +719,7 @@ async function checkCode(context) {
717
719
  '/eslint.config.mjs',
718
720
  '/.eslintignore',
719
721
  '/.create-adapter.json',
720
- ];
722
+ ];
721
723
  for (const fileName of Object.keys(context)) {
722
724
  if (fileName.startsWith('/') && typeof context[fileName] === 'string' && !excludeFiles.includes(fileName)) {
723
725
  const content = context[fileName];
@@ -749,7 +751,8 @@ async function checkCode(context) {
749
751
  if (
750
752
  (context.filesList.includes('/admin/jsonConfig.json') ||
751
753
  context.filesList.includes('/admin/jsonConfig.json5')) &&
752
- (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')
754
+ context.ioPackageJson.common.adminUI &&
755
+ context.ioPackageJson.common.adminUI.config === 'materialize'
753
756
  ) {
754
757
  context.errors.push(
755
758
  '[E5046] Using admin/jsonConfig.json(5) requires common.adminUI to be set to "common.adminUI": { "config": "json" }.',
@@ -443,13 +443,29 @@ async function checkReadme(context) {
443
443
  }
444
444
 
445
445
  // Check for iobroker url (github) install instructions or other undesired install methods
446
+ const repoOwner = (context.repository || '').split('/')[0];
447
+ const escapedOwner = repoOwner.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
448
+ const escapedAdapterName = (context.adapterName || 'unknown').replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
449
+ const ownerAdapterPattern = `${escapedOwner}\\/iobroker\\.${escapedAdapterName}`;
446
450
  if (
451
+ // iobroker/iob url commands (with or without https://github.com/ prefix)
452
+ new RegExp(
453
+ `(?:^|\\n)[^\\n]*(?:iobroker|iob)\\s+url\\s+(?:https?:\\/\\/github\\.com\\/)?${ownerAdapterPattern}`,
454
+ 'i',
455
+ ).test(data) ||
456
+ // iobroker/iob npm install commands with owner/repo GitHub shorthand
457
+ new RegExp(`(?:^|\\n)[^\\n]*(?:iobroker|iob)\\s+npm\\s+install\\s+${ownerAdapterPattern}`, 'i').test(
458
+ data,
459
+ ) ||
460
+ // npm install/i with owner/repo GitHub shorthand
461
+ new RegExp(`(?:^|\\n)[^\\n]*npm\\s+(?:install|i)\\s+${ownerAdapterPattern}`, 'i').test(data) ||
462
+ // Generic iobroker url https://github.com (fallback for any GitHub URL)
447
463
  /(?:^|\n)[^\n]*iobroker\s+url\s+https:\/\/github\.com\//i.test(data) ||
448
464
  /install\s+the\s+adapter\s+via\s+iobroker\s+admin\s+as\s+a\s+zip\s+file/i.test(data) ||
449
465
  /install\s+from\s+own\s+url/i.test(data)
450
466
  ) {
451
467
  context.errors.push(
452
- '[E6013] README.md suggests to install the adapter directly from GitHub. Installation from GitHub is discouraged. Please remove these instructions.',
468
+ '[E6013] README.md suggests to install the adapter directly from GitHub, directly from npm or using npm commands. Installation from GitHub is discouraged. Please remove these instructions.',
453
469
  );
454
470
  } else {
455
471
  context.checks.push('README.md does not contain GitHub URL install instructions');
@@ -519,7 +535,7 @@ exports.checkReadme = checkReadme;
519
535
  // [6009] Multiple copyright lines found in README.md but line(s) ${linesWithoutTrailingSpaces.join(', ')} missing trailing spaces. Add two spaces at end of each copyright line (except last) for proper formatting.
520
536
  // [6011] Copyright lines in README.md are separated by empty line(s) at line(s) ${emptyLineBetweenCopyrightLines.join(', ')}. Remove the empty line(s) between copyright lines and terminate each line (except last) with two spaces.
521
537
  // [E6012] README.md contains instructions to install the adapter using direct npm commands. Adapters must not be installed using direct npm commands. Please remove these instructions.
522
- // [E6013] README.md contains instructions to install the adapter directly from GitHub using "iobroker url". Installation from GitHub is discouraged. Please remove these instructions.
538
+ // [E6013] README.md suggests to install the adapter directly from GitHub, directly from npm or using npm commands. Installation from GitHub is discouraged. Please remove these instructions.
523
539
  // [S6014] README.md contains an "## Installation" section. Adapter installation is covered by standard ioBroker procedures. This section should be removed unless the adapter requires special installation handling.
524
540
  // [E6015] README.md appears to be written in German (detected word: "..."). README.md must be written in English.
525
541
  // [W6016] README.md does not appear to be written in English. README.md must be written in English.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.10.2",
2
+ "version": "5.10.4",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.18.0",