@konvert7/klint 0.7.0 → 0.7.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.
Files changed (2) hide show
  1. package/core/runner.ts +6 -2
  2. package/package.json +1 -1
package/core/runner.ts CHANGED
@@ -15,7 +15,6 @@ import type {
15
15
  function walk(dir: string): string[] {
16
16
  const out: string[] = [];
17
17
  for (const entry of readdirSync(dir, { withFileTypes: true })) {
18
- if (entry.name === "node_modules") continue;
19
18
  const full = join(dir, entry.name);
20
19
  if (entry.isDirectory()) out.push(...walk(full));
21
20
  else if (entry.name.endsWith(".ts")) out.push(full.replaceAll("\\", "/"));
@@ -39,6 +38,7 @@ function resolveFiles(include: string[], root: string): string[] {
39
38
  function matchPattern(relPath: string, pattern: string): boolean {
40
39
  const norm = relPath.replaceAll("\\", "/");
41
40
  const p = pattern.replaceAll("\\", "/");
41
+ if (p === "." || p === "**") return true;
42
42
  if (p.endsWith("/**")) return norm.startsWith(`${p.slice(0, -3)}/`);
43
43
  if (p.startsWith("**/")) return norm.endsWith(p.slice(2));
44
44
  return norm === p || norm.startsWith(`${p}/`);
@@ -92,7 +92,11 @@ export function runKlint(
92
92
  ...config.rules,
93
93
  };
94
94
 
95
- const allFiles = resolveFiles(config.include, config.root);
95
+ const allFiles = applyPatterns(
96
+ resolveFiles(config.include, config.root),
97
+ config.include,
98
+ config.root
99
+ );
96
100
  const fileContents = new Map(allFiles.map((f) => [f, readFileSync(f, "utf-8")]));
97
101
  const violations: Violation[] = [];
98
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konvert7/klint",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Architecture-as-Code linter for TypeScript. Enforce layer boundaries, import rules, and singleton patterns in YAML.",
5
5
  "type": "module",
6
6
  "bin": {