Skip to content

chore: lint cleanup and notice-suppressibility fix#185

Merged
LadyBluenotes merged 6 commits into
mainfrom
chore/pre-m2-lint-cleanup
Jul 2, 2026
Merged

chore: lint cleanup and notice-suppressibility fix#185
LadyBluenotes merged 6 commits into
mainfrom
chore/pre-m2-lint-cleanup

Conversation

@LadyBluenotes

@LadyBluenotes LadyBluenotes commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

Five items, each independently verified (eslint, tsc, full test suite).

  1. Wire up test:eslintpackages/intent/package.json had no test:eslint script, so eslint was silently a no-op in CI despite being wired in nx.json.
  2. Fix stale eslint glob — the intent/static-discovery rule block in eslint.config.js pointed at packages/intent/src/scanner.ts, which no longer exists (moved to packages/intent/src/discovery/scanner.ts); the rule wasn't being applied.
  3. Fix 4 real lint errors — 2 auto-fixable import/order violations, 1 no-useless-escape (unnecessary \/ inside a regex character class), 1 no-unnecessary-type-assertion (redundant as any after JSON.parse).
  4. Fix 19 require-await warnings — removed unnecessary async from runExcludeCommand/runLoadCommand (confirmed CLI-internal, not public API) and from 17 test mocks across cli.test.ts, source-policy-surfaces.test.ts, and stale-command.test.ts.
  5. Fix allow-all risk banner was suppressibleintent list --no-notices / INTENT_NO_NOTICES=1 silently hid the warning that all skill sources are permitted (intent.skills: ["*"]). The banner is a security-relevant signal, not a migration tip, and shouldn't be silenceable.
    • ALLOW_ALL_NOTICE is now excluded from suppression by identity in printNotices() (shared/cli-output.ts), while every other notice stays suppressible as before.
    • Also fixes a related issue found mid-fix: an earlier version of this change routed the banner through a new non-suppressible warnings channel, which would have leaked it into every agent session-start/resume/clear/compact hook context (hooks/install.ts harvests warnings/conflicts for its catalog, never notices). Kept it in notices instead so it stays out of agent-injected context automatically, with no audience branching needed.
    • Added a CLI-level regression test (cli.test.ts) proving the banner survives --no-notices; verified the test fails against the pre-fix code and passes with the fix.

Summary by CodeRabbit

  • Bug Fixes
    • “No notices” mode no longer hides the security warning when all skill sources are allowed.
    • Improved CLI matching for gate script references and kept notice output behavior consistent.
  • Tests
    • Added coverage for the notice-suppression edge case and updated related command/integration test mocks.
  • Chores
    • Updated lint/test setup and refreshed several internal code and import layouts.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 971101ee-a257-4e32-8cd3-7ee757bc5f14

📥 Commits

Reviewing files that changed from the base of the PR and between 79902ee and ba25ea9.

📒 Files selected for processing (14)
  • .changeset/forty-heads-fly.md
  • eslint.config.js
  • packages/intent/package.json
  • packages/intent/src/commands/exclude.ts
  • packages/intent/src/commands/list.ts
  • packages/intent/src/commands/load.ts
  • packages/intent/src/core/source-policy.ts
  • packages/intent/src/hooks/install.ts
  • packages/intent/src/shared/cli-output.ts
  • packages/intent/src/staleness/check.ts
  • packages/intent/tests/cli.test.ts
  • packages/intent/tests/hooks-install.test.ts
  • packages/intent/tests/integration/source-policy-surfaces.test.ts
  • packages/intent/tests/stale-command.test.ts

📝 Walkthrough

Walkthrough

This PR fixes CLI notice suppression so the allow-all skills security warning is not hidden by --no-notices or INTENT_NO_NOTICES=1, relocating ALLOW_ALL_NOTICE to cli-output.ts. It also removes unnecessary async from two command functions, fixes an ESLint path, adds a lint script, tweaks a hook regex, and converts test mocks from async functions to explicit Promise resolution/rejection.

Changes

Allow-all notice suppression fix

Layer / File(s) Summary
ALLOW_ALL_NOTICE relocation and filtering
packages/intent/src/shared/cli-output.ts, packages/intent/src/core/source-policy.ts
ALLOW_ALL_NOTICE is now exported from cli-output.ts; printNotices filters to keep it visible when suppression is enabled instead of suppressing all notices; source-policy.ts imports and re-exports the constant.
Changeset and regression test
.changeset/forty-heads-fly.md, packages/intent/tests/cli.test.ts
Documents the fix in a changeset and adds a CLI test verifying --no-notices still surfaces the allow-all warning.

Command signature, lint, and test mock cleanups

Layer / File(s) Summary
Synchronous command signatures and import reformatting
packages/intent/src/commands/exclude.ts, packages/intent/src/commands/load.ts, packages/intent/src/commands/list.ts, packages/intent/src/staleness/check.ts
runExcludeCommand and runLoadCommand are changed from async Promise<void> to synchronous void; imports in list.ts and check.ts are reformatted.
ESLint path fix and lint script
eslint.config.js, packages/intent/package.json
Updates the static-discovery override path to discovery/scanner.ts and adds a test:eslint script.
Gate script regex fix
packages/intent/src/hooks/install.ts
Updates the character class in isIntentGateScriptReference to use an unescaped /.
Test mock and cast cleanups
packages/intent/tests/cli.test.ts, packages/intent/tests/stale-command.test.ts, packages/intent/tests/integration/source-policy-surfaces.test.ts, packages/intent/tests/hooks-install.test.ts
Replaces async mock json/callback implementations with explicit Promise.resolve/Promise.reject, and removes an unnecessary any cast.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI as intent list
  participant SourcePolicy as applySourcePolicy
  participant CliOutput as printNotices

  User->>CLI: intent list --no-notices
  CLI->>SourcePolicy: build notices for allow-all config
  SourcePolicy-->>CLI: notices [ALLOW_ALL_NOTICE, ...]
  CLI->>CliOutput: printNotices(notices, { noNotices: true })
  CliOutput->>CliOutput: filter notices to ALLOW_ALL_NOTICE only
  CliOutput-->>User: prints "All skill sources allowed" warning
Loading

Possibly related PRs

  • TanStack/intent#156: Both PRs touch the same ALLOW_ALL_NOTICE handling in cli-output.ts/source-policy.ts.
  • TanStack/intent#157: Both PRs modify the printNotices/--no-notices suppression pipeline.
  • TanStack/intent#180: Both PRs change the gate-script detection regex in isIntentGateScriptReference in install.ts.

Suggested reviewers: KevinVandy, schiller-manuel

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description summarizes changes, but it doesn't follow the required template or include the checklist and release-impact sections. Rewrite it using the template headings and add the checklist items plus release-impact selection, including whether a changeset was generated.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the lint cleanup plus notice-suppressibility fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/pre-m2-lint-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ba25ea9

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 13s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-02 00:51:23 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/TanStack/intent/@tanstack/intent@185

commit: ba25ea9

@LadyBluenotes LadyBluenotes merged commit b7920e9 into main Jul 2, 2026
9 checks passed
@LadyBluenotes LadyBluenotes deleted the chore/pre-m2-lint-cleanup branch July 2, 2026 00:55
@github-actions github-actions Bot mentioned this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant