Skip to content

Commit 049470a

Browse files
committed
refactor: rename modules/lint.ts to modules/check.ts
- Rename file to clarify its purpose (quality checks, not code linting) - Update all function names: lint* → check* - lintStaged → checkStaged - lintProject → checkProject - lintDependencies → checkDependencies - lintStructure → checkStructure - lintDocs → checkDocs - lintAll → checkAll - Update imports in commands/check.ts - Update imports in core.ts and index.ts - Improve naming consistency with CLI commands - Clarify architecture: linters/ formatters/ are drivers, modules/check is for quality checks
1 parent 3ce83a4 commit 049470a

4 files changed

Lines changed: 33 additions & 33 deletions

File tree

packages/basis/src/commands/check.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { defineCommand } from "citty";
22
import { consola } from "consola";
33
import {
4-
lintAll,
5-
lintDependencies,
6-
lintDocs,
7-
lintProject,
8-
lintStaged,
9-
lintStructure,
10-
} from "../modules/lint";
4+
checkAll,
5+
checkDependencies,
6+
checkDocs,
7+
checkProject,
8+
checkStaged,
9+
checkStructure,
10+
} from "../modules/check";
1111

1212
export const check = defineCommand({
1313
meta: {
@@ -62,29 +62,29 @@ export const check = defineCommand({
6262

6363
// Run all checks if --all flag is provided
6464
if (args.all) {
65-
success = await lintAll(cwd, args.fix);
65+
success = await checkAll(cwd, args.fix);
6666
} else {
6767
// Run specific checks based on flags
6868
const checks: Array<() => Promise<boolean>> = [];
6969

7070
if (args.staged) {
71-
checks.push(() => lintStaged(cwd));
71+
checks.push(() => checkStaged(cwd));
7272
}
7373

7474
if (args.project) {
75-
checks.push(() => lintProject(cwd));
75+
checks.push(() => checkProject(cwd));
7676
}
7777

7878
if (args.deps) {
79-
checks.push(() => lintDependencies(cwd, undefined, args.fix));
79+
checks.push(() => checkDependencies(cwd, undefined, args.fix));
8080
}
8181

8282
if (args.structure) {
83-
checks.push(() => lintStructure(cwd, undefined, args.fix));
83+
checks.push(() => checkStructure(cwd, undefined, args.fix));
8484
}
8585

8686
if (args.docs) {
87-
checks.push(() => lintDocs(cwd, undefined, args.fix));
87+
checks.push(() => checkDocs(cwd, undefined, args.fix));
8888
}
8989

9090
// Run all selected checks

packages/basis/src/core.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { setupGit } from "./modules/git";
22
import { init as initProject } from "./modules/init";
3-
import { lintAll } from "./modules/lint";
3+
import { checkAll } from "./modules/check";
44
import { publishPackage } from "./modules/publish";
55
import { updatePackageVersion } from "./modules/version";
66
import type { BasisConfig, InitOptions, PublishOptions, VersionOptions } from "./types";
@@ -64,13 +64,13 @@ export class Basis {
6464
}
6565

6666
/**
67-
* Run complete release workflow (lint + version + publish)
67+
* Run complete release workflow (check + version + publish)
6868
*/
6969
async release(versionOptions: VersionOptions = {}, publishOptions: PublishOptions = {}) {
70-
// Run all lint checks first
71-
const lintSuccess = await lintAll(this.cwd);
72-
if (!lintSuccess) {
73-
throw new Error("Lint checks failed. Fix issues before releasing.");
70+
// Run all checks first
71+
const checkSuccess = await checkAll(this.cwd);
72+
if (!checkSuccess) {
73+
throw new Error("Checks failed. Fix issues before releasing.");
7474
}
7575

7676
// Update version

packages/basis/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export * from "./core";
77
// Module functions
88
export * from "./modules/git";
99
export * from "./modules/init";
10-
export * from "./modules/lint";
10+
export * from "./modules/check";
1111
export * from "./modules/publish";
1212
export * from "./modules/version";
1313

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export async function getProjectFiles(
5656
}
5757

5858
/**
59-
* Lint staged files
59+
* Check staged files
6060
*/
61-
export async function lintStaged(
61+
export async function checkStaged(
6262
cwd = process.cwd(),
6363
config?: CheckConfig["staged"],
6464
): Promise<boolean> {
@@ -127,9 +127,9 @@ export async function lintStaged(
127127
}
128128

129129
/**
130-
* Lint entire project using commands (similar to staged but for all project files)
130+
* Check entire project using commands (similar to staged but for all project files)
131131
*/
132-
export async function lintProject(
132+
export async function checkProject(
133133
cwd = process.cwd(),
134134
config?: CheckConfig["project"],
135135
): Promise<boolean> {
@@ -171,7 +171,7 @@ export async function lintProject(
171171
/**
172172
* Check dependencies
173173
*/
174-
export async function lintDependencies(
174+
export async function checkDependencies(
175175
cwd = process.cwd(),
176176
config?: CheckConfig["dependencies"],
177177
fix = false,
@@ -480,7 +480,7 @@ async function checkNamingConventions(
480480
/**
481481
* Check project structure
482482
*/
483-
export async function lintStructure(
483+
export async function checkStructure(
484484
cwd = process.cwd(),
485485
config?: CheckConfig["structure"],
486486
fix = false,
@@ -526,7 +526,7 @@ export async function lintStructure(
526526
/**
527527
* Check documentation
528528
*/
529-
export async function lintDocs(
529+
export async function checkDocs(
530530
cwd = process.cwd(),
531531
config?: CheckConfig["docs"],
532532
fix = false,
@@ -597,17 +597,17 @@ export async function lintDocs(
597597
}
598598

599599
/**
600-
* Run all lint checks
600+
* Run all checks
601601
*/
602-
export async function lintAll(cwd = process.cwd(), fix = false): Promise<boolean> {
602+
export async function checkAll(cwd = process.cwd(), fix = false): Promise<boolean> {
603603
const { config } = await loadConfig({ cwd });
604604
const checkConfig = config.check || {};
605605

606606
const results = await Promise.allSettled([
607-
lintProject(cwd, checkConfig.project),
608-
lintDependencies(cwd, checkConfig.dependencies, fix),
609-
lintStructure(cwd, checkConfig.structure, fix),
610-
lintDocs(cwd, checkConfig.docs, fix),
607+
checkProject(cwd, checkConfig.project),
608+
checkDependencies(cwd, checkConfig.dependencies, fix),
609+
checkStructure(cwd, checkConfig.structure, fix),
610+
checkDocs(cwd, checkConfig.docs, fix),
611611
]);
612612

613613
const failures = results.filter(

0 commit comments

Comments
 (0)