# eslint-json-compat-utils

> A utility that converts rules made for checking the AST of `jsonc-eslint-parser` into rules compatible with `@eslint/json`.

Latest version **0.2.3** (published 2026-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-json-compat-utils
pnpm add eslint-json-compat-utils
yarn add eslint-json-compat-utils
bun add eslint-json-compat-utils
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2026-03-12 |
| First published | 2024-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 53.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Author | Yosuke Ota |
| Maintainers | ota-meshi |
| Keywords | eslint |

## Links

- npm: https://www.npmjs.com/package/eslint-json-compat-utils
- Repository: https://github.com/ota-meshi/eslint-json-compat-utils
- Homepage: https://github.com/ota-meshi/eslint-json-compat-utils#readme
- Issues: https://github.com/ota-meshi/eslint-json-compat-utils/issues
- npm.io page: https://npm.io/package/eslint-json-compat-utils

## Dependencies (1)

- [esquery](https://npm.io/package/esquery.md) ^1.6.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2026-03-12
- 0.2.2 — 2026-02-22
- 0.2.1 — 2024-11-10
- 0.2.0 — 2024-11-10
- 0.1.3 — 2024-11-10
- 0.1.2 — 2024-11-10
- 0.1.1 — 2024-11-10
- 0.1.0 — 2024-11-10

## README

# eslint-json-compat-utils

A utility that converts rules made for checking the AST of `jsonc-eslint-parser` into rules compatible with `@eslint/json`.

## Installation

```bash
npm install eslint-json-compat-utils
```

## Usage

```js
import { toCompatRule } from "eslint-json-compat-utils";

export default toCompatRule({
  meta: { /* ... */ },
  create(context) {
    return {
      JSONArrayExpression: check,
    };
  },
})
```

### API

#### `toCompatRule(rule)`

Converts a rule object for `jsonc-eslint-parser` into a rule object for `@eslint/json` compatible.

#### `toCompatPlugin(plugin)`

Converts a plugin object for `jsonc-eslint-parser` into a plugin object for `@eslint/json` compatible.

[Example]

#### `toCompatCreate(create)`

Converts a `create` function for `jsonc-eslint-parser` into a `create` function for `@eslint/json` compatible.

[Example]: https://eslint-online-playground.netlify.app/#eNqVVMtu2zAQ/BWCpzaIqKhJ0cK9FGhPObQFeixTgJVWDhOJFEgqqGHo37NL0or8SIL4IMuc2dnX0Fs+qPpercGXrbVl/iHuvDV8xbfSyCC5UT1IvmKSf+03ReYQX/LzxHgA57U1iXQhKnExQ752egieoC2LR3jYaYNPIoOndyaQP6MBfEbv4ltSIq2gXEaMbYB5cJgZq5WcKFOW4A08fIcBTAOm1pByz6lto/xtEvl7JapPoqoWKVI9Gf4oPj91MseKBv7Z0dR5Jscava1v1SzxYU/CbOqMVJfLOSE0OAhBg9vhoroSl7kzaSZ+nosTtTWtXmPbuCLdD9YFRgtjrbM9LSnRSjqT/Is0mZMXd72gJmYxdONam91mCwosUxJfOqht39Msm2fEfsXo1yWX4dtgv9l+UCEFTwfRRC8wLxKKMeguLdjA/xjcQKvGLrA/NJq42FZ34Fd4wM/O9kws+U2ebyoISTsnBMJ3w6fx75W6YvsVvjtq+H0KnaJEfOJ3WbLo5+vfP3+wWNVbauyUWY94HK1PS0hwRt0YBeb6M8fYohmHTtcqQHEPm2h3nKRzFq00NyiEWLQgothhBze4IGnQaMf/Awwlw2bInu9tg/FRnYDT943h59CNFNxhoflaJ8ryzj0DnnLES/ST9lsGED/equkRF9i8OQ==

---
_Source: https://npm.io/package/eslint-json-compat-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
