@lousy-agents/lint 5.13.6 → 5.14.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.
@@ -1,7 +1,7 @@
1
- export const __rspack_esm_id = 27;
2
- export const __rspack_esm_ids = [27];
1
+ export const __rspack_esm_id = 475;
2
+ export const __rspack_esm_ids = [475];
3
3
  export const __webpack_modules__ = {
4
- 9774(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
4
+ 4710(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
5
5
  // ESM COMPAT FLAG
6
6
  __webpack_require__.r(__webpack_exports__);
7
7
 
@@ -23,7 +23,7 @@ var promises_ = __webpack_require__(1455);
23
23
  var external_node_path_ = __webpack_require__(6760);
24
24
  // EXTERNAL MODULE: external "node:stream"
25
25
  var external_node_stream_ = __webpack_require__(7075);
26
- ;// CONCATENATED MODULE: ../../node_modules/c12/node_modules/readdirp/index.js
26
+ ;// CONCATENATED MODULE: ../../node_modules/readdirp/index.js
27
27
 
28
28
 
29
29
 
@@ -299,7 +299,7 @@ function readdirpPromise(root, options = {}) {
299
299
 
300
300
  // EXTERNAL MODULE: external "node:os"
301
301
  var external_node_os_ = __webpack_require__(8161);
302
- ;// CONCATENATED MODULE: ../../node_modules/c12/node_modules/chokidar/handler.js
302
+ ;// CONCATENATED MODULE: ../../node_modules/chokidar/handler.js
303
303
 
304
304
 
305
305
 
@@ -933,7 +933,7 @@ class NodeFsHandler {
933
933
  }
934
934
  }
935
935
 
936
- ;// CONCATENATED MODULE: ../../node_modules/c12/node_modules/chokidar/index.js
936
+ ;// CONCATENATED MODULE: ../../node_modules/chokidar/index.js
937
937
  /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
938
938
 
939
939
 
package/dist/index.js CHANGED
@@ -566,7 +566,7 @@ module.exports = webpackEmptyAsyncContext;
566
566
 
567
567
 
568
568
  },
569
- 9491(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
569
+ 5144(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
570
570
 
571
571
  // EXPORTS
572
572
  __webpack_require__.d(__webpack_exports__, {
@@ -765,14 +765,17 @@ var dist = __webpack_require__(3519);
765
765
  * Extracts YAML data between leading `---` delimiters.
766
766
  */
767
767
  /**
768
- * Parses YAML frontmatter from markdown content.
769
- *
770
- * Returns `null` when the content has no opening `---`, no closing `---`,
771
- * or contains invalid YAML.
772
- */ function parseFrontmatter(content) {
768
+ * Parses YAML frontmatter and returns a tagged result:
769
+ * - `{ ok: true, data }` on success
770
+ * - `{ ok: false, reason: 'missing' }` when no frontmatter delimiters found
771
+ * - `{ ok: false, reason: 'invalid', detail }` when YAML is malformed (with error detail)
772
+ */ function parseFrontmatterWithError(content) {
773
773
  const lines = content.split("\n");
774
774
  if (lines[0]?.trim() !== "---") {
775
- return null;
775
+ return {
776
+ ok: false,
777
+ reason: "missing"
778
+ };
776
779
  }
777
780
  let endIndex = -1;
778
781
  for(let i = 1; i < lines.length; i++){
@@ -782,7 +785,10 @@ var dist = __webpack_require__(3519);
782
785
  }
783
786
  }
784
787
  if (endIndex === -1) {
785
- return null;
788
+ return {
789
+ ok: false,
790
+ reason: "missing"
791
+ };
786
792
  }
787
793
  const yamlContent = lines.slice(1, endIndex).join("\n");
788
794
  let data;
@@ -791,23 +797,39 @@ var dist = __webpack_require__(3519);
791
797
  maxAliasCount: 0
792
798
  });
793
799
  data = parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
794
- } catch {
795
- return null;
800
+ } catch (error) {
801
+ const detail = error instanceof Error ? error.message : "Unknown YAML parse error";
802
+ return {
803
+ ok: false,
804
+ reason: "invalid",
805
+ detail
806
+ };
796
807
  }
797
808
  const fieldLines = new Map();
798
809
  for(let i = 1; i < endIndex; i++){
799
- // Match YAML top-level field names: non-whitespace start, any chars except colon, then colon followed by whitespace or end-of-line
800
810
  const match = lines[i]?.match(/^([^\s:][^:]*?):(?:\s|$)/);
801
811
  if (match?.[1]) {
802
812
  fieldLines.set(match[1], i + 1);
803
813
  }
804
814
  }
805
815
  return {
806
- data: data ?? {},
807
- fieldLines,
808
- frontmatterStartLine: 1
816
+ ok: true,
817
+ data: {
818
+ data: data ?? {},
819
+ fieldLines,
820
+ frontmatterStartLine: 1
821
+ }
809
822
  };
810
823
  }
824
+ /**
825
+ * Parses YAML frontmatter from markdown content.
826
+ *
827
+ * Returns `null` when the content has no opening `---`, no closing `---`,
828
+ * or contains invalid YAML.
829
+ */ function parseFrontmatter(content) {
830
+ const result = parseFrontmatterWithError(content);
831
+ return result.ok ? result.data : null;
832
+ }
811
833
 
812
834
  // EXTERNAL MODULE: external "node:fs"
813
835
  var external_node_fs_ = __webpack_require__(3024);
@@ -17418,7 +17440,7 @@ function default_ok() {}
17418
17440
 
17419
17441
  function unreachable() {}
17420
17442
 
17421
- ;// CONCATENATED MODULE: ../../node_modules/unified/node_modules/is-plain-obj/index.js
17443
+ ;// CONCATENATED MODULE: ../../node_modules/is-plain-obj/index.js
17422
17444
  function isPlainObject(value) {
17423
17445
  if (typeof value !== 'object' || value === null) {
17424
17446
  return false;
@@ -31430,371 +31452,317 @@ var jsonc = __webpack_require__(5975);
31430
31452
 
31431
31453
 
31432
31454
 
31433
-
31434
31455
  const defaultFindOptions = {
31435
- startingFrom: ".",
31436
- rootPattern: /^node_modules$/,
31437
- reverse: false,
31438
- test: (filePath) => {
31439
- try {
31440
- if ((0,external_node_fs_.statSync)(filePath).isFile()) {
31441
- return true;
31442
- }
31443
- } catch {
31444
- }
31445
- }
31456
+ startingFrom: ".",
31457
+ rootPattern: /^node_modules$/,
31458
+ reverse: false,
31459
+ test: (filePath) => {
31460
+ try {
31461
+ if ((0,external_node_fs_.statSync)(filePath).isFile()) return true;
31462
+ } catch {}
31463
+ }
31446
31464
  };
31447
31465
  async function findFile(filename, _options = {}) {
31448
- const filenames = Array.isArray(filename) ? filename : [filename];
31449
- const options = { ...defaultFindOptions, ..._options };
31450
- const basePath = pathe_M_eThtNZ_resolve(options.startingFrom);
31451
- const leadingSlash = basePath[0] === "/";
31452
- const segments = basePath.split("/").filter(Boolean);
31453
- if (filenames.includes(segments.at(-1)) && await options.test(basePath)) {
31454
- return basePath;
31455
- }
31456
- if (leadingSlash) {
31457
- segments[0] = "/" + segments[0];
31458
- }
31459
- let root = segments.findIndex((r) => r.match(options.rootPattern));
31460
- if (root === -1) {
31461
- root = 0;
31462
- }
31463
- if (options.reverse) {
31464
- for (let index = root + 1; index <= segments.length; index++) {
31465
- for (const filename2 of filenames) {
31466
- const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename2);
31467
- if (await options.test(filePath)) {
31468
- return filePath;
31469
- }
31470
- }
31471
- }
31472
- } else {
31473
- for (let index = segments.length; index > root; index--) {
31474
- for (const filename2 of filenames) {
31475
- const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename2);
31476
- if (await options.test(filePath)) {
31477
- return filePath;
31478
- }
31479
- }
31480
- }
31481
- }
31482
- throw new Error(
31483
- `Cannot find matching ${filename} in ${options.startingFrom} or parent directories`
31484
- );
31466
+ const filenames = Array.isArray(filename) ? filename : [filename];
31467
+ const options = {
31468
+ ...defaultFindOptions,
31469
+ ..._options
31470
+ };
31471
+ const basePath = pathe_M_eThtNZ_resolve(options.startingFrom);
31472
+ const leadingSlash = basePath[0] === "/";
31473
+ const segments = basePath.split("/").filter(Boolean);
31474
+ if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
31475
+ if (leadingSlash) segments[0] = "/" + segments[0];
31476
+ let root = segments.findIndex((r) => r.match(options.rootPattern));
31477
+ if (root === -1) root = 0;
31478
+ if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename of filenames) {
31479
+ const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename);
31480
+ if (await options.test(filePath)) return filePath;
31481
+ }
31482
+ else for (let index = segments.length; index > root; index--) for (const filename of filenames) {
31483
+ const filePath = pathe_M_eThtNZ_join(...segments.slice(0, index), filename);
31484
+ if (await options.test(filePath)) return filePath;
31485
+ }
31486
+ throw new Error(`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`);
31485
31487
  }
31486
31488
  function findNearestFile(filename, options = {}) {
31487
- return findFile(filename, options);
31489
+ return findFile(filename, options);
31488
31490
  }
31489
31491
  function findFarthestFile(filename, options = {}) {
31490
- return findFile(filename, { ...options, reverse: true });
31492
+ return findFile(filename, {
31493
+ ...options,
31494
+ reverse: true
31495
+ });
31491
31496
  }
31492
-
31493
31497
  function _resolvePath(id, opts = {}) {
31494
- if (id instanceof URL || id.startsWith("file://")) {
31495
- return normalize((0,external_node_url_.fileURLToPath)(id));
31496
- }
31497
- if (isAbsolute(id)) {
31498
- return normalize(id);
31499
- }
31500
- return resolveModulePath(id, {
31501
- ...opts,
31502
- from: opts.from || opts.parent || opts.url
31503
- });
31498
+ if (id instanceof URL || id.startsWith("file://")) return normalize((0,external_node_url_.fileURLToPath)(id));
31499
+ if (isAbsolute(id)) return normalize(id);
31500
+ return resolveModulePath(id, {
31501
+ ...opts,
31502
+ from: opts.from || opts.parent || opts.url
31503
+ });
31504
31504
  }
31505
-
31506
31505
  const FileCache$1 = /* @__PURE__ */ (/* unused pure expression or super */ null && (new Map()));
31507
31506
  function defineTSConfig(tsconfig) {
31508
- return tsconfig;
31507
+ return tsconfig;
31509
31508
  }
31510
31509
  async function readTSConfig(id, options = {}) {
31511
- const resolvedPath = await resolveTSConfig(id, options);
31512
- const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache$1;
31513
- if (options.cache && cache.has(resolvedPath)) {
31514
- return cache.get(resolvedPath);
31515
- }
31516
- const text = await promises.readFile(resolvedPath, "utf8");
31517
- const parsed = parseJSONC(text);
31518
- cache.set(resolvedPath, parsed);
31519
- return parsed;
31510
+ const resolvedPath = await resolveTSConfig(id, options);
31511
+ const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache$1;
31512
+ if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
31513
+ const parsed = parseJSONC(await promises.readFile(resolvedPath, "utf8"));
31514
+ cache.set(resolvedPath, parsed);
31515
+ return parsed;
31520
31516
  }
31521
31517
  async function writeTSConfig(path, tsconfig) {
31522
- await promises.writeFile(path, stringifyJSONC(tsconfig));
31518
+ await promises.writeFile(path, stringifyJSONC(tsconfig));
31523
31519
  }
31524
31520
  async function resolveTSConfig(id = process.cwd(), options = {}) {
31525
- return findNearestFile("tsconfig.json", {
31526
- ...options,
31527
- startingFrom: _resolvePath(id, options)
31528
- });
31521
+ return findNearestFile("tsconfig.json", {
31522
+ ...options,
31523
+ startingFrom: _resolvePath(id, options)
31524
+ });
31529
31525
  }
31530
-
31531
31526
  const lockFiles = [
31532
- "yarn.lock",
31533
- "package-lock.json",
31534
- "pnpm-lock.yaml",
31535
- "npm-shrinkwrap.json",
31536
- "bun.lockb",
31537
- "bun.lock",
31538
- "deno.lock"
31527
+ "yarn.lock",
31528
+ "package-lock.json",
31529
+ "pnpm-lock.yaml",
31530
+ "npm-shrinkwrap.json",
31531
+ "bun.lockb",
31532
+ "bun.lock",
31533
+ "deno.lock"
31534
+ ];
31535
+ const packageFiles = [
31536
+ "package.json",
31537
+ "package.json5",
31538
+ "package.yaml"
31539
31539
  ];
31540
- const packageFiles = ["package.json", "package.json5", "package.yaml"];
31541
31540
  const workspaceFiles = [
31542
- "pnpm-workspace.yaml",
31543
- "lerna.json",
31544
- "turbo.json",
31545
- "rush.json",
31546
- "deno.json",
31547
- "deno.jsonc"
31541
+ "pnpm-workspace.yaml",
31542
+ "lerna.json",
31543
+ "turbo.json",
31544
+ "rush.json",
31545
+ "deno.json",
31546
+ "deno.jsonc"
31548
31547
  ];
31549
31548
  const FileCache = /* @__PURE__ */ new Map();
31550
31549
  function definePackageJSON(pkg) {
31551
- return pkg;
31550
+ return pkg;
31552
31551
  }
31553
31552
  async function findPackage(id = process.cwd(), options = {}) {
31554
- return findNearestFile(packageFiles, {
31555
- ...options,
31556
- startingFrom: _resolvePath(id, options)
31557
- });
31553
+ return findNearestFile(packageFiles, {
31554
+ ...options,
31555
+ startingFrom: _resolvePath(id, options)
31556
+ });
31558
31557
  }
31559
31558
  async function readPackage(id, options = {}) {
31560
- const resolvedPath = await findPackage(id, options);
31561
- const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
31562
- if (options.cache && cache.has(resolvedPath)) {
31563
- return cache.get(resolvedPath);
31564
- }
31565
- const blob = await promises.readFile(resolvedPath, "utf8");
31566
- let parsed;
31567
- if (resolvedPath.endsWith(".json5")) {
31568
- parsed = parseJSON5(blob);
31569
- } else if (resolvedPath.endsWith(".yaml")) {
31570
- parsed = parseYAML(blob);
31571
- } else {
31572
- try {
31573
- parsed = parseJSON(blob);
31574
- } catch {
31575
- parsed = parseJSONC(blob);
31576
- }
31577
- }
31578
- cache.set(resolvedPath, parsed);
31579
- return parsed;
31559
+ const resolvedPath = await findPackage(id, options);
31560
+ const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
31561
+ if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
31562
+ const blob = await promises.readFile(resolvedPath, "utf8");
31563
+ let parsed;
31564
+ if (resolvedPath.endsWith(".json5")) parsed = parseJSON5(blob);
31565
+ else if (resolvedPath.endsWith(".yaml")) parsed = parseYAML(blob);
31566
+ else try {
31567
+ parsed = parseJSON(blob);
31568
+ } catch {
31569
+ parsed = parseJSONC(blob);
31570
+ }
31571
+ cache.set(resolvedPath, parsed);
31572
+ return parsed;
31580
31573
  }
31581
31574
  async function writePackage(path, pkg) {
31582
- let content;
31583
- if (path.endsWith(".json5")) {
31584
- content = stringifyJSON5(pkg);
31585
- } else if (path.endsWith(".yaml")) {
31586
- content = stringifyYAML(pkg);
31587
- } else {
31588
- content = stringifyJSON(pkg);
31589
- }
31590
- await promises.writeFile(path, content);
31575
+ let content;
31576
+ if (path.endsWith(".json5")) content = stringifyJSON5(pkg);
31577
+ else if (path.endsWith(".yaml")) content = stringifyYAML(pkg);
31578
+ else content = stringifyJSON(pkg);
31579
+ await promises.writeFile(path, content);
31591
31580
  }
31592
31581
  async function readPackageJSON(id, options = {}) {
31593
- const resolvedPath = await resolvePackageJSON(id, options);
31594
- const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
31595
- if (options.cache && cache.has(resolvedPath)) {
31596
- return cache.get(resolvedPath);
31597
- }
31598
- const blob = await external_node_fs_.promises.readFile(resolvedPath, "utf8");
31599
- let parsed;
31600
- try {
31601
- parsed = json_n(blob);
31602
- } catch {
31603
- parsed = (0,jsonc.parseJSONC)(blob);
31604
- }
31605
- cache.set(resolvedPath, parsed);
31606
- return parsed;
31582
+ const resolvedPath = await resolvePackageJSON(id, options);
31583
+ const cache = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
31584
+ if (options.cache && cache.has(resolvedPath)) return cache.get(resolvedPath);
31585
+ const blob = await external_node_fs_.promises.readFile(resolvedPath, "utf8");
31586
+ let parsed;
31587
+ try {
31588
+ parsed = json_n(blob);
31589
+ } catch {
31590
+ parsed = (0,jsonc.parseJSONC)(blob);
31591
+ }
31592
+ cache.set(resolvedPath, parsed);
31593
+ return parsed;
31607
31594
  }
31608
31595
  async function writePackageJSON(path, pkg) {
31609
- await promises.writeFile(path, stringifyJSON(pkg));
31596
+ await promises.writeFile(path, stringifyJSON(pkg));
31610
31597
  }
31611
31598
  async function resolvePackageJSON(id = process.cwd(), options = {}) {
31612
- return findNearestFile("package.json", {
31613
- ...options,
31614
- startingFrom: _resolvePath(id, options)
31615
- });
31599
+ return findNearestFile("package.json", {
31600
+ ...options,
31601
+ startingFrom: _resolvePath(id, options)
31602
+ });
31616
31603
  }
31617
31604
  async function resolveLockfile(id = process.cwd(), options = {}) {
31618
- return findNearestFile(lockFiles, {
31619
- ...options,
31620
- startingFrom: _resolvePath(id, options)
31621
- });
31605
+ return findNearestFile(lockFiles, {
31606
+ ...options,
31607
+ startingFrom: _resolvePath(id, options)
31608
+ });
31622
31609
  }
31623
31610
  const workspaceTests = {
31624
- workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r)),
31625
- gitConfig: (opts) => findFile(".git/config", opts).then((r) => pathe_M_eThtNZ_resolve(r, "../..")),
31626
- lockFile: (opts) => findFile(lockFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r)),
31627
- packageJson: (opts) => findFile(packageFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r))
31611
+ workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r)),
31612
+ gitConfig: (opts) => findFile(".git/config", opts).then((r) => pathe_M_eThtNZ_resolve(r, "../..")),
31613
+ lockFile: (opts) => findFile(lockFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r)),
31614
+ packageJson: (opts) => findFile(packageFiles, opts).then((r) => pathe_M_eThtNZ_dirname(r))
31628
31615
  };
