markuplint 2.0.0-rc.3 → 2.1.0

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.
Files changed (71) hide show
  1. package/README.md +87 -30
  2. package/lib/api/index.d.mts +2 -0
  3. package/lib/api/index.mjs +2 -0
  4. package/lib/api/lint.d.mts +4 -0
  5. package/lib/api/lint.mjs +15 -0
  6. package/lib/api/ml-engine.d.mts +27 -0
  7. package/lib/api/ml-engine.js +7 -3
  8. package/lib/api/ml-engine.mjs +232 -0
  9. package/lib/api/types.d.mts +43 -0
  10. package/lib/api/types.d.ts +1 -1
  11. package/lib/api/types.mjs +1 -0
  12. package/lib/api/v1.d.mts +51 -0
  13. package/lib/api/v1.d.ts +0 -9
  14. package/lib/api/v1.js +0 -1
  15. package/lib/api/v1.mjs +39 -0
  16. package/lib/cli/bootstrap.d.mts +52 -0
  17. package/lib/cli/bootstrap.d.ts +24 -9
  18. package/lib/cli/bootstrap.js +39 -20
  19. package/lib/cli/bootstrap.mjs +81 -0
  20. package/lib/cli/command.d.mts +3 -0
  21. package/lib/cli/command.js +15 -2
  22. package/lib/cli/command.mjs +50 -0
  23. package/lib/cli/create-rule/index.d.mts +1 -0
  24. package/lib/cli/create-rule/index.js +4 -1
  25. package/lib/cli/create-rule/index.mjs +51 -0
  26. package/lib/cli/index.d.mts +1 -0
  27. package/lib/cli/index.mjs +64 -0
  28. package/lib/cli/index.spec.d.mts +1 -0
  29. package/lib/cli/index.spec.mjs +48 -0
  30. package/lib/cli/init/index.d.mts +1 -0
  31. package/lib/cli/init/index.js +92 -55
  32. package/lib/cli/init/index.mjs +266 -0
  33. package/lib/cli/init/install-module.d.mts +5 -0
  34. package/lib/cli/init/install-module.mjs +61 -0
  35. package/lib/cli/output.d.mts +3 -0
  36. package/lib/cli/output.mjs +31 -0
  37. package/lib/cli/prompt.d.mts +18 -0
  38. package/lib/cli/prompt.mjs +68 -0
  39. package/lib/debug.d.mts +3 -0
  40. package/lib/debug.mjs +10 -0
  41. package/lib/global-settings.d.mts +5 -0
  42. package/lib/global-settings.mjs +10 -0
  43. package/lib/i18n.d.mts +6 -0
  44. package/lib/i18n.mjs +19 -0
  45. package/lib/index.d.mts +8 -0
  46. package/lib/index.mjs +8 -0
  47. package/lib/reporter/index.d.mts +2 -0
  48. package/lib/reporter/index.mjs +2 -0
  49. package/lib/reporter/simple-reporter.d.mts +3 -0
  50. package/lib/reporter/simple-reporter.js +7 -7
  51. package/lib/reporter/simple-reporter.mjs +30 -0
  52. package/lib/reporter/standard-reporter.d.mts +3 -0
  53. package/lib/reporter/standard-reporter.js +10 -10
  54. package/lib/reporter/standard-reporter.mjs +43 -0
  55. package/lib/testing-tool/index.d.mts +35 -0
  56. package/lib/testing-tool/index.js +2 -0
  57. package/lib/testing-tool/index.mjs +83 -0
  58. package/lib/types.d.mts +27 -0
  59. package/lib/types.mjs +1 -0
  60. package/lib/util.d.mts +19 -0
  61. package/lib/util.d.ts +16 -0
  62. package/lib/util.js +75 -1
  63. package/lib/util.mjs +73 -0
  64. package/lib/v1.d.mts +4 -0
  65. package/lib/v1.mjs +4 -0
  66. package/media/screenshot01.png +0 -0
  67. package/package.json +14 -14
  68. package/tsconfig.tsbuildinfo +1 -1
  69. package/RESOLVE_CONFIG.md +0 -77
  70. package/lib/reporter/utils.d.ts +0 -6
  71. package/lib/reporter/utils.js +0 -40
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.messageToString = exports.invisibleSpace = exports.space = exports.w = exports.p = exports.markuplint = void 0;
4
- const tslib_1 = require("tslib");
5
- const cli_color_1 = (0, tslib_1.__importDefault)(require("cli-color"));
6
- // @ts-ignore
7
- const eastasianwidth_1 = (0, tslib_1.__importDefault)(require("eastasianwidth"));
8
- exports.markuplint = `markup${cli_color_1.default.xterm(39)('lint')}`;
9
- const eaw = eastasianwidth_1.default;
10
- function p(s, pad, start = false) {
11
- const l = w(`${s}`.trim());
12
- const d = pad - l;
13
- const _ = ' '.repeat(d < 0 ? 0 : d);
14
- return start ? `${_}${s}` : `${s}${_}`;
15
- }
16
- exports.p = p;
17
- function w(s) {
18
- return s.replace(/./g, _ => '0'.repeat(eaw.characterLength(_))).length;
19
- }
20
- exports.w = w;
21
- function space(str) {
22
- return str
23
- .replace(/\s+/g, $0 => {
24
- return cli_color_1.default.xterm(8)($0);
25
- })
26
- .replace(/ /g, $0 => '•')
27
- .replace(/\t/g, $0 => '→ ');
28
- }
29
- exports.space = space;
30
- function invisibleSpace(str) {
31
- return str.replace(/\t/g, $0 => ' ').replace(/./g, $0 => ' ');
32
- }
33
- exports.invisibleSpace = invisibleSpace;
34
- function messageToString(message, reason) {
35
- if (!reason) {
36
- return message;
37
- }
38
- return `${message} / ${reason}`;
39
- }
40
- exports.messageToString = messageToString;