@gosukiwi/eslint-plugin-colocate 0.0.2 → 0.1.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.
- package/README.md +10 -10
- package/dist/lib/{findings.d.ts → findings/findings.d.ts} +1 -1
- package/dist/lib/{findings.js → findings/findings.js} +3 -3
- package/dist/lib/{graph-cache.d.ts → findings/graph-cache.d.ts} +1 -1
- package/dist/lib/{graph-cache.js → findings/graph-cache.js} +5 -5
- package/dist/lib/findings/index.d.ts +5 -0
- package/dist/lib/findings/index.js +5 -0
- package/dist/lib/{owners.d.ts → findings/owners.d.ts} +1 -1
- package/dist/lib/{owners.js → findings/owners.js} +59 -17
- package/dist/lib/{root.js → findings/root.js} +1 -1
- package/dist/lib/{subject.d.ts → findings/subject.d.ts} +1 -1
- package/dist/lib/{subject.js → findings/subject.js} +2 -2
- package/dist/lib/graph.js +2 -2
- package/dist/lib/{gates.d.ts → named-door/gates.d.ts} +1 -1
- package/dist/lib/{gates.js → named-door/gates.js} +2 -2
- package/dist/lib/named-door/index.d.ts +2 -0
- package/dist/lib/named-door/index.js +2 -0
- package/dist/lib/{named-door.d.ts → named-door/named-door.d.ts} +1 -1
- package/dist/lib/{named-door.js → named-door/named-door.js} +6 -8
- package/dist/lib/resolve.js +3 -1
- package/dist/rules/entry.js +4 -8
- package/dist/rules/ownership.js +1 -2
- package/package.json +9 -2
- /package/dist/lib/{root.d.ts → findings/root.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -115,20 +115,20 @@ 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.
|
|
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.
|
|
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
|
|
|
122
122
|
## What it reports
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
_This covers `colocate/ownership`'s findings. `colocate/entry` reports `reachesPastEntry` and `namedDoorReexport` — see [The entry rule](#the-entry-rule)._
|
|
125
125
|
|
|
126
|
-
| message
|
|
127
|
-
|
|
|
128
|
-
| `privateOutsideOwner` | One owner imports this file, and it sits outside that owner's folder.
|
|
129
|
-
| `sharedTooHigh`
|
|
130
|
-
| `sharedInsideOwner`
|
|
131
|
-
| `singletonFolder`
|
|
126
|
+
| message | meaning | usual fix |
|
|
127
|
+
| --------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
128
|
+
| `privateOutsideOwner` | One owner imports this file, and it sits outside that owner's folder. | Move it inside the folder, or convert the owner into a folder with a matching entry file. |
|
|
129
|
+
| `sharedTooHigh` | Several owners import it, and it sits above their common ancestor. | Move it down to the common ancestor. |
|
|
130
|
+
| `sharedInsideOwner` | Several owners import it, and it sits inside one of theirs. | Hoist it to the common ancestor. |
|
|
131
|
+
| `singletonFolder` | A directory holds a single source file named after the directory (or `index`), and no stylesheet beside it. | Flatten the directory, or colocate something with the file. |
|
|
132
132
|
|
|
133
133
|
`singletonFolder` looks for a companion stylesheet only in the same directory (`.css`, `.scss`, `.sass`, `.less`, `.styl`).
|
|
134
134
|
|
|
@@ -136,7 +136,7 @@ An `index` that re-exports two or more siblings is a namespace barrel and is lef
|
|
|
136
136
|
|
|
137
137
|
## Options
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
_These apply to `colocate/ownership`. See [The entry rule](#the-entry-rule) for `colocate/entry`'s options._ Unknown option names are rejected.
|
|
140
140
|
|
|
141
141
|
### `root`
|
|
142
142
|
|
|
@@ -155,7 +155,7 @@ Only the layer's own files and each child folder's entry (`Button/Button.ts` or
|
|
|
155
155
|
This is also how a deeper app shell is described:
|
|
156
156
|
|
|
157
157
|
```js
|
|
158
|
-
layers: ["src", "src/pages"] // top-level modules and pages are public peers
|
|
158
|
+
layers: ["src", "src/pages"]; // top-level modules and pages are public peers
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
### `ignore`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { derivedFromGraph } from "
|
|
3
|
-
import { classifyDirEntry, safeReaddir, safeStat } from "
|
|
2
|
+
import { derivedFromGraph } from "../derived.js";
|
|
3
|
+
import { classifyDirEntry, safeReaddir, safeStat } from "../fs-safe.js";
|
|
4
4
|
import { getSharedColocationIssue, isPrivateOutsideOwner, resolveLayerDirectories, } from "./owners.js";
|
|
5
|
-
import { isSourceFile, isTestFile, matchesIgnore, SKIP_DIRS, } from "
|
|
5
|
+
import { isSourceFile, isTestFile, matchesIgnore, SKIP_DIRS, } from "../scope.js";
|
|
6
6
|
const singletonStatsByGraph = derivedFromGraph(() => new Map());
|
|
7
7
|
const STYLESHEET_EXTS = [".css", ".scss", ".sass", ".less", ".styl"];
|
|
8
8
|
function isStylesheet(filePath) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Graph } from "
|
|
1
|
+
import { type Graph } from "../graph.js";
|
|
2
2
|
export type VisitToken = object;
|
|
3
3
|
export declare const REVALIDATE_AFTER_MS = 100;
|
|
4
4
|
export declare function stampIsAmbiguous(mtimeMs: number, builtAt: number, coarseTimestamps: boolean, stampedAt: number): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { safeRealpath, safeStat } from "
|
|
3
|
-
import { buildGraphFromFiles } from "
|
|
4
|
-
import { findTsconfig } from "
|
|
5
|
-
import { isInGraphScope, isSourceFile } from "
|
|
6
|
-
import { collectSourceFiles } from "
|
|
2
|
+
import { safeRealpath, safeStat } from "../fs-safe.js";
|
|
3
|
+
import { buildGraphFromFiles } from "../graph.js";
|
|
4
|
+
import { findTsconfig } from "../resolve.js";
|
|
5
|
+
import { isInGraphScope, isSourceFile } from "../scope.js";
|
|
6
|
+
import { collectSourceFiles } from "../walk.js";
|
|
7
7
|
export const REVALIDATE_AFTER_MS = 100;
|
|
8
8
|
let cache;
|
|
9
9
|
function cacheKey(rootDir, ignoreGlobs) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ownershipFindings, singletonDirectoryStats, type OwnershipFinding, type SingletonDirectoryStats, } from "./findings.js";
|
|
2
|
+
export { getGraph, REVALIDATE_AFTER_MS, stampIsAmbiguous, type VisitToken, } from "./graph-cache.js";
|
|
3
|
+
export { collectLayerDirectories, collectReExports, getColocationConsumers, getOwner, getSharedColocationIssue, getShells, isLayerPublicModule, isPrivateOutsideOwner, resolveLayerDirectories, shouldSkipColocation, type Owner, type OwnershipContext, } from "./owners.js";
|
|
4
|
+
export { resolveRootDir } from "./root.js";
|
|
5
|
+
export { resolveSubject, resolvedLintRoot, type Subject } from "./subject.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ownershipFindings, singletonDirectoryStats, } from "./findings.js";
|
|
2
|
+
export { getGraph, REVALIDATE_AFTER_MS, stampIsAmbiguous, } from "./graph-cache.js";
|
|
3
|
+
export { collectLayerDirectories, collectReExports, getColocationConsumers, getOwner, getSharedColocationIssue, getShells, isLayerPublicModule, isPrivateOutsideOwner, resolveLayerDirectories, shouldSkipColocation, } from "./owners.js";
|
|
4
|
+
export { resolveRootDir } from "./root.js";
|
|
5
|
+
export { resolveSubject, resolvedLintRoot } from "./subject.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { minimatch } from "minimatch";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
-
import { derivedFromGraph } from "
|
|
5
|
-
import { safeReadFile, safeReaddir, safeRealpath } from "
|
|
6
|
-
import { canonicalGraphPath, getGraphResolutionSettings, graphFilesInDir, } from "
|
|
7
|
-
import { parseSourceFile } from "
|
|
8
|
-
import { isInsideDir } from "
|
|
9
|
-
import { resolveSpecifier } from "
|
|
10
|
-
import { SKIP_DIRS } from "
|
|
4
|
+
import { derivedFromGraph } from "../derived.js";
|
|
5
|
+
import { safeReadFile, safeReaddir, safeRealpath } from "../fs-safe.js";
|
|
6
|
+
import { canonicalGraphPath, getGraphResolutionSettings, graphFilesInDir, } from "../graph.js";
|
|
7
|
+
import { parseSourceFile } from "../parse.js";
|
|
8
|
+
import { isInsideDir } from "../paths.js";
|
|
9
|
+
import { resolveSpecifier } from "../resolve.js";
|
|
10
|
+
import { SKIP_DIRS } from "../scope.js";
|
|
11
11
|
const reExportsByGraph = derivedFromGraph(() => new Map());
|
|
12
12
|
function scanReExports(indexFile, dir, graph) {
|
|
13
13
|
const content = safeReadFile(indexFile);
|
|
@@ -55,7 +55,7 @@ function isNamespaceBarrel(filePath, graph) {
|
|
|
55
55
|
if (basename !== "index") {
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return collectReExports(filePath, path.dirname(filePath), graph).length >= 2;
|
|
59
59
|
}
|
|
60
60
|
function isOwnerEntryFile(file, dir, graph) {
|
|
61
61
|
if (path.dirname(file) !== dir) {
|
|
@@ -211,9 +211,24 @@ export const getShells = derivedFromGraph((graph) => {
|
|
|
211
211
|
}
|
|
212
212
|
return shells;
|
|
213
213
|
});
|
|
214
|
+
function partitionImporters(filePath, graph, shells) {
|
|
215
|
+
const consumers = [];
|
|
216
|
+
const shellVoices = [];
|
|
217
|
+
for (const importer of graph.importers.get(filePath) ?? []) {
|
|
218
|
+
if (isNamespaceBarrel(importer, graph)) {
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if (shells.has(importer)) {
|
|
222
|
+
shellVoices.push(importer);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
consumers.push(importer);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return { consumers, shellVoices };
|
|
229
|
+
}
|
|
214
230
|
export function getColocationConsumers(filePath, graph, shells) {
|
|
215
|
-
|
|
216
|
-
return importers.filter((importer) => !shells.has(importer) && !isNamespaceBarrel(importer, graph));
|
|
231
|
+
return partitionImporters(filePath, graph, shells).consumers;
|
|
217
232
|
}
|
|
218
233
|
function collectLayerDirs(dir, cwd, rootDir, layerGlobs, out) {
|
|
219
234
|
for (const entry of safeReaddir(dir)) {
|
|
@@ -301,6 +316,9 @@ export function isPrivateOutsideOwner(filePath, ctx) {
|
|
|
301
316
|
if (owners.size !== 1) {
|
|
302
317
|
return false;
|
|
303
318
|
}
|
|
319
|
+
if (collectExtraShellOwners(filePath, ctx, owners).size >= 2) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
304
322
|
const owner = owners.values().next().value;
|
|
305
323
|
if (owner === undefined) {
|
|
306
324
|
return false;
|
|
@@ -350,14 +368,21 @@ function folderOwnerAncestors(filePath, graph, rootDir) {
|
|
|
350
368
|
}
|
|
351
369
|
return dirs;
|
|
352
370
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
|
|
371
|
+
function shellVoiceImporters(filePath, graph, shells) {
|
|
372
|
+
return partitionImporters(filePath, graph, shells).shellVoices;
|
|
373
|
+
}
|
|
374
|
+
function collectExtraShellOwners(filePath, ctx, countedOwners) {
|
|
375
|
+
const shells = getShells(ctx.graph);
|
|
376
|
+
const extra = new Map();
|
|
377
|
+
for (const importer of shellVoiceImporters(filePath, ctx.graph, shells)) {
|
|
378
|
+
const owner = getOwner(importer, ctx.graph, ctx.rootDir);
|
|
379
|
+
if (!countedOwners.has(owner.path) && !extra.has(owner.path)) {
|
|
380
|
+
extra.set(owner.path, owner);
|
|
381
|
+
}
|
|
360
382
|
}
|
|
383
|
+
return extra;
|
|
384
|
+
}
|
|
385
|
+
function evaluateSharedPosition(filePath, ctx, owners) {
|
|
361
386
|
const ownerDirs = [...new Set([...owners.values()].map(ownerDir))];
|
|
362
387
|
const lca = longestCommonAncestor(ownerDirs);
|
|
363
388
|
const consumerFolderDirs = [...owners.values()]
|
|
@@ -384,3 +409,20 @@ export function getSharedColocationIssue(filePath, ctx) {
|
|
|
384
409
|
}
|
|
385
410
|
return undefined;
|
|
386
411
|
}
|
|
412
|
+
export function getSharedColocationIssue(filePath, ctx) {
|
|
413
|
+
if (shouldSkipColocation(filePath, ctx)) {
|
|
414
|
+
return undefined;
|
|
415
|
+
}
|
|
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
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { safeStat } from "
|
|
2
|
+
import { safeStat } from "../fs-safe.js";
|
|
3
3
|
function isProjectBoundary(dir) {
|
|
4
4
|
return (safeStat(path.join(dir, "package.json")) !== undefined ||
|
|
5
5
|
safeStat(path.join(dir, ".git")) !== undefined);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { safeRealpath } from "
|
|
2
|
+
import { safeRealpath } from "../fs-safe.js";
|
|
3
3
|
import { getGraph } from "./graph-cache.js";
|
|
4
4
|
import { resolveRootDir } from "./root.js";
|
|
5
|
-
import { isInGraphScope, isSourceFile } from "
|
|
5
|
+
import { isInGraphScope, isSourceFile } from "../scope.js";
|
|
6
6
|
const resolvedLintRoots = new Map();
|
|
7
7
|
const fileRealpathsByParse = new WeakMap();
|
|
8
8
|
export function resolvedLintRoot(cwd, rootOption) {
|
package/dist/lib/graph.js
CHANGED
|
@@ -3,7 +3,7 @@ import ts from "typescript";
|
|
|
3
3
|
import { derivedFromGraph } from "./derived.js";
|
|
4
4
|
import { safeReadFile, safeRealpath } from "./fs-safe.js";
|
|
5
5
|
import { extractSpecifiers } from "./parse.js";
|
|
6
|
-
import { createResolutionSettings, resolveSpecifier } from "./resolve.js";
|
|
6
|
+
import { createResolutionSettings, resolveSpecifier, } from "./resolve.js";
|
|
7
7
|
import { collectSourceFiles } from "./walk.js";
|
|
8
8
|
const graphFileSet = derivedFromGraph((graph) => new Set(graph.files));
|
|
9
9
|
export function graphHasFile(graph, filePath) {
|
|
@@ -54,7 +54,7 @@ function noProjectResolutionSettings() {
|
|
|
54
54
|
configPaths: [],
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
export const getGraphResolutionSettings = derivedFromGraph((
|
|
57
|
+
export const getGraphResolutionSettings = derivedFromGraph(() => noProjectResolutionSettings());
|
|
58
58
|
export function buildGraph(rootDir, ignoreGlobs) {
|
|
59
59
|
return buildGraphWithConfigs(rootDir, ignoreGlobs).graph;
|
|
60
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Graph } from "
|
|
1
|
+
import type { Graph } from "../graph.js";
|
|
2
2
|
export declare function isEntryFile(filePath: string): boolean;
|
|
3
3
|
export declare const getGates: ((graph: Graph) => ReadonlyMap<string, string>) & {
|
|
4
4
|
prime: (graph: Graph, value: ReadonlyMap<string, string>) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { derivedFromGraph } from "
|
|
3
|
-
import { isInsideDir } from "
|
|
2
|
+
import { derivedFromGraph } from "../derived.js";
|
|
3
|
+
import { isInsideDir } from "../paths.js";
|
|
4
4
|
export function isEntryFile(filePath) {
|
|
5
5
|
const base = path.basename(filePath, path.extname(filePath));
|
|
6
6
|
return base === "index" || base === path.basename(path.dirname(filePath));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Graph } from "
|
|
1
|
+
import { type Graph } from "../graph.js";
|
|
2
2
|
export declare function isNamedDoor(filePath: string): boolean;
|
|
3
3
|
export declare function namedDoorReexports(filePath: string, graph: Graph, content?: string): readonly {
|
|
4
4
|
target: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { isEntryFile } from "./gates.js";
|
|
4
|
-
import { safeReadFile } from "
|
|
5
|
-
import { canonicalGraphPath, getGraphResolutionSettings, graphHasFile, } from "
|
|
6
|
-
import { parseSourceFile, stringLiteralText } from "
|
|
7
|
-
import { scopeBindsRequire } from "
|
|
8
|
-
import { resolveSpecifier } from "
|
|
4
|
+
import { safeReadFile } from "../fs-safe.js";
|
|
5
|
+
import { canonicalGraphPath, getGraphResolutionSettings, graphHasFile, } from "../graph.js";
|
|
6
|
+
import { parseSourceFile, stringLiteralText } from "../parse.js";
|
|
7
|
+
import { scopeBindsRequire } from "../require-binding.js";
|
|
8
|
+
import { resolveSpecifier } from "../resolve.js";
|
|
9
9
|
export function isNamedDoor(filePath) {
|
|
10
10
|
if (!isEntryFile(filePath)) {
|
|
11
11
|
return false;
|
|
@@ -321,9 +321,7 @@ export function namedDoorReexports(filePath, graph, content) {
|
|
|
321
321
|
if (!isNamedDoor(filePath)) {
|
|
322
322
|
return [];
|
|
323
323
|
}
|
|
324
|
-
const source = typeof content === "string"
|
|
325
|
-
? content
|
|
326
|
-
: safeReadFile(filePath);
|
|
324
|
+
const source = typeof content === "string" ? content : safeReadFile(filePath);
|
|
327
325
|
if (source === undefined) {
|
|
328
326
|
return [];
|
|
329
327
|
}
|
package/dist/lib/resolve.js
CHANGED
|
@@ -128,7 +128,9 @@ function aliasCandidates(specifier, options) {
|
|
|
128
128
|
const targetStar = target.indexOf("*");
|
|
129
129
|
const mapped = targetStar === -1
|
|
130
130
|
? target
|
|
131
|
-
: target.slice(0, targetStar) +
|
|
131
|
+
: target.slice(0, targetStar) +
|
|
132
|
+
matched +
|
|
133
|
+
target.slice(targetStar + 1);
|
|
132
134
|
return path.resolve(base, mapped);
|
|
133
135
|
});
|
|
134
136
|
}
|
package/dist/rules/entry.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { findCrossedGate } from "../lib/
|
|
3
|
-
import { canonicalGraphPath, getGraphResolutionSettings } from "../lib/graph.js";
|
|
4
|
-
import { isNamedDoor, namedDoorReexports } from "../lib/named-door.js";
|
|
2
|
+
import { findCrossedGate, isNamedDoor, namedDoorReexports, } from "../lib/named-door/index.js";
|
|
3
|
+
import { canonicalGraphPath, getGraphResolutionSettings, } from "../lib/graph.js";
|
|
5
4
|
import { requireIsShadowed } from "../lib/require-binding.js";
|
|
6
5
|
import { resolveSpecifier } from "../lib/resolve.js";
|
|
7
|
-
import { resolveSubject } from "../lib/
|
|
6
|
+
import { resolveSubject } from "../lib/findings/index.js";
|
|
8
7
|
function staticSpecifier(source) {
|
|
9
8
|
if (source.type === "Literal") {
|
|
10
9
|
return typeof source.value === "string" ? source.value : undefined;
|
|
@@ -57,10 +56,7 @@ const rule = {
|
|
|
57
56
|
return {};
|
|
58
57
|
}
|
|
59
58
|
const reexportsByPos = isNamedDoor(subject.file)
|
|
60
|
-
? new Map(namedDoorReexports(subject.file, subject.graph(), context.sourceCode.getText()).map((reexport) => [
|
|
61
|
-
reexport.pos,
|
|
62
|
-
reexport.target,
|
|
63
|
-
]))
|
|
59
|
+
? new Map(namedDoorReexports(subject.file, subject.graph(), context.sourceCode.getText()).map((reexport) => [reexport.pos, reexport.target]))
|
|
64
60
|
: undefined;
|
|
65
61
|
const reportNamedDoorReexport = (node) => {
|
|
66
62
|
if (reexportsByPos === undefined) {
|
package/dist/rules/ownership.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gosukiwi/eslint-plugin-colocate",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
26
|
"check:placement": "vite-node scripts/check-placement.ts",
|
|
27
|
-
"crap": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov && crap4ts src --coverage ./coverage/lcov.info --max-crap 15"
|
|
27
|
+
"crap": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov && crap4ts src --coverage ./coverage/lcov.info --max-crap 15",
|
|
28
|
+
"format": "prettier --write .",
|
|
29
|
+
"format:check": "prettier --check .",
|
|
30
|
+
"lint": "eslint . --max-warnings 0"
|
|
28
31
|
},
|
|
29
32
|
"peerDependencies": {
|
|
30
33
|
"eslint": ">=9"
|
|
@@ -34,12 +37,16 @@
|
|
|
34
37
|
"typescript": "^5 || ^6"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^10.0.1",
|
|
37
41
|
"@gosukiwi/crap4ts": "^0.2.2",
|
|
42
|
+
"@gosukiwi/eslint-plugin-colocate": "^0.0.2",
|
|
38
43
|
"@types/node": "^22.15.29",
|
|
39
44
|
"@typescript-eslint/parser": "^8",
|
|
40
45
|
"@vitest/coverage-v8": "^3.2.7",
|
|
41
46
|
"eslint": "^10",
|
|
47
|
+
"prettier": "^3.9.6",
|
|
42
48
|
"typescript": "^5 || ^6",
|
|
49
|
+
"typescript-eslint": "^8.70.0",
|
|
43
50
|
"vitest": "^3"
|
|
44
51
|
}
|
|
45
52
|
}
|
|
File without changes
|