31629
31616
  async function findWorkspaceDir(id = process.cwd(), options = {}) {
31630
- const startingFrom = _resolvePath(id, options);
31631
- const tests = options.tests || ["workspaceFile", "gitConfig", "lockFile", "packageJson"];
31632
- for (const testName of tests) {
31633
- const test = workspaceTests[testName];
31634
- if (options[testName] === false || !test) {
31635
- continue;
31636
- }
31637
- const direction = options[testName] || (testName === "gitConfig" ? "closest" : "furthest");
31638
- const detected = await test({
31639
- ...options,
31640
- startingFrom,
31641
- reverse: direction === "furthest"
31642
- }).catch(() => {
31643
- });
31644
- if (detected) {
31645
- return detected;
31646
- }
31647
- }
31648
- throw new Error(`Cannot detect workspace root from ${id}`);
31617
+ const startingFrom = _resolvePath(id, options);
31618
+ const tests = options.tests || [
31619
+ "workspaceFile",
31620
+ "gitConfig",
31621
+ "lockFile",
31622
+ "packageJson"
31623
+ ];
31624
+ for (const testName of tests) {
31625
+ const test = workspaceTests[testName];
31626
+ if (options[testName] === false || !test) continue;
31627
+ const direction = options[testName] || (testName === "gitConfig" ? "closest" : "furthest");
31628
+ const detected = await test({
31629
+ ...options,
31630
+ startingFrom,
31631
+ reverse: direction === "furthest"
31632
+ }).catch(() => {});
31633
+ if (detected) return detected;
31634
+ }
31635
+ throw new Error(`Cannot detect workspace root from ${id}`);
31649
31636
  }
