Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node node_modules/.bin/commitlint --edit "$1"
pnpm exec commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
STAGED=$(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(ts|tsx)$' | grep -v '\.d\.ts$' || true)
if [ -n "$STAGED" ]; then
node node_modules/.bin/eslint --fix $STAGED 2>&1
pnpm exec eslint --fix $STAGED 2>&1
fi
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node node_modules/.bin/eslint . 2>&1 && node node_modules/.bin/tsc --noEmit 2>&1 && node node_modules/.bin/vitest run 2>&1
pnpm exec eslint . 2>&1 && pnpm exec tsc --noEmit 2>&1 && pnpm exec vitest run 2>&1
6 changes: 2 additions & 4 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
minimum-release-age=10080
minimum-release-age-exclude[]=@mariozechner/*
minimum-release-age-exclude[]=wire-mesh-core
minimum-release-age-exclude[]=cddl.js
save-exact=true
minimum-release-age-exclude[]=@exadev/eslint-config
71 changes: 7 additions & 64 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,14 @@
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "eslint/config";
import type { Rule } from "eslint";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import eslintPluginPrettier from "eslint-plugin-prettier";
import tseslint from "typescript-eslint";
import exadev from "@exadev/eslint-config";

const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));

// ─── Custom rules ────────────────────────────────────────────────────────────

const noPointlessReassignments: Rule.RuleModule = {
meta: {
type: "problem",
messages: {
pointlessReassignment:
"Pointless reassignment. {{ name }} is just an alias for {{ value }}. Use the original directly instead.",
},
},
create(context) {
return {
VariableDeclarator(node) {
if (node.id.type !== "Identifier" || node.init?.type !== "Identifier") {
return;
}
if (node.id.name.startsWith("_")) {
return;
}
// A `let`/`var` binding can be legitimately reassigned later (e.g. a loop-mutated value initialised from a starting constant, then updated each iteration) -- only `const` genuinely guarantees the binding is nothing but a permanent alias for its initializer, since a `const` can never be written to again. Without this check the rule fired on exactly that pattern (`let delayMs = INITIAL_RETRY_DELAY_MS` ahead of a loop that reassigns `delayMs` every iteration), which is not a pointless reassignment at all.
if (
node.parent.type === "VariableDeclaration" &&
node.parent.kind !== "const"
) {
return;
}
context.report({
node,
messageId: "pointlessReassignment",
data: {
name: node.id.name,
value: node.init.name,
},
});
},
};
},
};

const customPlugin = {
rules: {
"no-pointless-reassignments": noPointlessReassignments,
},
};

// ─── Config ──────────────────────────────────────────────────────────────────

export default defineConfig(
{
// .stryker-tmp holds Stryker's own instrumented sandbox copies of the source (each mutant gets a full copy, deliberately carrying a @ts-nocheck pragma Stryker injects itself) -- linting them produces thousands of irrelevant errors against generated, throwaway code, not anything committed. reports/ is Stryker's own output (HTML/JSON), same reasoning.
Expand All @@ -68,13 +20,14 @@ export default defineConfig(
"reports/**",
],
},
...exadev,
// Several directories under src/ use index.ts as a real module (interfaces, functions, a default export), not a re-export barrel -- barrel-policy only restricts files that actually contain re-exports, so this override is scoped to permitting the pattern, not to exempting those files from anything they weren't already going to pass. src/core/index.ts is a genuine re-export barrel and the package's own entry point; every one of its re-exports comes from a direct sibling (confirmed directly), so 'siblings' -- not 'single', which only ever recognises the literal path src/index.ts -- is the mode that actually matches this repo's real layout. Scoped to TS/TSX: the exadev plugin namespace is only registered on the JS/TS-scoped config objects @exadev/eslint-config's own array contributes, so an unscoped override here would fail to resolve "exadev/barrel-policy" while linting a JSON or Markdown file.
{
files: ["**/*.{ts,tsx}"],
rules: { "exadev/barrel-policy": ["error", { mode: "siblings" }] },
},
{
files: ["**/*.{ts,tsx}"],
extends: [
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
parserOptions: {
projectService: {
Expand All @@ -98,18 +51,12 @@ export default defineConfig(
},
plugins: {
prettier: eslintPluginPrettier,
custom: customPlugin,
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/consistent-type-assertions": [
"error",
{ assertionStyle: "never" },
],
"custom/no-pointless-reassignments": "error",
"no-restricted-syntax": [
"error",
{
Expand All @@ -125,10 +72,6 @@ export default defineConfig(
],
"prettier/prettier": "error",
"@typescript-eslint/require-await": "warn",
"max-lines": [
"error",
{ max: 800, skipBlankLines: true, skipComments: true },
],
},
},
eslintConfigPrettier,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.21.6",
"description": "Cross-harness communication mesh for LLM agents — rooms, DMs, presence, and real-time push delivery over TCP",
"type": "module",
"packageManager": "pnpm@10.33.0",
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
"repository": {
"type": "git",
"url": "git+https://github.com/ExaDev/agent-comms.git"
Expand Down Expand Up @@ -66,6 +66,7 @@
"@commitlint/types": "21.2.0",
"@eslint/json": "2.0.1",
"@eslint/markdown": "8.0.3",
"@exadev/eslint-config": "2.12.3",
"@mariozechner/pi-ai": "0.73.1",
"@mariozechner/pi-coding-agent": "0.73.1",
"@playwright/test": "1.61.1",
Expand Down Expand Up @@ -112,7 +113,7 @@
},
"pi": {
"extensions": [
"./src/bridges/pi/index.ts"
"./src/bridges/pi/extension.ts"
]
}
}
Loading