> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install Loadwise, run a first check and apply a fix to a bundled example.

Use Node.js 22.13.0 or later. From the project root, install Loadwise from npm and run a check.

```sh theme={null}
npm install --save-dev loadwise
npx loadwise check
```

For a one-off scan, run `npx loadwise check` without adding a project dependency. Run `npx loadwise --version` to check the installed version. [Editor integration](https://loadwise.mintlify.site/editor.md) is optional.

By default `loadwise check` runs all five checkers; see the [corpus rule scorecard](https://github.com/IbrahimHafez1/loadwise/blob/main/bench/corpus/scorecard.md) for measured precision and recall across real-world open-source backends.

Use `npx loadwise explain <rule-id>` to understand a finding and `npx loadwise fix` to preview automatic edits. To focus on local changes, pass `--uncommitted` to both `check` and `fix`.

**Autofix example:** `npx loadwise fix --apply` rewrites eligible issues in place and verifies TypeScript projects with a post-edit typecheck:

```diff theme={null}
- const names = visible.map((order) => customers.find((c) => c.id === order.customerId)?.name ?? 'Unknown');
+ const customersById = new Map(customers.map((c) => [c.id, c] as const).reverse());
+ const names = visible.map((order) => customersById.get(order.customerId)?.name ?? 'Unknown');
```

**With an AI coding agent**, say **“Run Loadwise”** in your project chat. The agent can run the installed CLI directly. It should check the findings against the code, explain what it would fix or leave alone and why, and let you choose before making edits. [Active-agent workflow and optional MCP setup](https://loadwise.mintlify.site/ai-agents.md#using-loadwise-with-an-active-coding-agent)

## Try a finding and a fix

From a project where you ran `npm install --save-dev loadwise`, copy the bundled example to a disposable file and scan it. The copy command refuses to overwrite an existing file.

```sh theme={null}
node -e "require('node:fs').copyFileSync(require.resolve('loadwise/examples/slow.ts'), 'loadwise-demo.ts', require('node:fs').constants.COPYFILE_EXCL)"
npx loadwise perf loadwise-demo.ts
npx loadwise explain array-repeated-membership
```

The sample reports three findings and exits 1. The membership finding shows repeated array searches for allowed customer IDs. Read its diff and note, then replace `FINDING_ID` below with the ID printed after `#` on that finding.

```sh theme={null}
npx loadwise perf loadwise-demo.ts --fix --only FINDING_ID
npx loadwise perf loadwise-demo.ts
```

The second scan should report two findings. Remove the disposable copy when finished. In your own application, install its dependencies and generate any ORM client it uses, then run `npx loadwise check` from its root. Check the coverage notes for skipped inputs. Start with `--min-impact high` to triage a large report, then run without that filter to review the rest.

## Use Loadwise alongside a linter

Keep your existing linter for syntax-level rules and use Loadwise for checks that depend on how code behaves. In a local comparison with Oxlint 1.95.0 and Loadwise 0.7.0 at revision `f3a3342d`, Oxlint's `no-debugger` caught an added debugger statement. Loadwise's `array-repeated-membership` caught repeated array searches in the bundled example. Both reported a JSX image without alt text when the comparison enabled Oxlint's `jsx-a11y/alt-text` rule. Other projects may enable different rules and have different results. [Oxlint no-debugger](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger) · [Oxlint rule reference](https://oxc.rs/docs/guide/usage/linter/rules)

Create a fresh companion file with this command.

```sh theme={null}
node -e "require('node:fs').copyFileSync(require.resolve('loadwise/examples/slow.ts'), 'companion-demo.ts', require('node:fs').constants.COPYFILE_EXCL)"
```

Append a `debugger;` statement to `companion-demo.ts`. Add a separate file called `picture.tsx` containing this component.

```tsx theme={null}
export const Picture = () => <img src="/placeholder.png" />;
```

```sh theme={null}
npm install --save-dev --save-exact oxlint@1.95.0
npx oxlint -A all -D no-debugger -D jsx-a11y/alt-text --jsx-a11y-plugin companion-demo.ts picture.tsx
npx loadwise perf companion-demo.ts
npx loadwise a11y picture.tsx
```

Passing the paths explicitly includes these demo files even when your `tsconfig.json` only includes `src`.

If Oxlint owns alt text in JSX, disable only the duplicate Loadwise rule for JSX and TSX files. The example keeps Loadwise's alt-text reports for standalone HTML. Alternatively, let Loadwise own the rule and turn off Oxlint's `jsx-a11y/alt-text` rule.

```json theme={null}
{
  "overrides": [
    {
      "files": ["**/*.jsx", "**/*.tsx"],
      "rules": { "a11y-img-missing-alt": "off" }
    }
  ]
}
```

Keep approved versions in the lockfile and both rule configurations in the repository. With the example Oxlint rules configured in `.oxlintrc.json`, use these as separate CI steps so each publishes its own result.

```sh theme={null}
npm ci
npx oxlint
npx loadwise check --only perf,rel,a11y
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.