31650
31637
  async function updatePackage(id, callback, options = {}) {
31651
- const resolvedPath = await findPackage(id, options);
31652
- const pkg = await readPackage(id, options);
31653
- const proxy = new Proxy(pkg, {
31654
- get(target, prop) {
31655
- if (typeof prop === "string" && objectKeys.has(prop) && !Object.hasOwn(target, prop)) {
31656
- target[prop] = {};
31657
- }
31658
- return Reflect.get(target, prop);
31659
- }
31660
- });
31661
- const updated = await callback(proxy) || pkg;
31662
- await writePackage(resolvedPath, updated);
31638
+ const resolvedPath = await findPackage(id, options);
31639
+ const pkg = await readPackage(id, options);
31640
+ await writePackage(resolvedPath, await callback(new Proxy(pkg, { get(target, prop) {
31641
+ if (typeof prop === "string" && objectKeys.has(prop) && !Object.hasOwn(target, prop)) target[prop] = {};
31642
+ return Reflect.get(target, prop);
31643
+ } })) || pkg);
31663
31644
  }
31664
31645
  function sortPackage(pkg) {
31665
- const sorted = {};
31666
- const originalKeys = Object.keys(pkg);
31667
- const knownKeysPresent = defaultFieldOrder.filter(
31668
- (key) => Object.hasOwn(pkg, key)
31669
- );
31670
- for (const key of originalKeys) {
31671
- const currentIndex = knownKeysPresent.indexOf(key);
31672
- if (currentIndex === -1) {
31673
- sorted[key] = pkg[key];
31674
- continue;
31675
- }
31676
- for (let i = 0; i <= currentIndex; i++) {
31677
- const knownKey = knownKeysPresent[i];
31678
- if (!Object.hasOwn(sorted, knownKey)) {
31679
- sorted[knownKey] = pkg[knownKey];
31680
- }
31681
- }
31682
- }
31683
- for (const key of [...dependencyKeys, "scripts"]) {
31684
- const value = sorted[key];
31685
- if (dist_isObject(value)) {
31686
- sorted[key] = sortObject(value);
31687
- }
31688
- }
31689
- return sorted;
31646
+ const sorted = {};
31647
+ const originalKeys = Object.keys(pkg);
31648
+ const knownKeysPresent = defaultFieldOrder.filter((key) => Object.hasOwn(pkg, key));
31649
+ for (const key of originalKeys) {
31650
+ const currentIndex = knownKeysPresent.indexOf(key);
31651
+ if (currentIndex === -1) {
31652
+ sorted[key] = pkg[key];
31653
+ continue;
31654
+ }
31655
+ for (let i = 0; i <= currentIndex; i++) {
31656
+ const knownKey = knownKeysPresent[i];
31657
+ if (!Object.hasOwn(sorted, knownKey)) sorted[knownKey] = pkg[knownKey];
31658
+ }
31659
+ }
31660
+ for (const key of [...dependencyKeys, "scripts"]) {
31661
+ const value = sorted[key];
31662
+ if (dist_isObject(value)) sorted[key] = sortObject(value);
31663
+ }
31664
+ return sorted;
31690
31665
  }
