Skip to main content

@typescript-eslint/rule-schema-to-typescript-types

npm: @typescript-eslint/rule-schema-to-typescript-types v8.46.0

Converts ESLint rule schemas to equivalent TypeScript type strings ✨

import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types';

// "
// type Options = [
// /** My great option! */
// string[]
// ];
// "
schemaToTypes({
description: 'My great option!',
items: { type: 'string' },
type: 'array',
});

The following documentation is auto-generated from source code.

Functions

schemaToTypes()

function schemaToTypes(schema): string;

Defined in: index.ts:17

Converts rule options schema(s) to the equivalent TypeScript type string.

Parameters

ParameterTypeDescription
schemaJSONSchema4 | readonly JSONSchema4[]Original rule schema(s) as declared in meta.schema.

Returns

string

Stringified TypeScript type(s) equivalent to the options schema(s).