oxlint-plugin-jev
Oxlint rules written as plain-English questions about a function, call, JSX element or file, reported when the yes-probability clears your cutoff.
# oxlint-plugin-jev
> [!WARNING]
> This package is experimental. Use at your own risk.
[Oxlint](https://oxc.rs/docs/guide/usage/linter.html) rules written in plain English, answered by [TypeSafe Jev](https://typesafe.ai).
A rule is a yes/no question about a function, a call, a JSX element, or a whole file. Each match is sent to Jev with the question, and the plugin reports an error when the yes-probability clears your cutoff.
## Install
```sh
npm i -D oxlint oxlint-plugin-jev
export TYPESAFE_API_KEY="..." # https://console.typesafe.ai
```
In CI, set `ci: "fail"` so a run that could not reach Jev fails instead of passing quietly.
## Config
Add the plugin and its one rule, `jev/ask`, to `.oxlintrc.json`. Your English rules go in the options.
```json
{
"jsPlugins": ["oxlint-plugin-jev"],
"rules": {
"jev/ask": [
"error",
{
"rules": [
{
"id": "no-pii-in-logs",
"target": "call",
"question": "Does this call write personal data, such as an email or phone number, to a log or console?",
"cutoff": 0.8
},
{
"id": "name-matches-behavior",
"target": "function",
"question": "Does this function's name imply it only reads data, while its body also writes or sends something?",
"cutoff": 0.6
}
]
}
]
}
}
```
| Field | What it is |
| ---------- | ------------------------------------------------------------ |
| `id` | Shown in the error message. Unique in the list. |
| `target` | `"function"`, `"call"`, `"jsx"`, or `"file"`. |
| `question` | A yes/no question. "Yes" means "report this". |
| `cut