31691
31666
  function normalizePackage(pkg) {
31692
- const normalized = sortPackage(pkg);
31693
- for (const key of dependencyKeys) {
31694
- if (!Object.hasOwn(normalized, key)) {
31695
- continue;
31696
- }
31697
- const value = normalized[key];
31698
- if (!dist_isObject(value)) {
31699
- delete normalized[key];
31700
- }
31701
- }
31702
- return normalized;
31667
+ const normalized = sortPackage(pkg);
31668
+ for (const key of dependencyKeys) {
31669
+ if (!Object.hasOwn(normalized, key)) continue;
31670
+ const value = normalized[key];
31671
+ if (!dist_isObject(value)) delete normalized[key];
31672
+ }
31673
+ return normalized;
31703
31674
  }
31704
31675
  function dist_isObject(value) {
31705
- return typeof value === "object" && value !== null && !Array.isArray(value);
31676
+ return typeof value === "object" && value !== null && !Array.isArray(value);
31706
31677
  }
31707
31678
  function sortObject(obj) {
31708
- return Object.fromEntries(
31709
- Object.entries(obj).sort(([a], [b]) => a.localeCompare(b))
31710
- );
31679
+ return Object.fromEntries(Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)));
31711
31680
  }
31712
31681
  const dependencyKeys = (/* unused pure expression or super */ null && ([
31713
- "dependencies",
31714
- "devDependencies",
31715
- "optionalDependencies",
31716
- "peerDependencies"
31682
+ "dependencies",
31683
+ "devDependencies",
31684
+ "optionalDependencies",
31685
+ "peerDependencies"
31717
31686
  ]));
