@codyswann/lisa 2.164.0 → 2.164.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/dist/codex/scripts/lint-on-edit.sh +7 -9
- package/dist/opencode/plugin-templates/lisa-lint-on-edit.ts +8 -9
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/hooks/lint-on-edit.sh +15 -61
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/hooks/lint-on-edit.sh +15 -61
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/hooks/lint-on-edit.sh +15 -61
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/typescript/hooks/lint-on-edit.sh +15 -61
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Lisa-managed Codex hook script (PostToolUse Edit|Write|apply_patch).
|
|
3
|
-
# Runs
|
|
4
|
-
#
|
|
3
|
+
# Runs oxlint on every just-edited JS/TS file. Full ESLint remains enforced at
|
|
4
|
+
# the commit/CI chokepoint via the project lint scripts.
|
|
5
5
|
# Resolves target file(s) via the shared extractor (Edit/Write + apply_patch).
|
|
6
6
|
set -uo pipefail
|
|
7
7
|
|
|
@@ -15,10 +15,10 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
15
15
|
# shellcheck source=/dev/null
|
|
16
16
|
. "${SCRIPT_DIR}/_extract-edit-paths.sh"
|
|
17
17
|
|
|
18
|
-
if [ -x "./node_modules/.bin/
|
|
19
|
-
|
|
20
|
-
elif command -v
|
|
21
|
-
|
|
18
|
+
if [ -x "./node_modules/.bin/oxlint" ]; then
|
|
19
|
+
OXLINT="./node_modules/.bin/oxlint"
|
|
20
|
+
elif command -v oxlint >/dev/null 2>&1; then
|
|
21
|
+
OXLINT="oxlint"
|
|
22
22
|
else
|
|
23
23
|
exit 0
|
|
24
24
|
fi
|
|
@@ -31,9 +31,7 @@ while IFS= read -r FILE_PATH; do
|
|
|
31
31
|
ts | tsx | js | jsx | mjs | cjs) ;;
|
|
32
32
|
*) continue ;;
|
|
33
33
|
esac
|
|
34
|
-
|
|
35
|
-
"$ESLINT" --fix "${FILE_PATH}" >/dev/null 2>&1 || true
|
|
36
|
-
"$ESLINT" --quiet "${FILE_PATH}" || STATUS=1
|
|
34
|
+
"$OXLINT" --quiet "${FILE_PATH}" || STATUS=1
|
|
37
35
|
done <<EOF
|
|
38
36
|
$(lisa_extract_edit_paths "$JSON_INPUT")
|
|
39
37
|
EOF
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lisa-managed OpenCode plugin (tool.execute.after).
|
|
3
3
|
*
|
|
4
|
-
* Runs
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Runs oxlint on every just-edited JS/TS file. If problems remain, throws so
|
|
5
|
+
* OpenCode marks the tool call failed and the agent self-corrects (the
|
|
6
|
+
* equivalent of the Codex hook's non-zero exit). Fails open when oxlint isn't
|
|
7
|
+
* installed. Full ESLint remains enforced at the commit/CI chokepoint.
|
|
8
8
|
*
|
|
9
9
|
* Port of Lisa's Codex hook `lint-on-edit.sh`. OpenCode passes the edited file
|
|
10
10
|
* via `input.args.filePath`; `tool.execute.after` runs after a successful
|
|
@@ -38,15 +38,14 @@ export const LisaLintOnEdit = async ({
|
|
|
38
38
|
if (input.tool !== "edit" && input.tool !== "write") return;
|
|
39
39
|
const filePath = String(input.args?.filePath ?? "");
|
|
40
40
|
if (!filePath || !EXTS.has(extOf(filePath))) return;
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
await $`${
|
|
44
|
-
const res = await $`${eslint} --quiet ${filePath}`.quiet().nothrow();
|
|
41
|
+
const oxlint = resolveBin("oxlint");
|
|
42
|
+
if (!oxlint) return; // fail open - no oxlint installed
|
|
43
|
+
const res = await $`${oxlint} --quiet ${filePath}`.quiet().nothrow();
|
|
45
44
|
if (res.exitCode === 0) return;
|
|
46
45
|
const out =
|
|
47
46
|
`${res.stdout?.toString() ?? ""}${res.stderr?.toString() ?? ""}`.trim();
|
|
48
47
|
throw new Error(
|
|
49
|
-
`lint-on-edit:
|
|
48
|
+
`lint-on-edit: oxlint reported problems in ${filePath}:\n${out}`
|
|
50
49
|
);
|
|
51
50
|
},
|
|
52
51
|
};
|
package/package.json
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"lodash": ">=4.18.1"
|
|
86
86
|
},
|
|
87
87
|
"name": "@codyswann/lisa",
|
|
88
|
-
"version": "2.164.
|
|
88
|
+
"version": "2.164.1",
|
|
89
89
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
90
90
|
"main": "dist/index.js",
|
|
91
91
|
"exports": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.164.
|
|
3
|
+
"version": "2.164.1",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.164.
|
|
3
|
+
"version": "2.164.1",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.164.
|
|
3
|
+
"version": "2.164.1",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.164.
|
|
3
|
+
"version": "2.164.1",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.164.
|
|
3
|
+
"version": "2.164.1",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
# =============================================================================
|
|
5
5
|
# Lint-on-Edit Hook (PostToolUse - Write|Edit)
|
|
6
6
|
# =============================================================================
|
|
7
|
-
# Runs oxlint
|
|
8
|
-
#
|
|
9
|
-
# prettier → ast-grep → oxlint --fix → eslint --fix
|
|
7
|
+
# Runs oxlint on each edited TypeScript file. Full ESLint remains enforced at
|
|
8
|
+
# the commit/CI chokepoint via the project lint scripts.
|
|
10
9
|
#
|
|
11
|
-
# oxlint
|
|
12
|
-
#
|
|
13
|
-
# rules for ESLint to handle.
|
|
10
|
+
# oxlint is Rust-native and covers the fast-feedback rule tier in milliseconds;
|
|
11
|
+
# ESLint stays out of the edit-time path.
|
|
14
12
|
#
|
|
15
13
|
# Behavior:
|
|
16
|
-
# - Exit 0: lint passes
|
|
17
|
-
# - Exit 2:
|
|
14
|
+
# - Exit 0: lint passes
|
|
15
|
+
# - Exit 2: oxlint errors remain - blocks Claude so it fixes them immediately
|
|
18
16
|
#
|
|
19
17
|
# @see .claude/rules/verfication.md "Self-Correction Loop" section
|
|
20
18
|
# =============================================================================
|
|
@@ -49,7 +47,7 @@ esac
|
|
|
49
47
|
|
|
50
48
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
|
51
49
|
|
|
52
|
-
# Resolve oxlint
|
|
50
|
+
# Resolve oxlint binary - prefer local node_modules/.bin
|
|
53
51
|
if [ -x "./node_modules/.bin/oxlint" ]; then
|
|
54
52
|
OXLINT_CMD="./node_modules/.bin/oxlint"
|
|
55
53
|
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
@@ -62,19 +60,7 @@ else
|
|
|
62
60
|
OXLINT_CMD="npx oxlint"
|
|
63
61
|
fi
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
ESLINT_CMD="./node_modules/.bin/eslint"
|
|
67
|
-
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
68
|
-
ESLINT_CMD="bunx eslint"
|
|
69
|
-
elif [ -f "pnpm-lock.yaml" ]; then
|
|
70
|
-
ESLINT_CMD="pnpm exec eslint"
|
|
71
|
-
elif [ -f "yarn.lock" ]; then
|
|
72
|
-
ESLINT_CMD="yarn exec eslint"
|
|
73
|
-
else
|
|
74
|
-
ESLINT_CMD="npx eslint"
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
# 1) oxlint --fix (REQUIRED in the Phase 2 hybrid pipeline)
|
|
63
|
+
# oxlint (REQUIRED in the Phase 2 hybrid pipeline)
|
|
78
64
|
# If oxlint is missing the project is out of sync with the current Lisa
|
|
79
65
|
# governance — fail loudly rather than silently skipping. ESLint alone is
|
|
80
66
|
# no longer a complete lint pass.
|
|
@@ -89,46 +75,14 @@ if [ ! -f ".oxlintrc.json" ] && [ ! -f ".oxlintrc.jsonc" ] && [ ! -f "oxlint.con
|
|
|
89
75
|
exit 2
|
|
90
76
|
fi
|
|
91
77
|
|
|
92
|
-
echo "Running oxlint
|
|
93
|
-
OX_OUTPUT=$($OXLINT_CMD --
|
|
78
|
+
echo "Running oxlint on: $FILE_PATH"
|
|
79
|
+
OX_OUTPUT=$($OXLINT_CMD --quiet "$FILE_PATH" 2>&1)
|
|
94
80
|
OX_EXIT=$?
|
|
95
81
|
if [ $OX_EXIT -ne 0 ]; then
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if [ $OX_EXIT -ne 0 ]; then
|
|
100
|
-
echo "oxlint found unfixable errors in: $FILE_PATH" >&2
|
|
101
|
-
echo "$OX_OUTPUT" >&2
|
|
102
|
-
exit 2
|
|
103
|
-
fi
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
# 2) ESLint --fix --quiet --cache
|
|
107
|
-
# --quiet: suppress warnings, only show errors
|
|
108
|
-
# --cache: use ESLint cache for performance
|
|
109
|
-
# --rule: disable no-unused-vars auto-fix to prevent removing imports that Claude
|
|
110
|
-
# plans to use in a subsequent edit (pre-commit hook still catches them)
|
|
111
|
-
echo "Running ESLint --fix on: $FILE_PATH"
|
|
112
|
-
|
|
113
|
-
# First pass: attempt auto-fix
|
|
114
|
-
OUTPUT=$($ESLINT_CMD --fix --quiet --cache --rule '@typescript-eslint/no-unused-vars: off' "$FILE_PATH" 2>&1)
|
|
115
|
-
FIX_EXIT=$?
|
|
116
|
-
|
|
117
|
-
if [ $FIX_EXIT -eq 0 ]; then
|
|
118
|
-
echo "ESLint: No errors in $(basename "$FILE_PATH")"
|
|
119
|
-
exit 0
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
# Auto-fix resolved some issues but errors remain — re-run to get remaining errors
|
|
123
|
-
OUTPUT=$($ESLINT_CMD --quiet --cache "$FILE_PATH" 2>&1)
|
|
124
|
-
LINT_EXIT=$?
|
|
125
|
-
|
|
126
|
-
if [ $LINT_EXIT -eq 0 ]; then
|
|
127
|
-
echo "ESLint: Auto-fixed all errors in $(basename "$FILE_PATH")"
|
|
128
|
-
exit 0
|
|
82
|
+
echo "oxlint found errors in: $FILE_PATH" >&2
|
|
83
|
+
echo "$OX_OUTPUT" >&2
|
|
84
|
+
exit 2
|
|
129
85
|
fi
|
|
130
86
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
echo "$OUTPUT" >&2
|
|
134
|
-
exit 2
|
|
87
|
+
echo "oxlint: No errors in $(basename "$FILE_PATH")"
|
|
88
|
+
exit 0
|
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
# =============================================================================
|
|
5
5
|
# Lint-on-Edit Hook (PostToolUse - Write|Edit)
|
|
6
6
|
# =============================================================================
|
|
7
|
-
# Runs oxlint
|
|
8
|
-
#
|
|
9
|
-
# prettier → ast-grep → oxlint --fix → eslint --fix
|
|
7
|
+
# Runs oxlint on each edited TypeScript file. Full ESLint remains enforced at
|
|
8
|
+
# the commit/CI chokepoint via the project lint scripts.
|
|
10
9
|
#
|
|
11
|
-
# oxlint
|
|
12
|
-
#
|
|
13
|
-
# rules for ESLint to handle.
|
|
10
|
+
# oxlint is Rust-native and covers the fast-feedback rule tier in milliseconds;
|
|
11
|
+
# ESLint stays out of the edit-time path.
|
|
14
12
|
#
|
|
15
13
|
# Behavior:
|
|
16
|
-
# - Exit 0: lint passes
|
|
17
|
-
# - Exit 2:
|
|
14
|
+
# - Exit 0: lint passes
|
|
15
|
+
# - Exit 2: oxlint errors remain - blocks Claude so it fixes them immediately
|
|
18
16
|
#
|
|
19
17
|
# @see .claude/rules/verfication.md "Self-Correction Loop" section
|
|
20
18
|
# =============================================================================
|
|
@@ -49,7 +47,7 @@ esac
|
|
|
49
47
|
|
|
50
48
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
|
51
49
|
|
|
52
|
-
# Resolve oxlint
|
|
50
|
+
# Resolve oxlint binary - prefer local node_modules/.bin
|
|
53
51
|
if [ -x "./node_modules/.bin/oxlint" ]; then
|
|
54
52
|
OXLINT_CMD="./node_modules/.bin/oxlint"
|
|
55
53
|
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
@@ -62,19 +60,7 @@ else
|
|
|
62
60
|
OXLINT_CMD="npx oxlint"
|
|
63
61
|
fi
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
ESLINT_CMD="./node_modules/.bin/eslint"
|
|
67
|
-
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
68
|
-
ESLINT_CMD="bunx eslint"
|
|
69
|
-
elif [ -f "pnpm-lock.yaml" ]; then
|
|
70
|
-
ESLINT_CMD="pnpm exec eslint"
|
|
71
|
-
elif [ -f "yarn.lock" ]; then
|
|
72
|
-
ESLINT_CMD="yarn exec eslint"
|
|
73
|
-
else
|
|
74
|
-
ESLINT_CMD="npx eslint"
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
# 1) oxlint --fix (REQUIRED in the Phase 2 hybrid pipeline)
|
|
63
|
+
# oxlint (REQUIRED in the Phase 2 hybrid pipeline)
|
|
78
64
|
# If oxlint is missing the project is out of sync with the current Lisa
|
|
79
65
|
# governance — fail loudly rather than silently skipping. ESLint alone is
|
|
80
66
|
# no longer a complete lint pass.
|
|
@@ -89,46 +75,14 @@ if [ ! -f ".oxlintrc.json" ] && [ ! -f ".oxlintrc.jsonc" ] && [ ! -f "oxlint.con
|
|
|
89
75
|
exit 2
|
|
90
76
|
fi
|
|
91
77
|
|
|
92
|
-
echo "Running oxlint
|
|
93
|
-
OX_OUTPUT=$($OXLINT_CMD --
|
|
78
|
+
echo "Running oxlint on: $FILE_PATH"
|
|
79
|
+
OX_OUTPUT=$($OXLINT_CMD --quiet "$FILE_PATH" 2>&1)
|
|
94
80
|
OX_EXIT=$?
|
|
95
81
|
if [ $OX_EXIT -ne 0 ]; then
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if [ $OX_EXIT -ne 0 ]; then
|
|
100
|
-
echo "oxlint found unfixable errors in: $FILE_PATH" >&2
|
|
101
|
-
echo "$OX_OUTPUT" >&2
|
|
102
|
-
exit 2
|
|
103
|
-
fi
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
# 2) ESLint --fix --quiet --cache
|
|
107
|
-
# --quiet: suppress warnings, only show errors
|
|
108
|
-
# --cache: use ESLint cache for performance
|
|
109
|
-
# --rule: disable no-unused-vars auto-fix to prevent removing imports that Claude
|
|
110
|
-
# plans to use in a subsequent edit (pre-commit hook still catches them)
|
|
111
|
-
echo "Running ESLint --fix on: $FILE_PATH"
|
|
112
|
-
|
|
113
|
-
# First pass: attempt auto-fix
|
|
114
|
-
OUTPUT=$($ESLINT_CMD --fix --quiet --cache --rule '@typescript-eslint/no-unused-vars: off' "$FILE_PATH" 2>&1)
|
|
115
|
-
FIX_EXIT=$?
|
|
116
|
-
|
|
117
|
-
if [ $FIX_EXIT -eq 0 ]; then
|
|
118
|
-
echo "ESLint: No errors in $(basename "$FILE_PATH")"
|
|
119
|
-
exit 0
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
# Auto-fix resolved some issues but errors remain — re-run to get remaining errors
|
|
123
|
-
OUTPUT=$($ESLINT_CMD --quiet --cache "$FILE_PATH" 2>&1)
|
|
124
|
-
LINT_EXIT=$?
|
|
125
|
-
|
|
126
|
-
if [ $LINT_EXIT -eq 0 ]; then
|
|
127
|
-
echo "ESLint: Auto-fixed all errors in $(basename "$FILE_PATH")"
|
|
128
|
-
exit 0
|
|
82
|
+
echo "oxlint found errors in: $FILE_PATH" >&2
|
|
83
|
+
echo "$OX_OUTPUT" >&2
|
|
84
|
+
exit 2
|
|
129
85
|
fi
|
|
130
86
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
echo "$OUTPUT" >&2
|
|
134
|
-
exit 2
|
|
87
|
+
echo "oxlint: No errors in $(basename "$FILE_PATH")"
|
|
88
|
+
exit 0
|
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
# =============================================================================
|
|
5
5
|
# Lint-on-Edit Hook (PostToolUse - Write|Edit)
|
|
6
6
|
# =============================================================================
|
|
7
|
-
# Runs oxlint
|
|
8
|
-
#
|
|
9
|
-
# prettier → ast-grep → oxlint --fix → eslint --fix
|
|
7
|
+
# Runs oxlint on each edited TypeScript file. Full ESLint remains enforced at
|
|
8
|
+
# the commit/CI chokepoint via the project lint scripts.
|
|
10
9
|
#
|
|
11
|
-
# oxlint
|
|
12
|
-
#
|
|
13
|
-
# rules for ESLint to handle.
|
|
10
|
+
# oxlint is Rust-native and covers the fast-feedback rule tier in milliseconds;
|
|
11
|
+
# ESLint stays out of the edit-time path.
|
|
14
12
|
#
|
|
15
13
|
# Behavior:
|
|
16
|
-
# - Exit 0: lint passes
|
|
17
|
-
# - Exit 2:
|
|
14
|
+
# - Exit 0: lint passes
|
|
15
|
+
# - Exit 2: oxlint errors remain - blocks Claude so it fixes them immediately
|
|
18
16
|
#
|
|
19
17
|
# @see .claude/rules/verfication.md "Self-Correction Loop" section
|
|
20
18
|
# =============================================================================
|
|
@@ -49,7 +47,7 @@ esac
|
|
|
49
47
|
|
|
50
48
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
|
51
49
|
|
|
52
|
-
# Resolve oxlint
|
|
50
|
+
# Resolve oxlint binary - prefer local node_modules/.bin
|
|
53
51
|
if [ -x "./node_modules/.bin/oxlint" ]; then
|
|
54
52
|
OXLINT_CMD="./node_modules/.bin/oxlint"
|
|
55
53
|
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
@@ -62,19 +60,7 @@ else
|
|
|
62
60
|
OXLINT_CMD="npx oxlint"
|
|
63
61
|
fi
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
ESLINT_CMD="./node_modules/.bin/eslint"
|
|
67
|
-
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
68
|
-
ESLINT_CMD="bunx eslint"
|
|
69
|
-
elif [ -f "pnpm-lock.yaml" ]; then
|
|
70
|
-
ESLINT_CMD="pnpm exec eslint"
|
|
71
|
-
elif [ -f "yarn.lock" ]; then
|
|
72
|
-
ESLINT_CMD="yarn exec eslint"
|
|
73
|
-
else
|
|
74
|
-
ESLINT_CMD="npx eslint"
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
# 1) oxlint --fix (REQUIRED in the Phase 2 hybrid pipeline)
|
|
63
|
+
# oxlint (REQUIRED in the Phase 2 hybrid pipeline)
|
|
78
64
|
# If oxlint is missing the project is out of sync with the current Lisa
|
|
79
65
|
# governance — fail loudly rather than silently skipping. ESLint alone is
|
|
80
66
|
# no longer a complete lint pass.
|
|
@@ -89,46 +75,14 @@ if [ ! -f ".oxlintrc.json" ] && [ ! -f ".oxlintrc.jsonc" ] && [ ! -f "oxlint.con
|
|
|
89
75
|
exit 2
|
|
90
76
|
fi
|
|
91
77
|
|
|
92
|
-
echo "Running oxlint
|
|
93
|
-
OX_OUTPUT=$($OXLINT_CMD --
|
|
78
|
+
echo "Running oxlint on: $FILE_PATH"
|
|
79
|
+
OX_OUTPUT=$($OXLINT_CMD --quiet "$FILE_PATH" 2>&1)
|
|
94
80
|
OX_EXIT=$?
|
|
95
81
|
if [ $OX_EXIT -ne 0 ]; then
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if [ $OX_EXIT -ne 0 ]; then
|
|
100
|
-
echo "oxlint found unfixable errors in: $FILE_PATH" >&2
|
|
101
|
-
echo "$OX_OUTPUT" >&2
|
|
102
|
-
exit 2
|
|
103
|
-
fi
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
# 2) ESLint --fix --quiet --cache
|
|
107
|
-
# --quiet: suppress warnings, only show errors
|
|
108
|
-
# --cache: use ESLint cache for performance
|
|
109
|
-
# --rule: disable no-unused-vars auto-fix to prevent removing imports that Claude
|
|
110
|
-
# plans to use in a subsequent edit (pre-commit hook still catches them)
|
|
111
|
-
echo "Running ESLint --fix on: $FILE_PATH"
|
|
112
|
-
|
|
113
|
-
# First pass: attempt auto-fix
|
|
114
|
-
OUTPUT=$($ESLINT_CMD --fix --quiet --cache --rule '@typescript-eslint/no-unused-vars: off' "$FILE_PATH" 2>&1)
|
|
115
|
-
FIX_EXIT=$?
|
|
116
|
-
|
|
117
|
-
if [ $FIX_EXIT -eq 0 ]; then
|
|
118
|
-
echo "ESLint: No errors in $(basename "$FILE_PATH")"
|
|
119
|
-
exit 0
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
# Auto-fix resolved some issues but errors remain — re-run to get remaining errors
|
|
123
|
-
OUTPUT=$($ESLINT_CMD --quiet --cache "$FILE_PATH" 2>&1)
|
|
124
|
-
LINT_EXIT=$?
|
|
125
|
-
|
|
126
|
-
if [ $LINT_EXIT -eq 0 ]; then
|
|
127
|
-
echo "ESLint: Auto-fixed all errors in $(basename "$FILE_PATH")"
|
|
128
|
-
exit 0
|
|
82
|
+
echo "oxlint found errors in: $FILE_PATH" >&2
|
|
83
|
+
echo "$OX_OUTPUT" >&2
|
|
84
|
+
exit 2
|
|
129
85
|
fi
|
|
130
86
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
echo "$OUTPUT" >&2
|
|
134
|
-
exit 2
|
|
87
|
+
echo "oxlint: No errors in $(basename "$FILE_PATH")"
|
|
88
|
+
exit 0
|
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
# =============================================================================
|
|
5
5
|
# Lint-on-Edit Hook (PostToolUse - Write|Edit)
|
|
6
6
|
# =============================================================================
|
|
7
|
-
# Runs oxlint
|
|
8
|
-
#
|
|
9
|
-
# prettier → ast-grep → oxlint --fix → eslint --fix
|
|
7
|
+
# Runs oxlint on each edited TypeScript file. Full ESLint remains enforced at
|
|
8
|
+
# the commit/CI chokepoint via the project lint scripts.
|
|
10
9
|
#
|
|
11
|
-
# oxlint
|
|
12
|
-
#
|
|
13
|
-
# rules for ESLint to handle.
|
|
10
|
+
# oxlint is Rust-native and covers the fast-feedback rule tier in milliseconds;
|
|
11
|
+
# ESLint stays out of the edit-time path.
|
|
14
12
|
#
|
|
15
13
|
# Behavior:
|
|
16
|
-
# - Exit 0: lint passes
|
|
17
|
-
# - Exit 2:
|
|
14
|
+
# - Exit 0: lint passes
|
|
15
|
+
# - Exit 2: oxlint errors remain - blocks Claude so it fixes them immediately
|
|
18
16
|
#
|
|
19
17
|
# @see .claude/rules/verfication.md "Self-Correction Loop" section
|
|
20
18
|
# =============================================================================
|
|
@@ -49,7 +47,7 @@ esac
|
|
|
49
47
|
|
|
50
48
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
|
51
49
|
|
|
52
|
-
# Resolve oxlint
|
|
50
|
+
# Resolve oxlint binary - prefer local node_modules/.bin
|
|
53
51
|
if [ -x "./node_modules/.bin/oxlint" ]; then
|
|
54
52
|
OXLINT_CMD="./node_modules/.bin/oxlint"
|
|
55
53
|
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
@@ -62,19 +60,7 @@ else
|
|
|
62
60
|
OXLINT_CMD="npx oxlint"
|
|
63
61
|
fi
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
ESLINT_CMD="./node_modules/.bin/eslint"
|
|
67
|
-
elif [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
68
|
-
ESLINT_CMD="bunx eslint"
|
|
69
|
-
elif [ -f "pnpm-lock.yaml" ]; then
|
|
70
|
-
ESLINT_CMD="pnpm exec eslint"
|
|
71
|
-
elif [ -f "yarn.lock" ]; then
|
|
72
|
-
ESLINT_CMD="yarn exec eslint"
|
|
73
|
-
else
|
|
74
|
-
ESLINT_CMD="npx eslint"
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
# 1) oxlint --fix (REQUIRED in the Phase 2 hybrid pipeline)
|
|
63
|
+
# oxlint (REQUIRED in the Phase 2 hybrid pipeline)
|
|
78
64
|
# If oxlint is missing the project is out of sync with the current Lisa
|
|
79
65
|
# governance — fail loudly rather than silently skipping. ESLint alone is
|
|
80
66
|
# no longer a complete lint pass.
|
|
@@ -89,46 +75,14 @@ if [ ! -f ".oxlintrc.json" ] && [ ! -f ".oxlintrc.jsonc" ] && [ ! -f "oxlint.con
|
|
|
89
75
|
exit 2
|
|
90
76
|
fi
|
|
91
77
|
|
|
92
|
-
echo "Running oxlint
|
|
93
|
-
OX_OUTPUT=$($OXLINT_CMD --
|
|
78
|
+
echo "Running oxlint on: $FILE_PATH"
|
|
79
|
+
OX_OUTPUT=$($OXLINT_CMD --quiet "$FILE_PATH" 2>&1)
|
|
94
80
|
OX_EXIT=$?
|
|
95
81
|
if [ $OX_EXIT -ne 0 ]; then
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if [ $OX_EXIT -ne 0 ]; then
|
|
100
|
-
echo "oxlint found unfixable errors in: $FILE_PATH" >&2
|
|
101
|
-
echo "$OX_OUTPUT" >&2
|
|
102
|
-
exit 2
|
|
103
|
-
fi
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
# 2) ESLint --fix --quiet --cache
|
|
107
|
-
# --quiet: suppress warnings, only show errors
|
|
108
|
-
# --cache: use ESLint cache for performance
|
|
109
|
-
# --rule: disable no-unused-vars auto-fix to prevent removing imports that Claude
|
|
110
|
-
# plans to use in a subsequent edit (pre-commit hook still catches them)
|
|
111
|
-
echo "Running ESLint --fix on: $FILE_PATH"
|
|
112
|
-
|
|
113
|
-
# First pass: attempt auto-fix
|
|
114
|
-
OUTPUT=$($ESLINT_CMD --fix --quiet --cache --rule '@typescript-eslint/no-unused-vars: off' "$FILE_PATH" 2>&1)
|
|
115
|
-
FIX_EXIT=$?
|
|
116
|
-
|
|
117
|
-
if [ $FIX_EXIT -eq 0 ]; then
|
|
118
|
-
echo "ESLint: No errors in $(basename "$FILE_PATH")"
|
|
119
|
-
exit 0
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
# Auto-fix resolved some issues but errors remain — re-run to get remaining errors
|
|
123
|
-
OUTPUT=$($ESLINT_CMD --quiet --cache "$FILE_PATH" 2>&1)
|
|
124
|
-
LINT_EXIT=$?
|
|
125
|
-
|
|
126
|
-
if [ $LINT_EXIT -eq 0 ]; then
|
|
127
|
-
echo "ESLint: Auto-fixed all errors in $(basename "$FILE_PATH")"
|
|
128
|
-
exit 0
|
|
82
|
+
echo "oxlint found errors in: $FILE_PATH" >&2
|
|
83
|
+
echo "$OX_OUTPUT" >&2
|
|
84
|
+
exit 2
|
|
129
85
|
fi
|
|
130
86
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
echo "$OUTPUT" >&2
|
|
134
|
-
exit 2
|
|
87
|
+
echo "oxlint: No errors in $(basename "$FILE_PATH")"
|
|
88
|
+
exit 0
|