Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ignorePatterns": ["packages/cli/test/fixtures/source-regressions/humanlayer/**"],
"jsPlugins": ["./lint/oxlint-plugin-skit.mjs"],
"rules": {
"skit/no-middle-dot-delimiter": "error",
"effecttsgo/experimental-api-usage": "off",
"oxc/no-barrel-file": "error",
"skit/frontend-no-resources": "error",
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ Agents such as Codex and Claude Code can run setup for you: they review the plan

The experimental `skit usage` command shows observed skill calls, instruction loads, and document reads from local Claude Code and Codex transcripts over the last seven days. Use `--days 30`, `--harness codex`, `--project .`, or `--json` to narrow the report or read structured output. See [local skill activity](docs/skill-usage.md) for evidence categories and coverage limits.

## Authoring skills (experimental)

`skit author` exposes `init`, `validate`, `sync`, `publish`, `list`, `delete`, and
`invocation`. These commands and their output formats are experimental and may
change between releases. Run `skit author --help` or a subcommand's `--help` for
usage. Synchronization is manual; automatic background sync and per-skill live
installation updates are not available yet.

## Enabling and disabling skills

Use the interactive flows:
Expand Down
27 changes: 27 additions & 0 deletions lint/oxlint-plugin-skit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,33 @@ const effectRules = {
export default {
meta: { name: "skit" },
rules: {
"no-middle-dot-delimiter": {
meta: {
type: "problem",
docs: { description: "Disallow middle dots in presentation strings" },
messages: {
forbidden:
"Do not use a middle dot as a delimiter. Use labels, parentheses, newlines, or a plain separator.",
},
},
create(context) {
const check = (node, value) => {
if (typeof value === "string" && value.includes(String.fromCodePoint(0xb7)))
context.report({ node, messageId: "forbidden" });
};
return {
Literal(node) {
check(node, node.value);
},
TemplateElement(node) {
check(node, node.value.cooked ?? node.value.raw);
},
JSXText(node) {
check(node, node.value);
},
};
},
},
...effectRules,
...effectHygieneRules,
...libraryRules,
Expand Down
36 changes: 34 additions & 2 deletions lint/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface Diagnostic {
}

const allRules = [
"no-middle-dot-delimiter",
"no-record-any",
"no-record-unknown",
"no-run-skit",
Expand All @@ -32,9 +33,9 @@ const allRules = [
];

/** Runs the plugin over one source file and returns its diagnostics, newest oxlint JSON format. */
async function lint(source: string): Promise<Diagnostic[]> {
async function lint(source: string, extension = "ts"): Promise<Diagnostic[]> {
const directory = await mkdtemp(join(tmpdir(), "skit-lint-"));
const file = join(directory, "sample.ts");
const file = join(directory, `sample.${extension}`);
await writeFile(file, source);
await writeFile(
join(directory, ".oxlintrc.json"),
Expand Down Expand Up @@ -508,3 +509,34 @@ describe("skit/no-node-fs", () => {
]);
});
});

describe("skit/no-middle-dot-delimiter", () => {
test("rejects JSX text and attributes", async () => {
const dot = String.fromCodePoint(0xb7);
expect(await lint(`<div title="one ${dot} two">one ${dot} two</div>`, "tsx")).toEqual(
[1, 1].map((line) => ({ code: "skit(no-middle-dot-delimiter)", line })),
);
});
test("rejects literal and escaped middle dots in strings and templates", async () => {
expect(
await lint(
[
`const a = "one ${String.fromCodePoint(0xb7)} two";`,
'const b = "one \\u00b7 two";',
"const c = `one " + String.fromCodePoint(0xb7) + " ${name}`;",
"const d = `one \\u00b7 ${name}`;",
].join("\n"),
),
).toEqual([1, 2, 3, 4].map((line) => ({ code: "skit(no-middle-dot-delimiter)", line })));
});

test("allows ordinary separators and middle dots in comments", async () => {
expect(
await lint(
"// one " +
String.fromCodePoint(0xb7) +
' two\nconst a = "one | two"; const b = `one (${name})`;',
),
).toEqual([]);
});
});
Loading
Loading