31718
- const objectKeys = /* @__PURE__ */ (/* unused pure expression or super */ null && (new Set([
31719
- "typesVersions",
31720
- "scripts",
31721
- "resolutions",
31722
- "overrides",
31723
- "dependencies",
31724
- "devDependencies",
31725
- "dependenciesMeta",
31726
- "peerDependencies",
31727
- "peerDependenciesMeta",
31728
- "optionalDependencies",
31729
- "engines",
31730
- "publishConfig"
31731
- ])));
31687
+ const objectKeys = new Set([
31688
+ "typesVersions",
31689
+ "scripts",
31690
+ "resolutions",
31691
+ "overrides",
31692
+ "dependencies",
31693
+ "devDependencies",
31694
+ "dependenciesMeta",
31695
+ "peerDependencies",
31696
+ "peerDependenciesMeta",
31697
+ "optionalDependencies",
31698
+ "engines",
31699
+ "publishConfig"
31700
+ ]);
31732
31701
  const defaultFieldOrder = (/* unused pure expression or super */ null && ([
31733
- "$schema",
31734
- "name",
31735
- "version",
31736
- "private",
31737
- "description",
31738
- "keywords",
31739
- "homepage",
31740
- "bugs",
31741
- "repository",
31742
- "funding",
31743
- "license",
31744
- "author",
31745
- "sideEffects",
31746
- "type",
31747
- "imports",
31748
- "exports",
31749
- "main",
31750
- "module",
31751
- "browser",
31752
- "types",
31753
- "typesVersions",
31754
- "typings",
31755
- "bin",
31756
- "man",
31757
- "files",
31758
- "workspaces",
31759
- "scripts",
31760
- "resolutions",
31761
- "overrides",
31762
- "dependencies",
31763
- "devDependencies",
31764
- "dependenciesMeta",
31765
- "peerDependencies",
31766
- "peerDependenciesMeta",
31767
- "optionalDependencies",
31768
- "bundledDependencies",
31769
- "bundleDependencies",
31770
- "packageManager",
31771
- "engines",
31772
- "publishConfig"
31702
+ "$schema",
31703
+ "name",
31704
+ "version",
31705
+ "private",
31706
+ "description",
31707
+ "keywords",
31708
+ "homepage",
31709
+ "bugs",
31710
+ "repository",
31711
+ "funding",
31712
+ "license",
31713
+ "author",
31714
+ "sideEffects",
31715
+ "type",
31716
+ "imports",
31717
+ "exports",
31718
+ "main",
31719
+ "module",
31720
+ "browser",
31721
+ "types",
31722
+ "typesVersions",
31723
+ "typings",
31724
+ "bin",
31725
+ "man",
31726
+ "files",
31727
+ "workspaces",
31728
+ "scripts",
31729
+ "resolutions",
31730
+ "overrides",
31731
+ "dependencies",
31732
+ "devDependencies",
31733
+ "dependenciesMeta",
31734
+ "peerDependencies",
31735
+ "peerDependenciesMeta",
31736
+ "optionalDependencies",
31737
+ "bundledDependencies",
31738
+ "bundleDependencies",
31739
+ "packageManager",
31740
+ "engines",
31741
+ "publishConfig"
31773
31742
  ]));
