@howells/lint 0.1.3 → 0.1.4

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
@@ -6,6 +6,7 @@ The goal is not to invent a second lint philosophy. The goal is to:
6
6
 
7
7
  - pin a single `@biomejs/biome` version
8
8
  - pin a single `ultracite` version
9
+ - pin a single `@manypkg/cli` version for monorepo consistency checks
9
10
  - give every consumer the same small preset matrix
10
11
  - discourage repo-local overrides unless the project has a genuinely unique constraint
11
12
 
@@ -60,12 +61,14 @@ Next.js app:
60
61
 
61
62
  ## Binaries
62
63
 
63
- Installers only need `@howells/lint` as a direct dependency. Use the package binaries instead of adding `@biomejs/biome` or `ultracite` separately:
64
+ Installers only need `@howells/lint` as a direct dependency. Use the package binaries instead of adding `@biomejs/biome`, `ultracite`, or `@manypkg/cli` separately:
64
65
 
65
66
  - `howells-biome` proxies to the pinned Biome binary
66
67
  - `howells-ultracite` proxies to the pinned Ultracite binary
67
68
  - `howells-lint` defaults to `biome check .`
68
69
  - `howells-format` defaults to `biome check . --write`
70
+ - `howells-workspace-check` defaults to `manypkg check`
71
+ - `howells-workspace-fix` defaults to `manypkg fix`
69
72
 
70
73
  Example scripts:
71
74
 
@@ -78,6 +81,19 @@ Example scripts:
78
81
  }
79
82
  ```
80
83
 
84
+ Monorepo root scripts should compose package linting with workspace validation:
85
+
86
+ ```json
87
+ {
88
+ "scripts": {
89
+ "lint": "turbo run lint && howells-workspace-check",
90
+ "lint:fix": "turbo run lint:fix && howells-workspace-fix"
91
+ }
92
+ }
93
+ ```
94
+
95
+ CI should call `pnpm lint` or `pnpm check` so the workspace check is not bypassed by a direct `turbo lint` command.
96
+
81
97
  Prefer explicit script targets over config churn when the only difference is scope:
82
98
 
83
99
  ```json
@@ -97,6 +113,38 @@ Prefer explicit script targets over config churn when the only difference is sco
97
113
  - If a repo needs framework-specific linting, choose the matching preset instead of layering rules manually.
98
114
  - Prefer inline `biome-ignore` comments for truly isolated exceptions over broad config overrides.
99
115
 
116
+ ## Claude Code Hooks
117
+
118
+ Add this to `.claude/settings.json` so files are formatted on edit and linted on session end:
119
+
120
+ ```json
121
+ {
122
+ "hooks": {
123
+ "PostToolUse": [
124
+ {
125
+ "matcher": "Edit|Write",
126
+ "hooks": [
127
+ {
128
+ "type": "command",
129
+ "command": "jq -r '.tool_input.file_path' | { read file_path; case \"$file_path\" in *.js|*.ts|*.jsx|*.tsx|*.json|*.jsonc|*.css|*.graphql) howells-format \"$file_path\" 2>/dev/null || true ;; esac; }"
130
+ }
131
+ ]
132
+ }
133
+ ],
134
+ "Stop": [
135
+ {
136
+ "hooks": [
137
+ {
138
+ "type": "command",
139
+ "command": "git diff --name-only --diff-filter=d HEAD | grep -E '\\.(js|ts|jsx|tsx|json|jsonc|css|graphql)$' | xargs howells-format 2>/dev/null || true"
140
+ }
141
+ ]
142
+ }
143
+ ]
144
+ }
145
+ }
146
+ ```
147
+
100
148
  ## Upstream
101
149
 
102
150
  This package wraps:
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runManypkgCommand } from "./run-manypkg-command.mjs";
4
+
5
+ const args = process.argv.slice(2);
6
+ runManypkgCommand("check", args);
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runManypkgCommand } from "./run-manypkg-command.mjs";
4
+
5
+ const args = process.argv.slice(2);
6
+ runManypkgCommand("fix", args);
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createRequire } from "node:module";
4
+ import { runPackageBin } from "./run-package-bin.mjs";
5
+
6
+ const require = createRequire(import.meta.url);
7
+ const helpOptions = new Set(["--help", "-h"]);
8
+ const versionOptions = new Set(["--version", "-V"]);
9
+
10
+ function printHelp(command) {
11
+ console.log(`Usage: howells-workspace-${command} [options]\n`);
12
+ console.log(`Runs: manypkg ${command} [options]`);
13
+ }
14
+
15
+ function printVersion() {
16
+ const { version } = require("@manypkg/cli/package.json");
17
+ console.log(version);
18
+ }
19
+
20
+ export function runManypkgCommand(command, args) {
21
+ if (helpOptions.has(args[0])) {
22
+ printHelp(command);
23
+ process.exit(0);
24
+ }
25
+
26
+ if (versionOptions.has(args[0])) {
27
+ printVersion();
28
+ process.exit(0);
29
+ }
30
+
31
+ runPackageBin("@manypkg/cli", "manypkg", [command, ...args]);
32
+ }
package/package.json CHANGED
@@ -1,28 +1,34 @@
1
1
  {
2
- "name": "@howells/lint",
3
- "version": "0.1.3",
4
- "description": "Pinned Biome and Ultracite presets for Howells projects.",
5
- "license": "MIT",
6
- "files": [
7
- "biome/*.json",
8
- "bin/*.mjs",
9
- "README.md",
10
- "MIGRATIONS.md"
11
- ],
12
- "bin": {
13
- "howells-biome": "bin/howells-biome.mjs",
14
- "howells-lint": "bin/howells-lint.mjs",
15
- "howells-format": "bin/howells-format.mjs",
16
- "howells-ultracite": "bin/howells-ultracite.mjs"
17
- },
18
- "dependencies": {
19
- "@biomejs/biome": "2.4.12",
20
- "ultracite": "7.6.0"
21
- },
22
- "exports": {
23
- "./package.json": "./package.json",
24
- "./biome/core": "./biome/core.json",
25
- "./biome/react": "./biome/react.json",
26
- "./biome/next": "./biome/next.json"
27
- }
2
+ "name": "@howells/lint",
3
+ "version": "0.1.4",
4
+ "description": "Pinned Biome and Ultracite presets for Howells projects.",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": ">=20.19"
8
+ },
9
+ "files": [
10
+ "biome/*.json",
11
+ "bin/*.mjs",
12
+ "README.md",
13
+ "MIGRATIONS.md"
14
+ ],
15
+ "bin": {
16
+ "howells-biome": "bin/howells-biome.mjs",
17
+ "howells-lint": "bin/howells-lint.mjs",
18
+ "howells-format": "bin/howells-format.mjs",
19
+ "howells-ultracite": "bin/howells-ultracite.mjs",
20
+ "howells-workspace-check": "bin/howells-workspace-check.mjs",
21
+ "howells-workspace-fix": "bin/howells-workspace-fix.mjs"
22
+ },
23
+ "dependencies": {
24
+ "@biomejs/biome": "2.4.12",
25
+ "@manypkg/cli": "^0.25.1",
26
+ "ultracite": "7.6.0"
27
+ },
28
+ "exports": {
29
+ "./package.json": "./package.json",
30
+ "./biome/core": "./biome/core.json",
31
+ "./biome/react": "./biome/react.json",
32
+ "./biome/next": "./biome/next.json"
33
+ }
28
34
  }