@yawlabs/ctxlint 0.18.2 → 0.18.3
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/.pre-commit-hooks.yaml +1 -1
- package/dist/index.js +40 -2
- package/package.json +1 -1
package/.pre-commit-hooks.yaml
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Version-pinned so a checkout at `rev: vX.Y.Z` runs exactly that release
|
|
5
5
|
# of ctxlint — matches the pinning done by `ctxlint init`. release.sh keeps
|
|
6
6
|
# this in sync with package.json on each bump.
|
|
7
|
-
entry: npx @yawlabs/ctxlint@0.18.
|
|
7
|
+
entry: npx @yawlabs/ctxlint@0.18.3 --strict
|
|
8
8
|
language: node
|
|
9
9
|
always_run: true
|
|
10
10
|
pass_filenames: false
|
package/dist/index.js
CHANGED
|
@@ -13767,6 +13767,13 @@ function extractPathReferences(lines, sections) {
|
|
|
13767
13767
|
cleanValue = cleanValue.slice(0, -1);
|
|
13768
13768
|
}
|
|
13769
13769
|
if (!cleanValue.includes("/")) continue;
|
|
13770
|
+
if (inCodeBlock && codeBlockLang === "" && /^\s/.test(line) && /^[\w@.-]+\/$/.test(cleanValue)) {
|
|
13771
|
+
continue;
|
|
13772
|
+
}
|
|
13773
|
+
const lowerProse = /^([a-z][\w-]*)\/[a-z][\w-]*$/.exec(cleanValue);
|
|
13774
|
+
if (lowerProse && !PATH_FIRST_SEGMENTS.has(lowerProse[1])) {
|
|
13775
|
+
continue;
|
|
13776
|
+
}
|
|
13770
13777
|
if (/(^|\/)\.git\//.test(cleanValue) || /\.app\//.test(cleanValue)) continue;
|
|
13771
13778
|
const column = match.index + match[0].length - match[1].length + 1;
|
|
13772
13779
|
paths.push({
|
|
@@ -13872,7 +13879,7 @@ function extractCommandReferences(lines, sections) {
|
|
|
13872
13879
|
}
|
|
13873
13880
|
return commands;
|
|
13874
13881
|
}
|
|
13875
|
-
var PATH_PATTERN, PATH_EXCLUDE, COMMAND_PREFIXES, COMMON_COMMANDS;
|
|
13882
|
+
var PATH_PATTERN, PATH_EXCLUDE, PATH_FIRST_SEGMENTS, COMMAND_PREFIXES, COMMON_COMMANDS;
|
|
13876
13883
|
var init_parser = __esm({
|
|
13877
13884
|
"src/core/parser.ts"() {
|
|
13878
13885
|
"use strict";
|
|
@@ -13881,6 +13888,37 @@ var init_parser = __esm({
|
|
|
13881
13888
|
init_tokens();
|
|
13882
13889
|
PATH_PATTERN = /(?:^|[\s`"'(])((\.{0,2}\/)?(?:(?:\*{1,2}|[\w@.-][\w@.*-]*)\/)+[\w.*-]*(?:\.\w+)?)(?=[\s`"'),;:]|$)/gm;
|
|
13883
13890
|
PATH_EXCLUDE = /^(https?:\/\/|ftp:\/\/|mailto:|n\/a|w\/o|I\/O|i\/o|e\.g\.|N\/A|\.deb\/|\.rpm[.\/]|\.tar[.\/]|\.zip[.\/])/i;
|
|
13891
|
+
PATH_FIRST_SEGMENTS = /* @__PURE__ */ new Set([
|
|
13892
|
+
"src",
|
|
13893
|
+
"app",
|
|
13894
|
+
"apps",
|
|
13895
|
+
"lib",
|
|
13896
|
+
"libs",
|
|
13897
|
+
"pkg",
|
|
13898
|
+
"packages",
|
|
13899
|
+
"scripts",
|
|
13900
|
+
"docs",
|
|
13901
|
+
"test",
|
|
13902
|
+
"tests",
|
|
13903
|
+
"dist",
|
|
13904
|
+
"build",
|
|
13905
|
+
"infra",
|
|
13906
|
+
"config",
|
|
13907
|
+
"bin",
|
|
13908
|
+
"cmd",
|
|
13909
|
+
"internal",
|
|
13910
|
+
"public",
|
|
13911
|
+
"static",
|
|
13912
|
+
"assets",
|
|
13913
|
+
"components",
|
|
13914
|
+
"pages",
|
|
13915
|
+
"migrations",
|
|
13916
|
+
"modules",
|
|
13917
|
+
"vendor",
|
|
13918
|
+
"examples",
|
|
13919
|
+
"e2e",
|
|
13920
|
+
"node_modules"
|
|
13921
|
+
]);
|
|
13884
13922
|
COMMAND_PREFIXES = /^\s*[\$>]\s+(.+)$/;
|
|
13885
13923
|
COMMON_COMMANDS = /^(npm|npx|pnpm|yarn|make|cargo|go\s+(run|build|test)|python|pytest|vitest|jest|mocha|tsc|eslint|prettier|bun|deno)\b/;
|
|
13886
13924
|
}
|
|
@@ -27750,7 +27788,7 @@ import { readFileSync as readFileSync7 } from "node:fs";
|
|
|
27750
27788
|
import { resolve as resolve14, dirname as dirname6 } from "node:path";
|
|
27751
27789
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
27752
27790
|
function loadVersion() {
|
|
27753
|
-
if (true) return "0.18.
|
|
27791
|
+
if (true) return "0.18.3";
|
|
27754
27792
|
try {
|
|
27755
27793
|
const __dir = dirname6(fileURLToPath2(import.meta.url));
|
|
27756
27794
|
const pkgPath = resolve14(__dir, "../package.json");
|
package/package.json
CHANGED