31774
-
31775
31743
  function defineGitConfig(config) {
31776
- return config;
31744
+ return config;
31777
31745
  }
31778
31746
  async function resolveGitConfig(dir, opts) {
31779
- return findNearestFile(".git/config", { ...opts, startingFrom: dir });
31747
+ return findNearestFile(".git/config", {
31748
+ ...opts,
31749
+ startingFrom: dir
31750
+ });
31780
31751
  }
31781
31752
  async function readGitConfig(dir, opts) {
31782
- const path = await resolveGitConfig(dir, opts);
31783
- const ini = await readFile(path, "utf8");
31784
- return parseGitConfig(ini);
31753
+ return parseGitConfig(await readFile(await resolveGitConfig(dir, opts), "utf8"));
31785
31754
  }
31786
31755
  async function writeGitConfig(path, config) {
31787
- await writeFile(path, stringifyGitConfig(config));
31756
+ await writeFile(path, stringifyGitConfig(config));
31788
31757
  }
31789
31758
  function parseGitConfig(ini) {
31790
- return parseINI(ini.replaceAll(/^\[(\w+) "(.+)"\]$/gm, "[$1.$2]"));
31759
+ return parseINI(ini.replaceAll(/^\[(\w+) "(.+)"\]$/gm, "[$1.$2]"));
31791
31760
  }
