@gosukiwi/eslint-plugin-colocate 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -115,7 +115,7 @@ The plugin builds an import graph over `root` and checks that each file's locati
115
115
 
116
116
  A folder's own entry file is never flagged for sitting in its own folder. If the folder itself is in the wrong place, the folders above it report that.
117
117
 
118
- **The app shell.** Entry points (files nothing imports) and what they import directly do not own those imports. So `main.ts → App.ts → pages/Home/Home.ts` leaves `Home` where it is, with no configuration. Shells still vote on shared placement: one owner plus shell importers from two or more other owners reports shared, never private; a single shell co-user keeps the private verdict.
118
+ **The app shell.** Entry points (files nothing imports) and what they import directly do not own those imports. So `main.ts → App.ts → pages/Home/Home.ts` leaves `Home` where it is, with no configuration. Shells still vote on shared placement: if a shell importer belongs to a different owner than the file's other importers, the file counts as shared, never private.
119
119
 
120
120
  For a longer bootstrap chain (`main → router → App → pages/...`), or a shell that imports loose top-level modules, declare those directories as `layers`.
121
121
 
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import ownership from "./rules/ownership.js";
3
3
  export default {
4
4
  meta: {
5
5
  name: "@gosukiwi/eslint-plugin-colocate",
6
- version: "0.0.2",
6
+ version: "0.2.1",
7
7
  },
8
8
  rules: {
9
9
  entry,
@@ -316,7 +316,7 @@ export function isPrivateOutsideOwner(filePath, ctx) {
316
316
  if (owners.size !== 1) {
317
317
  return false;
318
318
  }
319
- if (collectExtraShellOwners(filePath, ctx, owners).size >= 2) {
319
+ if (collectExtraShellOwners(filePath, ctx, owners).size > 0) {
320
320
  return false;
321
321
  }
322
322
  const owner = owners.values().next().value;
@@ -414,15 +414,15 @@ export function getSharedColocationIssue(filePath, ctx) {
414
414
  return undefined;
415
415
  }
416
416
  const owners = collectConsumerOwners(filePath, ctx);
417
- if (owners.size >= 2) {
418
- return evaluateSharedPosition(filePath, ctx, owners);
419
- }
420
- if (owners.size === 1) {
421
- const extra = collectExtraShellOwners(filePath, ctx, owners);
422
- if (extra.size >= 2) {
423
- const merged = new Map([...owners, ...extra]);
424
- return evaluateSharedPosition(filePath, ctx, merged);
425
- }
417
+ if (owners.size === 0) {
418
+ return undefined;
426
419
  }
427
- return undefined;
420
+ const merged = new Map([
421
+ ...owners,
422
+ ...collectExtraShellOwners(filePath, ctx, owners),
423
+ ]);
424
+ if (merged.size < 2) {
425
+ return undefined;
426
+ }
427
+ return evaluateSharedPosition(filePath, ctx, merged);
428
428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gosukiwi/eslint-plugin-colocate",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,20 +33,25 @@
33
33
  "eslint": ">=9"
34
34
  },
35
35
  "dependencies": {
36
- "minimatch": "^10",
36
+ "minimatch": "^11.0.9",
37
37
  "typescript": "^5 || ^6"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@eslint/js": "^10.0.1",
41
41
  "@gosukiwi/crap4ts": "^0.2.2",
42
- "@gosukiwi/eslint-plugin-colocate": "^0.0.2",
42
+ "@gosukiwi/eslint-plugin-colocate": "^0.1.0",
43
43
  "@types/node": "^22.15.29",
44
44
  "@typescript-eslint/parser": "^8",
45
- "@vitest/coverage-v8": "^3.2.7",
45
+ "@vitest/coverage-v8": "^5.1.1",
46
46
  "eslint": "^10",
47
47
  "prettier": "^3.9.6",
48
48
  "typescript": "^5 || ^6",
49
49
  "typescript-eslint": "^8.70.0",
50
- "vitest": "^3"
50
+ "vitest": "^5.1.1"
51
+ },
52
+ "overrides": {
53
+ "@gosukiwi/eslint-plugin-colocate": {
54
+ "minimatch": "$minimatch"
55
+ }
51
56
  }
52
57
  }