ilib-lint 2.16.0 → 2.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ilib-lint",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "module": "./src/index.js",
@@ -60,7 +60,8 @@
60
60
  "jest": "^29.7.0",
61
61
  "jsdoc": "^4.0.3",
62
62
  "jsdoc-to-markdown": "^8.0.3",
63
- "typescript": "^5.5.4"
63
+ "typescript": "^5.5.4",
64
+ "@ilib-mono/e2e-test": "^0.0.0"
64
65
  },
65
66
  "dependencies": {
66
67
  "@formatjs/intl": "^2.10.4",
@@ -72,15 +73,16 @@
72
73
  "options-parser": "^0.4.0",
73
74
  "xml-js": "^1.6.11",
74
75
  "ilib-common": "^1.1.6",
75
- "ilib-lint-common": "^3.4.0",
76
76
  "ilib-locale": "^1.2.4",
77
- "ilib-tools-common": "^1.18.0"
77
+ "ilib-lint-common": "^3.4.0",
78
+ "ilib-tools-common": "^1.19.0"
78
79
  },
79
80
  "scripts": {
80
81
  "coverage": "pnpm test -- --coverage",
81
82
  "test": "pnpm test:jest",
82
83
  "test:jest": "LANG=en_US.UTF8 node --trace-warnings --experimental-vm-modules node_modules/jest/bin/jest.js",
83
84
  "test:watch": "pnpm test:jest --watch",
85
+ "test:e2e": "LANG=en_US.UTF8 node --trace-warnings --experimental-vm-modules node_modules/jest/bin/jest.js --config test-e2e/jest.config.cjs",
84
86
  "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i",
85
87
  "lint": "node src/index.js",
86
88
  "clean": "git clean -f -d src test",
@@ -56,8 +56,8 @@ class AnsiConsoleFormatter extends Formatter {
56
56
  output += ` Source: ${result.source}\n`;
57
57
  }
58
58
  output += ` ${result.highlight}
59
- Auto-fix: ${result.fix === undefined ? "unavailable" : result.fix.applied ? "\u001B[92mapplied\u001B[0m" : "\u001B[91mnot applied\u001B[0m"}
60
- Rule (${result.rule.getName()}): ${result.rule.getDescription()}
59
+ Auto-fix: ${!result.fix ? "unavailable" : result.fix.applied ? "\u001B[92mapplied\u001B[0m" : "\u001B[91mnot applied\u001B[0m"}
60
+ Rule (${result?.rule?.getName()}): ${result?.rule?.getDescription()}
61
61
  `;
62
62
  if (result.locale) {
63
63
  output += ` Locale: ${result.locale}\n`;
@@ -68,7 +68,7 @@ class AnsiConsoleFormatter extends Formatter {
68
68
  output = output.replace(/<e\d\/>/g, "\u001B[91m␣\u001B[0m");
69
69
  output = output.replace(/<e\d>/g, "\u001B[91m");
70
70
  output = output.replace(/<\/e\d>/g, "\u001B[0m");
71
- if (typeof(result.rule.getLink) === 'function' && result.rule.getLink()) {
71
+ if (typeof(result?.rule?.getLink) === 'function' && result?.rule?.getLink()) {
72
72
  output += ` More info: ${result.rule.getLink()}\n`;
73
73
  }
74
74
  return output;