@typescript-eslint/rule-schema-to-typescript-types
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
Parameter | Type | Description |
---|---|---|
schema | JSONSchema4 | readonly JSONSchema4 [] | Original rule schema(s) as declared in meta.schema . |
Returns
string
Stringified TypeScript type(s) equivalent to the options schema(s).