@kirill.konshin/lint 0.6.8 → 0.7.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.
- package/README.md +253 -94
- package/dist/configs/imports.js +3 -30
- package/dist/configs/react.d.ts +0 -15
- package/dist/configs/react.js +2 -36
- package/dist/configs/tailwind.d.ts +10 -0
- package/dist/configs/tailwind.js +25 -9
- package/dist/configs/testing.js +2 -41
- package/dist/configs/unicorn.js +2 -10
- package/dist/conventions.d.ts +12 -0
- package/dist/conventions.js +53 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/lib.d.ts +18 -1
- package/dist/lib.js +36 -2
- package/dist/lintPrepare.d.ts +2 -1
- package/dist/lintPrepare.js +13 -1
- package/dist/oxlintPlugin.d.ts +10 -0
- package/dist/oxlintPlugin.js +13 -0
- package/dist/testColocation.d.ts +10 -0
- package/dist/testColocation.js +45 -0
- package/dist/vitePlus.d.ts +58 -0
- package/dist/vitePlus.js +434 -0
- package/package.json +32 -9
- package/rules/agent.md +3 -0
- package/rules/code-style.md +1 -1
- package/rules/github.md +2 -1
- package/rules/gitlab.md +2 -1
- package/rules/jest.md +1 -1
- package/rules/markdown.md +11 -0
- package/rules/monorepo-turbo-nx.md +9 -0
- package/rules/mui.md +0 -2
- package/rules/npm-yarn.md +10 -1
- package/rules/nx.md +3 -2
- package/rules/playwright.md +18 -0
- package/rules/react.md +1 -3
- package/rules/tailwind.md +1 -0
- package/rules/testing.md +5 -2
- package/rules/typescript.md +5 -4
- package/rules/vite.md +5 -1
- package/{rules/electron.md → skills/lint-electron/SKILL.md} +5 -3
- package/skills/lint-github/SKILL.md +31 -1
- package/skills/lint-gitlab/SKILL.md +22 -1
- package/skills/lint-migrate/SKILL.md +24 -0
- package/skills/lint-repo/SKILL.md +21 -5
- package/skills/lint-webstorm/SKILL.md +55 -3
- package/skills/spec-steward/SKILL.md +72 -15
- package/skills/spec-steward/references/contract.md +6 -6
- package/skills/spec-tools/SKILL.md +11 -11
- package/skills/spec-tools/references/rules/common.md +32 -7
- package/skills/spec-tools/scripts/cli.js +18 -12
|
@@ -15,7 +15,7 @@ var __esmMin = (fn, res, err) => () => {
|
|
|
15
15
|
throw err = [e], e;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
18
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
19
19
|
var __exportAll = (all, no_symbols) => {
|
|
20
20
|
let target = {};
|
|
21
21
|
for (var name in all) __defProp(target, name, {
|
|
@@ -1564,13 +1564,13 @@ var require_stringifyPair = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1564
1564
|
//#endregion
|
|
1565
1565
|
//#region ../../node_modules/yaml/dist/log.js
|
|
1566
1566
|
var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1567
|
-
var node_process
|
|
1567
|
+
var node_process = __require("process");
|
|
1568
1568
|
function debug(logLevel, ...messages) {
|
|
1569
1569
|
if (logLevel === "debug") console.log(...messages);
|
|
1570
1570
|
}
|
|
1571
1571
|
function warn(logLevel, warning) {
|
|
1572
1572
|
if (logLevel === "debug" || logLevel === "warn") {
|
|
1573
|
-
if (typeof node_process
|
|
1573
|
+
if (typeof node_process.emitWarning === "function") node_process.emitWarning(warning);
|
|
1574
1574
|
else console.warn(warning);
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
@@ -4488,7 +4488,7 @@ var require_compose_doc = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4488
4488
|
//#endregion
|
|
4489
4489
|
//#region ../../node_modules/yaml/dist/compose/composer.js
|
|
4490
4490
|
var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4491
|
-
var node_process
|
|
4491
|
+
var node_process = __require("process");
|
|
4492
4492
|
var directives = require_directives();
|
|
4493
4493
|
var Document = require_Document();
|
|
4494
4494
|
var errors = require_errors();
|
|
@@ -4605,7 +4605,7 @@ var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4605
4605
|
}
|
|
4606
4606
|
/** Advance the composer by one CST token. */
|
|
4607
4607
|
*next(token) {
|
|
4608
|
-
if (node_process
|
|
4608
|
+
if (node_process.env.LOG_STREAM) console.dir(token, { depth: null });
|
|
4609
4609
|
switch (token.type) {
|
|
4610
4610
|
case "directive":
|
|
4611
4611
|
this.directives.add(token.source, (offset, message, warning) => {
|
|
@@ -7476,7 +7476,7 @@ var isCLike, isDoc, REGEX_AFTER, REGEX_KEYWORD, OPEN, indentOf, TEST_NAME, TEST_
|
|
|
7476
7476
|
var init_scan = __esmMin((() => {
|
|
7477
7477
|
isCLike = (file) => /\.(?:[cm]?[jt]sx?|go)$/i.test(file);
|
|
7478
7478
|
isDoc = (file) => /\.mdx?$/i.test(file);
|
|
7479
|
-
REGEX_AFTER = /* @__PURE__ */ new Set([..."(,=:[!&|?{};+-*%<>~^", ""]);
|
|
7479
|
+
REGEX_AFTER = /* @__PURE__ */ new Set([..."(,=:[!&|?{};+-*%<>~^".split(""), ""]);
|
|
7480
7480
|
REGEX_KEYWORD = /^(?:return|typeof|instanceof|in|of|new|delete|void|throw|case|do|else|yield|await)$/;
|
|
7481
7481
|
OPEN = {
|
|
7482
7482
|
"(": ")",
|
|
@@ -7689,7 +7689,7 @@ var init_citations = __esmMin((() => {
|
|
|
7689
7689
|
CITE = /((?:\.{1,2}\/)*(?:[\w@.-]+\/)*?openspec\/specs\/[\w./-]*?spec\.md)(?:#([\w-]+))?/g;
|
|
7690
7690
|
SKIP = /(?:^|\/)(?:node_modules|dist|build|coverage|\.git|\.nx|\.yarn|\.yalc|\.turbo|\.next|\.docusaurus|\.eve)(?:\/|$)|^openspec\/changes\/|(?:^|\/)spec\.md$/;
|
|
7691
7691
|
TEST_FILE = /(?:^|\/)(?:__tests__|e2e)\/|\.(?:test|spec|test-d)\.[cm]?[jt]sx?$|(?:^|\/)test_[^/]+\.py$|_test\.(?:py|go)$/;
|
|
7692
|
-
LINT_CONFIG = /(?:^|\/)(?:eslint\.config\.[cm]?[jt]s|yarn\.config\.cjs)$/;
|
|
7692
|
+
LINT_CONFIG = /(?:^|\/)(?:(?:eslint|vite)\.config\.[cm]?[jt]s|yarn\.config\.cjs)$/;
|
|
7693
7693
|
isTestFile = (file) => TEST_FILE.test(file) && !isDoc(file);
|
|
7694
7694
|
isLintConfig = (file) => LINT_CONFIG.test(file);
|
|
7695
7695
|
anchorCache = /* @__PURE__ */ new Map();
|
|
@@ -9389,6 +9389,7 @@ function rootsOf(opts, cwd = process.cwd()) {
|
|
|
9389
9389
|
/** A `P,F` pair of size lines, or the default. */
|
|
9390
9390
|
function pair(value, fallback) {
|
|
9391
9391
|
if (value === void 0) return fallback;
|
|
9392
|
+
if (typeof value !== "string" && typeof value !== "number") throw new UsageError(`bad size line: ${JSON.stringify(value)}`);
|
|
9392
9393
|
const [p, f] = String(value).split(",").map(Number);
|
|
9393
9394
|
if (!Number.isFinite(p) || f !== void 0 && !Number.isFinite(f)) throw new UsageError(`bad size line: ${value}`);
|
|
9394
9395
|
return [p, f ?? fallback[1]];
|
|
@@ -11648,7 +11649,7 @@ async function runClaude(run, wrote, budget, env, cwd) {
|
|
|
11648
11649
|
session
|
|
11649
11650
|
};
|
|
11650
11651
|
if (code !== 0) {
|
|
11651
|
-
const why =
|
|
11652
|
+
const why = typeof r?.result === "string" ? r.result.slice(0, 200) : "";
|
|
11652
11653
|
return {
|
|
11653
11654
|
status: `exit ${code}${why ? ` (${why})` : ""}`,
|
|
11654
11655
|
session
|
|
@@ -12364,7 +12365,7 @@ function scopeHeader(scope) {
|
|
|
12364
12365
|
}
|
|
12365
12366
|
function main$1(read = commitReader, env = process.env) {
|
|
12366
12367
|
const t = thresholds(env);
|
|
12367
|
-
const units = tryReadData(path$1.join(root(),
|
|
12368
|
+
const units = tryReadData(path$1.join(root(), ".spec-audit/parts/units.yaml")) ?? {};
|
|
12368
12369
|
const advisory = new Set(Object.entries(units).flatMap(([id, u]) => u.advisory ? [id] : []));
|
|
12369
12370
|
const scopePath = path$1.join(root(), SCOPE_FILE);
|
|
12370
12371
|
const scope = fs$1.existsSync(scopePath) ? readData(scopePath) : void 0;
|
|
@@ -12650,8 +12651,13 @@ function progress(event, now = /* @__PURE__ */ new Date()) {
|
|
|
12650
12651
|
const clock = now.toTimeString().slice(0, 8);
|
|
12651
12652
|
return (event.message?.content ?? []).filter((c) => c.type === "tool_use").map((c) => {
|
|
12652
12653
|
const i = c.input ?? {};
|
|
12653
|
-
const what =
|
|
12654
|
-
|
|
12654
|
+
const what = [
|
|
12655
|
+
i.description,
|
|
12656
|
+
i.file_path,
|
|
12657
|
+
i.pattern,
|
|
12658
|
+
i.command
|
|
12659
|
+
].find((v) => typeof v === "string") ?? "";
|
|
12660
|
+
return `[${clock}]${event.parent_tool_use_id ? " ↳" : ""} ${c.name} ${what.slice(0, 120)}\n`;
|
|
12655
12661
|
}).join("");
|
|
12656
12662
|
}
|
|
12657
12663
|
/** One headless session, streamed to the job log; its exit code, its result text and its session id. */
|
|
@@ -12879,7 +12885,7 @@ function comment(reviews, env = process.env) {
|
|
|
12879
12885
|
out.push(`| ${name} | ${MARKS[v.state] ?? `⚠️ ${v.state}`} | ${v.errors} | ${v.warnings} | ${reports(file.replace(/\.md$/, ""))} |`);
|
|
12880
12886
|
}
|
|
12881
12887
|
out.push("");
|
|
12882
|
-
if (fs$1.existsSync(
|
|
12888
|
+
if (fs$1.existsSync(".spec-audit/coverage.md")) out.push(`Coverage: ${reports(COVERAGE_REPORT.replace(/\.md$/, ""))}`, "");
|
|
12883
12889
|
const diff = read(DIFF_FILE);
|
|
12884
12890
|
if (diff !== void 0) out.push(`Specification diff — ${diff.split("\n")[0]}: ${reports(DIFF_FILE.replace(/\.md$/, ""))}`, "");
|
|
12885
12891
|
const gating = env.AUDIT_GATING || "gating";
|