31792
31761
  function stringifyGitConfig(config) {
31793
- return stringifyINI(config).replaceAll(/^\[(\w+)\.(\w+)\]$/gm, '[$1 "$2"]');
31762
+ return stringifyINI(config).replaceAll(/^\[(\w+)\.(\w+)\]$/gm, "[$1 \"$2\"]");
31794
31763
  }
31795
31764
 
31796
31765
 
31797
-
31798
31766
  ;// CONCATENATED MODULE: ../../node_modules/c12/dist/index.mjs
31799
31767
 
31800
31768
 
@@ -32165,7 +32133,7 @@ async function watchConfig(options) {
32165
32133
  options.rcFile && resolve(l.cwd, typeof options.rcFile === "string" ? options.rcFile : `.${configName}rc`),
32166
32134
  options.packageJson && resolve(l.cwd, "package.json")
32167
32135
  ]).filter(Boolean))];
32168
- const watch = await __webpack_require__.e(/* import() */ 27).then(__webpack_require__.bind(__webpack_require__, 9774)).then((r) => r.watch || r.default || r);
32136
+ const watch = await __webpack_require__.e(/* import() */ 475).then(__webpack_require__.bind(__webpack_require__, 4710)).then((r) => r.watch || r.default || r);
32169
32137
  const { diff } = await __webpack_require__.e(/* import() */ 164).then(__webpack_require__.bind(__webpack_require__, 263));
32170
32138
  const _fswatcher = watch(watchingFiles, {
32171
32139
  ignoreInitial: true,
@@ -42371,7 +42339,7 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
42371
42339
  // module factories are used so entry inlining is disabled
42372
42340
  // startup
42373
42341
  // Load entry module and return exports
42374
- var __webpack_exports__ = __webpack_require__(9491);
42342
+ var __webpack_exports__ = __webpack_require__(5144);
42375
42343
  var __webpack_exports__DEFAULT_LINT_RULES = __webpack_exports__.Kd;
42376
42344
  var __webpack_exports__LintValidationError = __webpack_exports__.F5;
42377
42345
  var __webpack_exports__createFormatter = __webpack_exports__.xi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/lint",
3
- "version": "5.13.6",
3
+ "version": "5.14.0",
4
4
  "description": "Programmatic lint API for validating AI coding assistant configurations — skills, agents, hooks, and instructions",
5
5
  "type": "module",
6
6
  "repository": {