eslint-json-compat-utils
v0.2.1
Published
A utility that converts rules made for checking the AST of `jsonc-eslint-parser` into rules compatible with `@eslint/json`.
Downloads
424,429
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
npm install eslint-json-compat-utils
Usage
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.
toCompatCreate(create)
Converts a create
function for jsonc-eslint-parser
into a create
function for @eslint/json
compatible.