@drkmttr/adhere 0.24.0 → 0.24.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/package.json +6 -6
- package/skills/adhere/SKILL.md +6 -4
- package/src/readme-guide.ts +8 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drkmttr/adhere",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Lints a repository against the rules in .adhere/, judged by Jev.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -93,10 +93,10 @@
|
|
|
93
93
|
"--force"
|
|
94
94
|
],
|
|
95
95
|
"optionalDependencies": {
|
|
96
|
-
"@drkmttr/adhere-darwin-arm64": "0.24.
|
|
97
|
-
"@drkmttr/adhere-darwin-x64": "0.24.
|
|
98
|
-
"@drkmttr/adhere-linux-arm64": "0.24.
|
|
99
|
-
"@drkmttr/adhere-linux-x64": "0.24.
|
|
100
|
-
"@drkmttr/adhere-win32-x64": "0.24.
|
|
96
|
+
"@drkmttr/adhere-darwin-arm64": "0.24.1",
|
|
97
|
+
"@drkmttr/adhere-darwin-x64": "0.24.1",
|
|
98
|
+
"@drkmttr/adhere-linux-arm64": "0.24.1",
|
|
99
|
+
"@drkmttr/adhere-linux-x64": "0.24.1",
|
|
100
|
+
"@drkmttr/adhere-win32-x64": "0.24.1"
|
|
101
101
|
}
|
|
102
102
|
}
|
package/skills/adhere/SKILL.md
CHANGED
|
@@ -411,10 +411,12 @@ Oxlint. `adhere validate` reports rules left over that a linter could check.
|
|
|
411
411
|
An organization keeps its instructions, rules, and lint settings in one repo,
|
|
412
412
|
scaffolded by `adhere init --shared org/repo`. Its `README.md` carries a
|
|
413
413
|
managed guide between `<!-- adhere:rules:start -->` and
|
|
414
|
-
`<!-- adhere:rules:end -->`: a contents list
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
414
|
+
`<!-- adhere:rules:end -->`: a contents list linking the rules, lint settings,
|
|
415
|
+
and custom plugin sections. Under a level-two Rules heading, rules sort by
|
|
416
|
+
topic and id without visible topic headings. Each rule id opens an expandable
|
|
417
|
+
entry containing its description, its `RULE.md` examples and explanation,
|
|
418
|
+
and a source link under a stable permalink. The guide also lists every enabled
|
|
419
|
+
native setting in `oxlint/rules.json`
|
|
418
420
|
with its severity, and each custom plugin's enabled rules, linked to
|
|
419
421
|
`oxlint/plugins/<name>.js` when that is a local file. A `RULE.ts` is linked as
|
|
420
422
|
TypeScript source only: the guide never reads or runs it, and plugin code is
|
package/src/readme-guide.ts
CHANGED
|
@@ -356,15 +356,15 @@ const ruleEntry = (rule: ReadmeRule, anchor: string, used: Set<string>): Readonl
|
|
|
356
356
|
`<a id="${anchor}"></a>`,
|
|
357
357
|
"",
|
|
358
358
|
"<details>",
|
|
359
|
-
|
|
360
|
-
? `<summary><strong>TypeScript rule</strong> ${label}</summary>`
|
|
361
|
-
: `<summary><strong>${statement}</strong> ${label}</summary>`,
|
|
359
|
+
`<summary><h3>${label}</h3></summary>`,
|
|
362
360
|
"",
|
|
363
361
|
...(rule.name === "RULE.ts"
|
|
364
362
|
? [
|
|
365
363
|
`This rule is TypeScript, so the guide does not read or run it: [\`${rule.id}\`](${source}).`,
|
|
366
364
|
]
|
|
367
365
|
: [
|
|
366
|
+
statement,
|
|
367
|
+
"",
|
|
368
368
|
...(body === "" ? [] : [embedBody(source, anchor, body, used), ""]),
|
|
369
369
|
`Source: [\`${rule.id}\`](${source}).`,
|
|
370
370
|
]),
|
|
@@ -374,32 +374,25 @@ const ruleEntry = (rule: ReadmeRule, anchor: string, used: Set<string>): Readonl
|
|
|
374
374
|
};
|
|
375
375
|
|
|
376
376
|
/**
|
|
377
|
-
* The managed block's body:
|
|
378
|
-
*
|
|
379
|
-
*
|
|
377
|
+
* The managed block's body: section links, rules as expandable entries, then
|
|
378
|
+
* the lint settings and plugins. Rules sort by id and topics by name, so the
|
|
379
|
+
* same checkout always writes the same text.
|
|
380
380
|
*/
|
|
381
381
|
export const renderReadmeIndex = (rules: ReadonlyArray<ReadmeRule>, config: LintConfig): string => {
|
|
382
382
|
const entries = lintEntries(config);
|
|
383
383
|
const { topics, used } = topicsOf(rules);
|
|
384
384
|
const contents = [
|
|
385
385
|
`- [Rules](#${RULES_ANCHOR})`,
|
|
386
|
-
...topics.flatMap(({ name, anchor, rules: group }) => [
|
|
387
|
-
` - [\`${name}\`](#${anchor})`,
|
|
388
|
-
...group.map(({ rule, anchor: at }) => ` - [\`${rule.id}\`](#${at})`),
|
|
389
|
-
]),
|
|
390
386
|
`- [Lint settings](#${LINT_SETTINGS_ANCHOR})`,
|
|
391
387
|
`- [Custom lint plugins](#${PLUGINS_ANCHOR})`,
|
|
392
388
|
];
|
|
393
389
|
const body =
|
|
394
390
|
topics.length === 0
|
|
395
391
|
? ["- None.", ""]
|
|
396
|
-
: topics.flatMap(({
|
|
392
|
+
: topics.flatMap(({ anchor, rules: group }) => [
|
|
397
393
|
`<a id="${anchor}"></a>`,
|
|
398
394
|
"",
|
|
399
|
-
`#### ${name}`,
|
|
400
|
-
"",
|
|
401
395
|
...group.flatMap(({ rule, anchor: at }) => [...ruleEntry(rule, at, used), ""]),
|
|
402
|
-
backToContents,
|
|
403
396
|
"",
|
|
404
397
|
]);
|
|
405
398
|
return [
|
|
@@ -411,7 +404,7 @@ export const renderReadmeIndex = (rules: ReadonlyArray<ReadmeRule>, config: Lint
|
|
|
411
404
|
"",
|
|
412
405
|
`<a id="${RULES_ANCHOR}"></a>`,
|
|
413
406
|
"",
|
|
414
|
-
"
|
|
407
|
+
"## Rules",
|
|
415
408
|
"",
|
|
416
409
|
...body,
|
|
417
410
|
`<a id="${LINT_SETTINGS_ANCHOR}"></a>`,
|