blamouche_obsidian-any-ai-code/.github/workflows/ci.yml
blamouche 89ab3ae679 Add eslint-plugin-obsidianmd and resolve every recommended-rule violation
Install the official Obsidian ESLint plugin (with eslint v9 and
@typescript-eslint/parser) and add an eslint.config.mjs flat config
that wires the recommended ruleset to TS files only, with a small
override turning off hardcoded-config-path for the tests directory
(those literal `.obsidian` strings are unit-test fixtures, not real
Obsidian configuration usage). Add an `npm run lint` script and call
it from the CI workflow before tests so guideline violations surface
on every push and PR.

Resolved every reported violation:

- UI text sentence case: button labels @Active file/@Active folder ->
  @active file/@active folder; "(no runtime configured)" placeholder
  capitalised; ribbon tooltip "Open Any AI CLI" -> "Open AI CLI panel";
  command-list placeholders, descriptions, and the runtimes-section
  empty state reworded to drop ambiguous mid-sentence acronyms (PTY,
  CLIs, Node) and quoted button names.
- commands/no-plugin-name-in-command-name: command palette name
  "Open Any AI CLI" -> "Open panel" (Obsidian shows the plugin name
  next to the command, repeating it is redundant).
- prefer-active-doc on globalThis: replace the inline crypto fallback
  in runtime-utils.ts with `import { randomUUID } from "node:crypto"`.
- no-unsupported-api on Workspace.revealLeaf: bump manifest.json
  minAppVersion to 1.7.2 (the version that introduced revealLeaf) and
  await the call. versions.json maps 0.1.38 -> 1.7.2 while older
  entries stay at 1.5.0 so existing downloads keep resolving.

Lint, build, tsc and the 27 vitest cases are all clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 14:20:53 +02:00

31 lines
486 B
YAML

name: CI
on:
push:
branches: ["**"]
pull_request:
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Build
run: npm run build