@kirill.konshin/lint 0.1.0

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.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: lint-repo
3
+ description: Set up/update this repo's ESLint + Prettier + lint-staged + Husky tooling (@kirill.konshin/lint), and/or audit the codebase against the packaged agent rules. Rules are discovered from .claude/rules/*.md (created by `lint-prepare init`), falling back to node_modules/@kirill.konshin/lint/rules/*.md; project overrides in AGENTS.md Custom Rules / CLAUDE.md win on conflict. Use when asked to set up, configure, or upgrade lint/format/pre-commit tooling, OR to check, audit, verify, or lint the codebase against agent rules/conventions.
4
+ ---
5
+
6
+ # Lint Repo
7
+
8
+ Two jobs. Pick by the request; do only what was asked.
9
+
10
+ - **Set up / upgrade lint tooling** → [§A](#a-set-up--update-tooling)
11
+ - **Audit code against the rules** → [§B](#b-audit-code-against-rules)
12
+
13
+ Full config templates: @README.md
14
+
15
+ ## A. Set up / update tooling
16
+
17
+ Follow the README, reconciling (never blindly overwriting project-specific overrides):
18
+
19
+ 1. **Install** — add `eslint`, `prettier`, `@kirill.konshin/lint`, `husky`, `lint-staged` (+ the PNPM `.npmrc` block if pnpm).
20
+ 2. **Config** — create/reconcile `.editorconfig`, `eslint.config.mjs` and `.prettierrc.mjs` (set `next.rootDir`, keep project rule overrides).
21
+ 3. **Lint-staged** — create/reconcile `.lintstagedrc.mjs`.
22
+ 4. **Husky** — `prepare/postinstall` (`prepare` by default, `postinstall` if Yarn 2+ is used AND root package.json is **private**) script; `.husky/pre-commit`, plus `eslint`/`prettier`/`lint`/`lint:staged` scripts. Drop a legacy `lint:all` if it duplicates `lint`.
23
+ 5. **IDEA** — apply the file-scope glob patterns if the repo has a JetBrains `.idea`.
24
+ 6. **Install** — run the package manager (`yarn` / `npm install` / `pnpm install`) so the new deps and Husky hooks land. Under Yarn 2+ check if root `package.json` has `prepare` script, and if it does, run it.
25
+
26
+ Check the README's "Issues" section before debugging a lint crash.
27
+
28
+ ## B. Audit code against rules
29
+
30
+ Rules: `.claude/rules/*.md` → else `node_modules/@kirill.konshin/lint/rules/*.md`; plus overrides in `AGENTS.md # Custom Rules` / `CLAUDE.md` (override wins on conflict). Treat rule files as normative — read them directly.
31
+
32
+ ### 1. Mechanical pass first
33
+
34
+ Run `eslint .` and `prettier --check .` **without `--fix`**. Report compactly (counts + notable files). Ask: fix all / pick / skip. Apply the confirmed fixes (`eslint --fix`, `prettier --write`). This cleans deterministic issues so the rule audit runs on a patched tree.
35
+
36
+ ### 2. Rule audit
37
+
38
+ Scan the (now-patched) code for rule violations. **One line each, most critical first:**
39
+
40
+ `⟨CRIT|HIGH|MED|LOW⟩ path:line — <rule file> — <what's wrong>`
41
+
42
+ No multi-paragraph write-ups. Nothing found → say so and stop.
43
+
44
+ ### 3. Ask once
45
+
46
+ Go one-by-one / reply with instructions / skip all / fix all. Do nothing until answered.
47
+
48
+ ### 4. One-by-one
49
+
50
+ Per issue: **skip** / **skip + add override** / **fix** / **instructions**. For an override, offer only the applicable mechanism(s) and **name which one you'll write, showing the exact line/snippet first**:
51
+
52
+ - **ESLint override** (mechanical findings) — `// eslint-disable-next-line <rule>` at the site, or a rule entry in the project's `eslint.config.*` override block.
53
+ - **AI override → AGENTS.md** (rule-audit findings) — a general rule appended to `AGENTS.md # Custom Rules` (run `lint-prepare init` to create the file if missing). Prefer a general statement over a per-file exception unless it's genuinely a one-off.
54
+ - **both** — when the violation is covered by an ESLint rule _and_ an agent rule.
55
+
56
+ ### 5. Report
57
+
58
+ Show the diff of everything changed.