pickier 0.1.68 → 0.1.70

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 (136) hide show
  1. package/dist/bin/cli.js +2 -2
  2. package/dist/chunk-0b2yx624.js +3 -0
  3. package/dist/chunk-1jtr81zg.js +25 -0
  4. package/dist/chunk-5c026tb4.js +3 -0
  5. package/dist/chunk-5tx5kfq7.js +2 -0
  6. package/dist/chunk-8m82hwdv.js +3 -0
  7. package/dist/chunk-c82emw32.js +3 -0
  8. package/dist/chunk-dxrcbgyc.js +49 -0
  9. package/dist/chunk-gpfjzx90.js +2 -0
  10. package/dist/chunk-he3fbz3w.js +8 -0
  11. package/dist/chunk-m9ym248d.js +2 -0
  12. package/dist/chunk-mqjmcycy.js +128 -0
  13. package/dist/chunk-ng3egs14.js +2 -0
  14. package/dist/chunk-pvptb0h1.js +3 -0
  15. package/dist/chunk-qjzzx1m2.js +61 -0
  16. package/dist/chunk-t4eg5fx5.js +41 -0
  17. package/dist/chunk-t776wefr.js +2 -0
  18. package/dist/chunk-wx92kdf9.js +9 -0
  19. package/dist/chunk-xjt8q744.js +3 -0
  20. package/dist/native/darwin-arm64/pickier-native +0 -0
  21. package/dist/native/darwin-x64/pickier-native +0 -0
  22. package/dist/native/linux-arm64/pickier-native +0 -0
  23. package/dist/native/linux-x64/pickier-native +0 -0
  24. package/dist/native/win32-arm64/pickier-native.exe +0 -0
  25. package/dist/native/win32-x64/pickier-native.exe +0 -0
  26. package/dist/src/cache.d.ts +21 -0
  27. package/dist/src/index.js +1 -1
  28. package/dist/src/lexer.d.ts +2 -0
  29. package/dist/src/lint-worker.d.ts +1 -0
  30. package/dist/src/lint-worker.js +2 -0
  31. package/dist/src/linter.d.ts +17 -1
  32. package/dist/src/logger.d.ts +20 -0
  33. package/dist/src/native.d.ts +64 -0
  34. package/dist/src/parallel.d.ts +17 -0
  35. package/dist/src/plugins/lazy.d.ts +10 -0
  36. package/dist/src/plugins/manifest.d.ts +123 -0
  37. package/dist/src/plugins/utils.d.ts +6 -0
  38. package/dist/src/rules/shell/_continuation.d.ts +4 -0
  39. package/dist/src/rules/style/consistent-list-newline.d.ts +2 -0
  40. package/dist/src/types.d.ts +1 -0
  41. package/dist/src/utils.d.ts +1 -0
  42. package/package.json +3 -2
  43. package/dist/chunk-5dpt7qv4.js +0 -2
  44. package/dist/chunk-ek25vxkw.js +0 -2
  45. package/dist/chunk-jcy3sgzh.js +0 -2
  46. package/dist/chunk-q47v401h.js +0 -92
  47. package/dist/chunk-s0n5r5hb.js +0 -227
  48. package/dist/chunk-zeaz9zt8.js +0 -2
  49. package/dist/src/plugins/index.d.ts +0 -2
  50. package/dist/src/plugins/lockfile.d.ts +0 -22
  51. package/dist/src/plugins/markdown.d.ts +0 -2
  52. package/dist/src/plugins/publint.d.ts +0 -10
  53. package/dist/src/plugins/shell.d.ts +0 -2
  54. package/dist/src/plugins/spell.d.ts +0 -3
  55. package/dist/src/rules/lockfile/parser.d.ts +0 -85
  56. package/dist/src/rules/lockfile/validate-host.d.ts +0 -18
  57. package/dist/src/rules/lockfile/validate-https.d.ts +0 -14
  58. package/dist/src/rules/lockfile/validate-integrity.d.ts +0 -19
  59. package/dist/src/rules/lockfile/validate-package-names.d.ts +0 -23
  60. package/dist/src/rules/lockfile/validate-scheme.d.ts +0 -17
  61. package/dist/src/rules/markdown/_fence-tracking.d.ts +0 -70
  62. package/dist/src/rules/markdown/_shared.d.ts +0 -9
  63. package/dist/src/rules/markdown/blanks-around-fences.d.ts +0 -5
  64. package/dist/src/rules/markdown/blanks-around-headings.d.ts +0 -5
  65. package/dist/src/rules/markdown/blanks-around-lists.d.ts +0 -5
  66. package/dist/src/rules/markdown/blanks-around-tables.d.ts +0 -5
  67. package/dist/src/rules/markdown/code-block-style.d.ts +0 -5
  68. package/dist/src/rules/markdown/code-fence-style.d.ts +0 -5
  69. package/dist/src/rules/markdown/commands-show-output.d.ts +0 -5
  70. package/dist/src/rules/markdown/descriptive-link-text.d.ts +0 -5
  71. package/dist/src/rules/markdown/emphasis-style.d.ts +0 -5
  72. package/dist/src/rules/markdown/fenced-code-language.d.ts +0 -5
  73. package/dist/src/rules/markdown/first-line-heading.d.ts +0 -5
  74. package/dist/src/rules/markdown/heading-increment.d.ts +0 -5
  75. package/dist/src/rules/markdown/heading-start-left.d.ts +0 -5
  76. package/dist/src/rules/markdown/heading-style.d.ts +0 -5
  77. package/dist/src/rules/markdown/hr-style.d.ts +0 -5
  78. package/dist/src/rules/markdown/line-length.d.ts +0 -5
  79. package/dist/src/rules/markdown/link-fragments.d.ts +0 -5
  80. package/dist/src/rules/markdown/link-image-reference-definitions.d.ts +0 -5
  81. package/dist/src/rules/markdown/link-image-style.d.ts +0 -5
  82. package/dist/src/rules/markdown/list-indent.d.ts +0 -5
  83. package/dist/src/rules/markdown/list-marker-space.d.ts +0 -5
  84. package/dist/src/rules/markdown/no-alt-text.d.ts +0 -5
  85. package/dist/src/rules/markdown/no-bare-urls.d.ts +0 -5
  86. package/dist/src/rules/markdown/no-blanks-blockquote.d.ts +0 -5
  87. package/dist/src/rules/markdown/no-duplicate-heading.d.ts +0 -10
  88. package/dist/src/rules/markdown/no-emphasis-as-heading.d.ts +0 -9
  89. package/dist/src/rules/markdown/no-empty-links.d.ts +0 -5
  90. package/dist/src/rules/markdown/no-hard-tabs.d.ts +0 -5
  91. package/dist/src/rules/markdown/no-inline-html.d.ts +0 -5
  92. package/dist/src/rules/markdown/no-missing-space-atx.d.ts +0 -5
  93. package/dist/src/rules/markdown/no-missing-space-closed-atx.d.ts +0 -5
  94. package/dist/src/rules/markdown/no-multiple-blanks.d.ts +0 -5
  95. package/dist/src/rules/markdown/no-multiple-space-atx.d.ts +0 -5
  96. package/dist/src/rules/markdown/no-multiple-space-blockquote.d.ts +0 -5
  97. package/dist/src/rules/markdown/no-multiple-space-closed-atx.d.ts +0 -5
  98. package/dist/src/rules/markdown/no-reversed-links.d.ts +0 -5
  99. package/dist/src/rules/markdown/no-space-in-code.d.ts +0 -5
  100. package/dist/src/rules/markdown/no-space-in-emphasis.d.ts +0 -5
  101. package/dist/src/rules/markdown/no-space-in-links.d.ts +0 -5
  102. package/dist/src/rules/markdown/no-trailing-punctuation.d.ts +0 -5
  103. package/dist/src/rules/markdown/no-trailing-spaces.d.ts +0 -5
  104. package/dist/src/rules/markdown/ol-prefix.d.ts +0 -5
  105. package/dist/src/rules/markdown/proper-names.d.ts +0 -5
  106. package/dist/src/rules/markdown/reference-links-images.d.ts +0 -14
  107. package/dist/src/rules/markdown/required-headings.d.ts +0 -5
  108. package/dist/src/rules/markdown/single-title.d.ts +0 -5
  109. package/dist/src/rules/markdown/single-trailing-newline.d.ts +0 -5
  110. package/dist/src/rules/markdown/strong-style.d.ts +0 -16
  111. package/dist/src/rules/markdown/table-column-count.d.ts +0 -5
  112. package/dist/src/rules/markdown/table-column-style.d.ts +0 -5
  113. package/dist/src/rules/markdown/table-pipe-style.d.ts +0 -5
  114. package/dist/src/rules/markdown/ul-indent.d.ts +0 -14
  115. package/dist/src/rules/markdown/ul-style.d.ts +0 -5
  116. package/dist/src/rules/shell/command-substitution.d.ts +0 -6
  117. package/dist/src/rules/shell/consistent-case-terminators.d.ts +0 -9
  118. package/dist/src/rules/shell/function-style.d.ts +0 -6
  119. package/dist/src/rules/shell/heredoc-indent.d.ts +0 -7
  120. package/dist/src/rules/shell/indent.d.ts +0 -2
  121. package/dist/src/rules/shell/keyword-spacing.d.ts +0 -10
  122. package/dist/src/rules/shell/no-broken-redirect.d.ts +0 -7
  123. package/dist/src/rules/shell/no-cd-without-check.d.ts +0 -6
  124. package/dist/src/rules/shell/no-eval.d.ts +0 -6
  125. package/dist/src/rules/shell/no-exit-in-subshell.d.ts +0 -7
  126. package/dist/src/rules/shell/no-ls-parsing.d.ts +0 -7
  127. package/dist/src/rules/shell/no-trailing-semicolons.d.ts +0 -6
  128. package/dist/src/rules/shell/no-trailing-whitespace.d.ts +0 -5
  129. package/dist/src/rules/shell/no-useless-cat.d.ts +0 -6
  130. package/dist/src/rules/shell/no-variable-in-single-quotes.d.ts +0 -7
  131. package/dist/src/rules/shell/operator-spacing.d.ts +0 -11
  132. package/dist/src/rules/shell/prefer-double-brackets.d.ts +0 -6
  133. package/dist/src/rules/shell/prefer-printf.d.ts +0 -6
  134. package/dist/src/rules/shell/quote-variables.d.ts +0 -2
  135. package/dist/src/rules/shell/set-options.d.ts +0 -8
  136. package/dist/src/rules/shell/shebang.d.ts +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- var e="pickier",u="module",t="0.1.68",r="Format, lint and more in a fraction of seconds.",s="Chris Breuer <chris@stacksjs.org>",l="MIT",p="https://github.com/pickier/pickier#readme",b={type:"git",url:"git+https://github.com/pickier/pickier.git"},c={url:"https://github.com/pickier/pickier/issues"},m=["pickier","linter","formatter","bun","fast"],o={".":{types:"./dist/src/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},a="./dist/src/index.js",x="./dist/src/index.d.ts",d={pickier:"./dist/bin/cli.js"},w=["README.md","dist"],k={build:"bun --bun build.ts","build:bin":"bun --bun build.ts && bun run compile",compile:"bun build ./bin/cli.ts --compile --minify --outfile bin/pickier","compile:all":"bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:linux-x64-musl && bun run compile:linux-arm64-musl && bun run compile:windows-x64 && bun run compile:windows-arm64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64","compile:linux-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/pickier-linux-x64","compile:linux-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/pickier-linux-arm64","compile:linux-x64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64-musl --outfile bin/pickier-linux-x64-musl","compile:linux-arm64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64-musl --outfile bin/pickier-linux-arm64-musl","compile:windows-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/pickier-windows-x64.exe","compile:windows-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-arm64 --outfile bin/pickier-windows-arm64.exe","compile:darwin-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/pickier-darwin-x64","compile:darwin-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/pickier-darwin-arm64",zip:"bun run zip:all","zip:all":"bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:linux-x64-musl && bun run zip:linux-arm64-musl && bun run zip:windows-x64 && bun run zip:windows-arm64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64","zip:linux-x64":"zip -j bin/pickier-linux-x64.zip bin/pickier-linux-x64","zip:linux-arm64":"zip -j bin/pickier-linux-arm64.zip bin/pickier-linux-arm64","zip:linux-x64-musl":"zip -j bin/pickier-linux-x64-musl.zip bin/pickier-linux-x64-musl","zip:linux-arm64-musl":"zip -j bin/pickier-linux-arm64-musl.zip bin/pickier-linux-arm64-musl","zip:windows-x64":"zip -j bin/pickier-windows-x64.zip bin/pickier-windows-x64.exe","zip:windows-arm64":"zip -j bin/pickier-windows-arm64.zip bin/pickier-windows-arm64.exe","zip:darwin-x64":"zip -j bin/pickier-darwin-x64.zip bin/pickier-darwin-x64","zip:darwin-arm64":"zip -j bin/pickier-darwin-arm64.zip bin/pickier-darwin-arm64",prepublishOnly:"bun --bun run build && bun run compile:all && bun run zip",test:"PICKIER_NO_AUTO_CONFIG=1 bun test --coverage","test:core":"PICKIER_NO_AUTO_CONFIG=1 bun test test/core","test:format":"PICKIER_NO_AUTO_CONFIG=1 bun test test/format","test:lint":"PICKIER_NO_AUTO_CONFIG=1 bun test test/lint","test:rules":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules","test:rules:sort":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/sort","test:rules:style":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/style","test:rules:quality":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/quality","test:rules:imports":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/imports","test:rules:typescript":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/typescript","test:rules:regexp":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/regexp","test:plugin":"PICKIER_NO_AUTO_CONFIG=1 bun test test/plugin","test:watch":"PICKIER_NO_AUTO_CONFIG=1 bun test --watch"},I={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},O={"@stacksjs/ts-spell-check":"^0.1.0"},_={bunfig:"^0.15.13"},z={name:e,type:u,version:t,description:r,author:s,license:l,homepage:p,repository:b,bugs:c,keywords:m,exports:o,module:a,types:x,bin:d,files:w,scripts:k,dependencies:I,optionalDependencies:O,devDependencies:_};export{s as author,d as bin,c as bugs,z as default,I as dependencies,r as description,_ as devDependencies,o as exports,w as files,p as homepage,m as keywords,l as license,a as module,e as name,O as optionalDependencies,b as repository,k as scripts,u as type,x as types,t as version};
@@ -1,2 +0,0 @@
1
- import type { PickierPlugin } from '../types';
2
- export declare function getAllPlugins(): PickierPlugin[];
@@ -1,22 +0,0 @@
1
- import type { PickierPlugin } from '../types';
2
- /**
3
- * Lockfile security plugin for pickier.
4
- *
5
- * Validates lockfiles (package-lock.json, yarn.lock, bun.lock) for security issues
6
- * that could indicate supply chain attacks.
7
- *
8
- * Rules:
9
- * - validate-host: Ensure packages are from allowed registry hosts
10
- * - validate-https: Ensure packages use HTTPS protocol
11
- * - validate-integrity: Ensure packages use strong integrity hashes (SHA512)
12
- * - validate-package-names: Ensure package names match their resolved URLs
13
- * - validate-scheme: Ensure packages use allowed URL schemes
14
- *
15
- * Attack vectors protected against:
16
- * 1. Malicious Host Injection - Attacker modifies lockfile to point to malicious registries
17
- * 2. Package Name Substitution - Lockfile references wrong package name in URL
18
- * 3. Unencrypted Protocol Usage - Using HTTP instead of HTTPS (MITM attacks)
19
- * 4. Weak Integrity Hashes - Using SHA1/SHA256 instead of SHA512 (collision attacks)
20
- * 5. Unauthorized URL Schemes - Using file://, data://, git+http://, etc.
21
- */
22
- export declare const lockfilePlugin: PickierPlugin;
@@ -1,2 +0,0 @@
1
- import type { PickierPlugin } from '../types';
2
- export declare const markdownPlugin: PickierPlugin;
@@ -1,10 +0,0 @@
1
- import type { PickierPlugin } from '../types';
2
- /**
3
- * publint plugin for pickier.
4
- *
5
- * Validates package.json files for correct npm publishing configuration.
6
- * Checks exports/imports ordering, field types, file format, module system, etc.
7
- *
8
- * Ported from publint (https://publint.dev).
9
- */
10
- export declare const publintPlugin: PickierPlugin;
@@ -1,2 +0,0 @@
1
- import type { PickierPlugin } from '../types';
2
- export declare const shellPlugin: PickierPlugin;
@@ -1,3 +0,0 @@
1
- import type { PickierPlugin } from '../types';
2
- // ── Plugin export ───────────────────────────────────────────────
3
- export declare const spellPlugin: PickierPlugin;
@@ -1,85 +0,0 @@
1
- /**
2
- * Detect lockfile type from filename
3
- */
4
- export declare function detectLockfileType(filePath: string): 'npm' | 'yarn' | 'bun' | null;
5
- /**
6
- * Check if content is a lockfile based on structure
7
- */
8
- export declare function isLockfileContent(content: string, filePath: string): boolean;
9
- /**
10
- * Parse npm package-lock.json (supports v1, v2, v3)
11
- */
12
- export declare function parseNpmLockfile(content: string): ParsedLockfile;
13
- /**
14
- * Parse yarn.lock (supports classic v1 and berry/v2+)
15
- */
16
- export declare function parseYarnLockfile(content: string): ParsedLockfile;
17
- /**
18
- * Parse bun.lock (JSON format)
19
- *
20
- * Bun lockfile format (v1):
21
- * {
22
- * "lockfileVersion": 1,
23
- * "packages": {
24
- * "pkg-name": ["pkg-name@version", "resolved-url", { deps }, "integrity-hash"],
25
- * "@scope/pkg": ["@scope/pkg@version", "", { deps }, "sha512-..."],
26
- * }
27
- * }
28
- *
29
- * Array format: [name@version, resolved_url, meta_object, integrity_hash]
30
- * Note: resolved_url is often empty string for packages from default registry
31
- */
32
- export declare function parseBunLockfile(content: string): ParsedLockfile;
33
- /**
34
- * Parse a lockfile based on its type
35
- */
36
- export declare function parseLockfile(content: string, filePath: string): ParsedLockfile | null;
37
- /**
38
- * Extract host from a resolved URL
39
- */
40
- export declare function extractHost(resolvedUrl: string): string | null;
41
- /**
42
- * Extract protocol/scheme from a resolved URL
43
- */
44
- export declare function extractScheme(resolvedUrl: string): string | null;
45
- /**
46
- * Extract package name from a resolved URL
47
- * Works for npm/yarn registry URLs like:
48
- * - https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz
49
- * - https://registry.npmjs.org/@babel/core/-/core-7.0.0.tgz
50
- */
51
- export declare function extractPackageNameFromUrl(resolvedUrl: string): string | null;
52
- /**
53
- * Extract integrity hash type (sha1, sha256, sha512, etc.)
54
- */
55
- export declare function extractIntegrityType(integrity: string): string | null;
56
- /**
57
- * Expand host aliases to actual hostnames
58
- */
59
- export declare function expandHostAliases(hosts: string[]): string[];
60
- /**
61
- * Registry aliases for convenience
62
- * @defaultValue
63
- * ```ts
64
- * {
65
- * npm: 'registry.npmjs.org',
66
- * yarn: 'registry.yarnpkg.com',
67
- * verdaccio: 'registry.verdaccio.org'
68
- * }
69
- * ```
70
- */
71
- export declare const REGISTRY_ALIASES: Record<string, string>;
72
- /**
73
- * Lockfile parser for npm, yarn, and bun lockfiles.
74
- * Normalizes different formats into a unified structure for validation.
75
- */
76
- export declare interface ParsedPackage {
77
- name: string
78
- version: string
79
- resolved?: string
80
- integrity?: string
81
- }
82
- export declare interface ParsedLockfile {
83
- type: 'npm' | 'yarn' | 'yarn-berry' | 'bun'
84
- packages: Map<string, ParsedPackage>
85
- }
@@ -1,18 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * Validate that all packages in a lockfile are from allowed hosts.
4
- * Prevents supply chain attacks where an attacker modifies the lockfile
5
- * to point packages to malicious registries.
6
- *
7
- * Options:
8
- * - allowedHosts: Array of allowed hostnames or aliases ('npm', 'yarn', 'verdaccio')
9
- * - emptyHostname: Whether to allow packages with empty/missing resolved URLs (default: true)
10
- *
11
- * Example config:
12
- * ```ts
13
- * pluginRules: {
14
- * 'lockfile/validate-host': ['error', { allowedHosts: ['npm', 'yarn'] }]
15
- * }
16
- * ```
17
- */
18
- export declare const validateHost: RuleModule;
@@ -1,14 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * Validate that all packages use HTTPS protocol.
4
- * Prevents man-in-the-middle attacks where packages could be intercepted
5
- * and replaced when downloaded over unencrypted HTTP.
6
- *
7
- * Example config:
8
- * ```ts
9
- * pluginRules: {
10
- * 'lockfile/validate-https': 'error'
11
- * }
12
- * ```
13
- */
14
- export declare const validateHttps: RuleModule;
@@ -1,19 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * Validate that all packages use strong integrity hashes (SHA512).
4
- * Weak hash algorithms like SHA1 and SHA256 are more susceptible to
5
- * collision attacks, potentially allowing attackers to substitute
6
- * malicious packages that match the same hash.
7
- *
8
- * Options:
9
- * - requiredAlgorithm: The minimum required hash algorithm (default: 'sha512')
10
- * - exclude: Array of package names to exclude from validation
11
- *
12
- * Example config:
13
- * ```ts
14
- * pluginRules: {
15
- * 'lockfile/validate-integrity': ['error', { requiredAlgorithm: 'sha512', exclude: [] }]
16
- * }
17
- * ```
18
- */
19
- export declare const validateIntegrity: RuleModule;
@@ -1,23 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * Validate that package names in lockfile match the resolved URL.
4
- * Detects package substitution attacks where an attacker replaces a legitimate
5
- * package with a malicious one by pointing to a different package in the URL.
6
- *
7
- * Example attack:
8
- * Package key: meow@1.0.0
9
- * Resolved URL: https://registry.npmjs.org/meowlicious/-/meow-4.0.1.tgz
10
- * The URL points to a different package (meowlicious) than expected (meow).
11
- *
12
- * Options:
13
- * - aliases: Object mapping package names to allowed URL names
14
- * Example: { 'foo': 'foo-package' } allows 'foo' to resolve to 'foo-package'
15
- *
16
- * Example config:
17
- * ```ts
18
- * pluginRules: {
19
- * 'lockfile/validate-package-names': ['error', { aliases: {} }]
20
- * }
21
- * ```
22
- */
23
- export declare const validatePackageNames: RuleModule;
@@ -1,17 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * Validate that all packages use allowed URL schemes/protocols.
4
- * Prevents attacks using unexpected schemes like file://, data://,
5
- * git+http://, or other protocols that might bypass security policies.
6
- *
7
- * Options:
8
- * - allowedSchemes: Array of allowed URL schemes (default: ['https:', 'git+https:', 'git+ssh:'])
9
- *
10
- * Example config:
11
- * ```ts
12
- * pluginRules: {
13
- * 'lockfile/validate-scheme': ['error', { allowedSchemes: ['https:', 'git+ssh:'] }]
14
- * }
15
- * ```
16
- */
17
- export declare const validateScheme: RuleModule;
@@ -1,70 +0,0 @@
1
- /**
2
- * CommonMark-compliant code-block detection for markdown.
3
- *
4
- * Returns a Set of 0-indexed line numbers that are inside any code block —
5
- * fenced (` ``` ... ``` ` / `~~~ ... ~~~`) or indented (4-space prefix). The
6
- * fence boundary lines themselves are also included.
7
- *
8
- * Per the CommonMark spec, a fenced code block:
9
- * - Opens with at least 3 backticks or tildes, optionally followed by an
10
- * "info string" (e.g. ` ```js `).
11
- * - Closes only with the SAME fence character, AT LEAST as many of them
12
- * as the opener, and an EMPTY info string (just the run of backticks
13
- * or tildes plus optional trailing whitespace).
14
- * - Anything else inside the block — including ` ```js ` lines — is
15
- * content, not a fence boundary.
16
- *
17
- * The naive tracker that toggles on every `^`{3,}|~{3,}` confuses
18
- * `` ```js `` with a close and corrupts state for the rest of the file.
19
- * Use this helper instead.
20
- *
21
- * Indented code blocks: a line is treated as inside an indented code block
22
- * when it has 4+ leading spaces and the previous non-blank line is also
23
- * indented (or blank with another indented line above it). Lines inside a
24
- * fenced block don't double-count as indented.
25
- */
26
- export declare function getCodeBlockLines(lines: string[]): Set<number>;
27
- /**
28
- * Like `getCodeBlockLines` but returns whether a single line index is
29
- * inside ANY kind of code block — handy for one-shot checks where you
30
- * don't already have the set computed.
31
- */
32
- export declare function isInsideCodeBlock(lines: string[], targetIdx: number): boolean;
33
- /**
34
- * Apply `transform` to the parts of `line` that are OUTSIDE inline code
35
- * spans, leaving code-span text (and its backticks) verbatim. Lets
36
- * emphasis/style fixers rewrite prose without corrupting literal markers
37
- * such as `reverse_proxy` inside `` `caddy reverse_proxy` ``.
38
- */
39
- export declare function replaceOutsideInlineCode(line: string, transform: (segment: string) => string): string;
40
- /**
41
- * Blank out inline code spans (replacing every character — backticks and
42
- * content — with spaces) while preserving length and column positions. Used
43
- * by detectors that want to scan prose for markers without matching anything
44
- * inside a code span.
45
- */
46
- export declare function maskInlineCode(line: string): string;
47
- /**
48
- * Mask inline code across a whole document, including spans that wrap a line.
49
- *
50
- * `maskInlineCode` works one line at a time, which is right for a fixer that
51
- * rewrites a line in place and wrong for a detector. A code span may legally
52
- * span a line break inside a paragraph:
53
- *
54
- * ```md
55
- * `REVIEWOS_GPG_TESTS=1 bun
56
- * test tests/e2e/git-signature.test.ts` is 8 passing
57
- * ```
58
- *
59
- * Per line, neither half has a balanced pair of backticks, so nothing is masked
60
- * and the underscores in `REVIEWOS_GPG_TESTS` read as emphasis - which is
61
- * exactly the false positive this exists to stop. Prose wrapped at eighty
62
- * columns produces this constantly, and it is invisible to anybody reading the
63
- * source because it renders correctly.
64
- *
65
- * A span is only carried across the break while a paragraph continues: a blank
66
- * line ends it, because an unterminated backtick is far more common than a
67
- * multi-line span, and carrying it to the end of the file would mask the whole
68
- * document on one stray tick.
69
- */
70
- export declare function maskInlineCodeAcrossLines(lines: string[]): string[];
@@ -1,9 +0,0 @@
1
- /**
2
- * Identify genuine GFM table rows in a markdown document. A row counts as
3
- * a table row when it is part of a block that includes a separator row of
4
- * the form `|---|---|` (pipes + dashes, optional colons for alignment).
5
- * Stray `|` characters inside paragraphs are ignored. Lines inside fenced
6
- * or indented code blocks are ignored — `| Foo | Bar |` lines inside a
7
- * `` ```markdown `` example are content, not real tables.
8
- */
9
- export declare function findTableRows(lines: string[]): Set<number>;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD031 - Fenced code blocks should be surrounded by blank lines
4
- */
5
- export declare const blanksAroundFencesRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD022 - Headings should be surrounded by blank lines
4
- */
5
- export declare const blanksAroundHeadingsRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD032 - Lists should be surrounded by blank lines
4
- */
5
- export declare const blanksAroundListsRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD058 - Tables should be surrounded by blank lines
4
- */
5
- export declare const blanksAroundTablesRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD046 - Code block style
4
- */
5
- export declare const codeBlockStyleRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD048 - Code fence style
4
- */
5
- export declare const codeFenceStyleRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD014 - Dollar signs used before commands without showing output
4
- */
5
- export declare const commandsShowOutputRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD059 - Link text should be descriptive
4
- */
5
- export declare const descriptiveLinkTextRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD049 - Emphasis style
4
- */
5
- export declare const emphasisStyleRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD040 - Fenced code blocks should have a language specified
4
- */
5
- export declare const fencedCodeLanguageRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD041 - First line in a file should be a top-level heading
4
- */
5
- export declare const firstLineHeadingRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD001 - Heading levels should only increment by one level at a time
4
- */
5
- export declare const headingIncrementRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD023 - Headings must start at the beginning of the line
4
- */
5
- export declare const headingStartLeftRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD003 - Heading style
4
- */
5
- export declare const headingStyleRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD035 - Horizontal rule style
4
- */
5
- export declare const hrStyleRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD013 - Line length
4
- */
5
- export declare const lineLengthRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD051 - Link fragments should be valid
4
- */
5
- export declare const linkFragmentsRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD053 - Link and image reference definitions should be needed
4
- */
5
- export declare const linkImageReferenceDefinitionsRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD054 - Link and image style
4
- */
5
- export declare const linkImageStyleRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD005 - Inconsistent indentation for list items at the same level
4
- */
5
- export declare const listIndentRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD030 - Spaces after list markers
4
- */
5
- export declare const listMarkerSpaceRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD045 - Images should have alternate text (alt text)
4
- */
5
- export declare const noAltTextRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD034 - Bare URL used
4
- */
5
- export declare const noBareUrlsRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD028 - Blank line inside blockquote
4
- */
5
- export declare const noBlanksBlockquoteRule: RuleModule;
@@ -1,10 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD024 - Multiple headings with the same content
4
- *
5
- * Uses "siblings only" mode by default: only flags duplicate headings
6
- * within the same parent section. This avoids false positives in
7
- * changelogs and other documents where headings naturally repeat
8
- * across different sections (e.g., each version has "Features", "Fixes").
9
- */
10
- export declare const noDuplicateHeadingRule: RuleModule;
@@ -1,9 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD036 - Emphasis used instead of a heading
4
- *
5
- * Flags standalone bold/italic lines that look like headings.
6
- * Matches markdownlint MD036 behavior: skips lines ending in punctuation
7
- * (., !, ?, :, ,, ;) since those are sentences/labels, not headings.
8
- */
9
- export declare const noEmphasisAsHeadingRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD042 - No empty links
4
- */
5
- export declare const noEmptyLinksRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD010 - Hard tabs
4
- */
5
- export declare const noHardTabsRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD033 - Inline HTML
4
- */
5
- export declare const noInlineHtmlRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD018 - No space after hash on atx style heading
4
- */
5
- export declare const noMissingSpaceAtxRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD020 - No space inside hashes on closed atx style heading
4
- */
5
- export declare const noMissingSpaceClosedAtxRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD012 - Multiple consecutive blank lines
4
- */
5
- export declare const noMultipleBlanksRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD019 - Multiple spaces after hash on atx style heading
4
- */
5
- export declare const noMultipleSpaceAtxRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD027 - Multiple spaces after blockquote symbol
4
- */
5
- export declare const noMultipleSpaceBlockquoteRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD021 - Multiple spaces inside hashes on closed atx style heading
4
- */
5
- export declare const noMultipleSpaceClosedAtxRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD011 - Reversed link syntax
4
- */
5
- export declare const noReversedLinksRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD038 - Spaces inside code span elements
4
- */
5
- export declare const noSpaceInCodeRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD037 - Spaces inside emphasis markers
4
- */
5
- export declare const noSpaceInEmphasisRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD039 - Spaces inside link text
4
- */
5
- export declare const noSpaceInLinksRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD026 - Trailing punctuation in heading
4
- */
5
- export declare const noTrailingPunctuationRule: RuleModule;
@@ -1,5 +0,0 @@
1
- import type { RuleModule } from '../../types';
2
- /**
3
- * MD009 - Trailing spaces
4
- */
5
- export declare const noTrailingSpacesRule: RuleModule;