agentleFS
indrazmindrazm/personal-skills/skills/oxlint-setup/SKILL.md

oxlint-setup

Skill15 starsChanged 6 days agoMITView on GitHub

Sets up and maintains the standard Bun + oxlint + oxfmt configuration and custom 14-rule JS plugin (no-comments, no-barrel-file, no-atom-import, no-base-ui-outside-ui, no-native-primitives, padded-if, no-array-filter-map, no-module-mocking, and more). Use when bootstrapping linting in a repository, migrating from ESLint/Prettier to oxlint/oxfmt, or adding custom oxlint rules.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run scripts/apply-oxlint.sh against the target repository (skips existing files unless --force is passed):

    line 32
  2. Very specific:

    Add repo-specific generated paths to ignorePatterns (keep UI primitives directory such as packages/ui/src or src/components ignored if …

    line 47
  3. Distinctive:

    Run the custom rule unit test suite:

    line 63
  4. Distinctive:

    Run the linter and formatter check across the repo:

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Oxlint Standard Setup

Install and maintain the standard strict oxlint + oxfmt configuration and custom 14-rule JS plugin (zstack/*) bundled in assets/oxlint/.

When to Use

  • Bootstrapping linting and formatting in a new TypeScript / Bun repository
  • Migrating an existing repo from ESLint/Prettier to bun lint (oxlint) and bun fmt (oxfmt)
  • Adding, auditing, or testing custom JS lint rules in tooling/oxlint/

Bundled Assets

  • assets/.oxlintrc.json — Strict baseline (correctness, suspicious, perf = error) with typescript, unicorn, oxc, import, and all 14 zstack/* custom rules.
  • assets/.oxfmtrc.json — Standard ignore patterns for bun fmt.
  • assets/oxlint/ — Complete JS plugin (plugin.mjs), shared AST helpers (shared/), Bun test harness (testing/lint.mjs), and all 14 rules with unit tests (rules/*.mjs, rules/*.test.mjs):
    • Architecture & UI: no-atom-import, no-barrel-file, no-base-ui-outside-ui, no-native-primitives
    • Code hygiene & style: no-comments, padded-if, no-conditional-spread
    • Type safety & performance: no-array-filter-map, no-chained-type-assertions, no-reduce-accumulator-copy, no-reflect-apply, no-reflect-get, no-unknown-type-aliases
    • Testing discipline: no-module-mocking

Workflow

Resolve <skill-dir> to the directory containing this SKILL.md.

Step 1: Scaffold Config & Plugin

Run scripts/apply-oxlint.sh against the target repository (skips existing files unless --force is passed):

bash <skill-dir>/scripts/apply-oxlint.sh --repo .

This installs:

  • tooling/oxlint/ (plugin, 14 rules, unit tests, shared helpers)
  • .oxlintrc.json
  • .oxfmtrc.json

Step 2: Tailor to Repository Layout

Inspect the target repo and adjust .oxlintrc.json if needed:

  • Add repo-specific generated paths to ignorePatterns (keep UI primitives directory such as packages/ui/src or src/components ignored if wrapping native HTML elements).
  • For backend-only repos without React/Base UI/Jotai, keep the rules enabled (they are no-ops without matching files) or disable UI-only rules explicitly if requested.
  • Wire root package.json scripts:
    {
      "scripts": {
        "lint": "bun lint",
        "lint:fix": "bun lint --fix",
        "format": "bun fmt",
        "format:check": "bun fmt --check"
      }
    }

Step 3: Verify Rules & Codebase

  1. Run the custom rule unit test suite:
    bun test tooling/oxlint
  2. Run the linter and formatter check across the repo:
    bun lint && bun fmt --check
  3. Fix any surfaced violations at the root rather than weakening rules.

Red Flags

  • Weakening or disabling rules in .oxlintrc.json to silence real violations instead of fixing code
  • Adding a new custom rule to tooling/oxlint/rules/ without a co-located *.test.mjs file
  • Keeping ESLint or Prettier configs alongside oxlint/oxfmt after migration completes

Gotchas

  • zstack/no-chained-type-assertions is intentionally relaxed only for test files (**/*.test.ts, **/*.test.tsx, e2e/**, **/testing/**) via overrides in .oxlintrc.json.
  • zstack/no-comments preserves tool directives (@ts-*, oxlint-disable, /// <reference>).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.