routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
Generated
Vendored
+113
@@ -0,0 +1,113 @@
|
||||
import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'
|
||||
/**
|
||||
* JSON schema for the newlines between option. Validates configuration for
|
||||
* adding newlines between different groups.
|
||||
*/
|
||||
export declare let newlinesBetweenJsonSchema: JSONSchema4
|
||||
/**
|
||||
* JSON schema for the newlines inside option.
|
||||
*/
|
||||
export declare let newlinesInsideJsonSchema: JSONSchema4
|
||||
export declare function buildGroupsJsonSchema({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}: {
|
||||
additionalSortProperties: Record<string, JSONSchema4> | undefined
|
||||
allowedAdditionalTypeValues: undefined | string[]
|
||||
}): JSONSchema4
|
||||
/**
|
||||
* Builds JSON schema for custom groups array configuration.
|
||||
*
|
||||
* Creates a schema that validates an array of custom group definitions.
|
||||
* Supports both single custom groups and "anyOf" groups containing multiple
|
||||
* subgroups. Each group must have a groupName and can include various matching
|
||||
* criteria.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // Valid configuration:
|
||||
* ;[
|
||||
* {
|
||||
* groupName: 'react',
|
||||
* anyOf: [{ elementNamePattern: 'use*' }, { selector: 'hook' }],
|
||||
* },
|
||||
* {
|
||||
* groupName: 'utils',
|
||||
* elementNamePattern: '*Utils',
|
||||
* },
|
||||
* ]
|
||||
* ```
|
||||
*
|
||||
* @param options - Configuration options.
|
||||
* @param options.additionalSortProperties - Extra properties for sorting.
|
||||
* @param options.additionalCustomGroupMatchProperties - Extra properties for
|
||||
* matching custom groups.
|
||||
* @returns JSON schema for custom groups array validation.
|
||||
*/
|
||||
export declare function buildCustomGroupsArrayJsonSchema({
|
||||
additionalCustomGroupMatchProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}: {
|
||||
additionalCustomGroupMatchProperties: Record<string, JSONSchema4> | undefined
|
||||
additionalSortProperties: Record<string, JSONSchema4> | undefined
|
||||
allowedAdditionalTypeValues: undefined | string[]
|
||||
}): JSONSchema4
|
||||
export declare function buildCommonGroupsJsonSchemas({
|
||||
additionalCustomGroupMatchProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}?: {
|
||||
additionalCustomGroupMatchProperties?: Record<string, JSONSchema4>
|
||||
additionalSortProperties?: Record<string, JSONSchema4>
|
||||
allowedAdditionalTypeValues?: string[]
|
||||
}): Record<string, JSONSchema4>
|
||||
/**
|
||||
* Builds JSON schema for custom group modifiers configuration.
|
||||
*
|
||||
* Creates a schema that validates an array of modifiers that must be present on
|
||||
* an element for it to match a custom group.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // For TypeScript class members:
|
||||
* buildCustomGroupModifiersJsonSchema([
|
||||
* 'static',
|
||||
* 'private',
|
||||
* 'readonly',
|
||||
* 'async',
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @param modifiers - Array of valid modifier names.
|
||||
* @returns JSON schema for modifiers array validation.
|
||||
*/
|
||||
export declare function buildCustomGroupModifiersJsonSchema(
|
||||
modifiers: readonly string[],
|
||||
): JSONSchema4
|
||||
/**
|
||||
* Builds JSON schema for custom group selector configuration.
|
||||
*
|
||||
* Creates a schema that validates a selector string used to match specific
|
||||
* types of elements in a custom group.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // For class members:
|
||||
* buildCustomGroupSelectorJsonSchema([
|
||||
* 'property',
|
||||
* 'method',
|
||||
* 'constructor',
|
||||
* 'accessor',
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @param selectors - Array of valid selector names.
|
||||
* @returns JSON schema for selector validation.
|
||||
*/
|
||||
export declare function buildCustomGroupSelectorJsonSchema(
|
||||
selectors: readonly string[],
|
||||
): JSONSchema4
|
||||
Generated
Vendored
+299
@@ -0,0 +1,299 @@
|
||||
import {
|
||||
buildFallbackSortJsonSchema,
|
||||
buildRegexJsonSchema,
|
||||
buildTypeJsonSchema,
|
||||
orderJsonSchema,
|
||||
} from './common-json-schemas.js'
|
||||
/**
|
||||
* JSON schema for the newlines between option. Validates configuration for
|
||||
* adding newlines between different groups.
|
||||
*/
|
||||
var newlinesBetweenJsonSchema = {
|
||||
oneOf: [
|
||||
{
|
||||
description: 'Specifies how to handle newlines between groups.',
|
||||
enum: ['ignore'],
|
||||
type: 'string',
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
minimum: 0,
|
||||
},
|
||||
],
|
||||
}
|
||||
/**
|
||||
* JSON schema for the newlines inside option.
|
||||
*/
|
||||
var newlinesInsideJsonSchema = {
|
||||
oneOf: [
|
||||
{
|
||||
description: 'Specifies how to handle newlines between groups elements',
|
||||
enum: ['ignore'],
|
||||
type: 'string',
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
minimum: 0,
|
||||
},
|
||||
],
|
||||
}
|
||||
function buildGroupsJsonSchema({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}) {
|
||||
return {
|
||||
items: {
|
||||
oneOf: [
|
||||
{ type: 'string' },
|
||||
{
|
||||
items: { type: 'string' },
|
||||
type: 'array',
|
||||
minItems: 1,
|
||||
},
|
||||
{
|
||||
properties: { newlinesBetween: newlinesBetweenJsonSchema },
|
||||
required: ['newlinesBetween'],
|
||||
additionalProperties: false,
|
||||
type: 'object',
|
||||
},
|
||||
{
|
||||
properties: {
|
||||
group: {
|
||||
oneOf: [
|
||||
{ type: 'string' },
|
||||
{
|
||||
items: { type: 'string' },
|
||||
type: 'array',
|
||||
minItems: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
fallbackSort: buildFallbackSortJsonSchema({
|
||||
additionalProperties: additionalSortProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
}),
|
||||
commentAbove: {
|
||||
description: 'Specifies a comment to enforce above the group.',
|
||||
type: 'string',
|
||||
},
|
||||
type: buildTypeJsonSchema({
|
||||
allowedAdditionalValues: allowedAdditionalTypeValues,
|
||||
}),
|
||||
newlinesInside: newlinesInsideJsonSchema,
|
||||
order: orderJsonSchema,
|
||||
...additionalSortProperties,
|
||||
},
|
||||
additionalProperties: false,
|
||||
required: ['group'],
|
||||
minProperties: 2,
|
||||
type: 'object',
|
||||
},
|
||||
],
|
||||
},
|
||||
description: 'Specifies a list of groups for sorting.',
|
||||
type: 'array',
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Builds JSON schema for custom groups array configuration.
|
||||
*
|
||||
* Creates a schema that validates an array of custom group definitions.
|
||||
* Supports both single custom groups and "anyOf" groups containing multiple
|
||||
* subgroups. Each group must have a groupName and can include various matching
|
||||
* criteria.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // Valid configuration:
|
||||
* ;[
|
||||
* {
|
||||
* groupName: 'react',
|
||||
* anyOf: [{ elementNamePattern: 'use*' }, { selector: 'hook' }],
|
||||
* },
|
||||
* {
|
||||
* groupName: 'utils',
|
||||
* elementNamePattern: '*Utils',
|
||||
* },
|
||||
* ]
|
||||
* ```
|
||||
*
|
||||
* @param options - Configuration options.
|
||||
* @param options.additionalSortProperties - Extra properties for sorting.
|
||||
* @param options.additionalCustomGroupMatchProperties - Extra properties for
|
||||
* matching custom groups.
|
||||
* @returns JSON schema for custom groups array validation.
|
||||
*/
|
||||
function buildCustomGroupsArrayJsonSchema({
|
||||
additionalCustomGroupMatchProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}) {
|
||||
let commonCustomGroupJsonSchemas = buildCommonCustomGroupJsonSchemas({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
})
|
||||
let populatedCustomGroupMatchOptionsJsonSchema =
|
||||
buildPopulatedCustomGroupMatchPropertiesJsonSchema(
|
||||
additionalCustomGroupMatchProperties,
|
||||
)
|
||||
return {
|
||||
items: {
|
||||
oneOf: [
|
||||
{
|
||||
properties: {
|
||||
...commonCustomGroupJsonSchemas,
|
||||
anyOf: {
|
||||
items: {
|
||||
properties: populatedCustomGroupMatchOptionsJsonSchema,
|
||||
description: 'Custom group.',
|
||||
additionalProperties: false,
|
||||
type: 'object',
|
||||
},
|
||||
type: 'array',
|
||||
minItems: 1,
|
||||
},
|
||||
},
|
||||
description: 'Custom group block.',
|
||||
required: ['groupName', 'anyOf'],
|
||||
additionalProperties: false,
|
||||
type: 'object',
|
||||
},
|
||||
{
|
||||
properties: {
|
||||
...commonCustomGroupJsonSchemas,
|
||||
...populatedCustomGroupMatchOptionsJsonSchema,
|
||||
},
|
||||
description: 'Custom group.',
|
||||
additionalProperties: false,
|
||||
required: ['groupName'],
|
||||
minProperties: 2,
|
||||
type: 'object',
|
||||
},
|
||||
],
|
||||
},
|
||||
description: 'Defines custom groups to match specific members.',
|
||||
type: 'array',
|
||||
}
|
||||
}
|
||||
function buildCommonGroupsJsonSchemas({
|
||||
additionalCustomGroupMatchProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
} = {}) {
|
||||
return {
|
||||
customGroups: buildCustomGroupsArrayJsonSchema({
|
||||
additionalCustomGroupMatchProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}),
|
||||
newlinesInside: {
|
||||
oneOf: [
|
||||
newlinesInsideJsonSchema,
|
||||
{
|
||||
enum: ['newlinesBetween'],
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
},
|
||||
groups: buildGroupsJsonSchema({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}),
|
||||
newlinesBetween: newlinesBetweenJsonSchema,
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Builds JSON schema for custom group modifiers configuration.
|
||||
*
|
||||
* Creates a schema that validates an array of modifiers that must be present on
|
||||
* an element for it to match a custom group.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // For TypeScript class members:
|
||||
* buildCustomGroupModifiersJsonSchema([
|
||||
* 'static',
|
||||
* 'private',
|
||||
* 'readonly',
|
||||
* 'async',
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @param modifiers - Array of valid modifier names.
|
||||
* @returns JSON schema for modifiers array validation.
|
||||
*/
|
||||
function buildCustomGroupModifiersJsonSchema(modifiers) {
|
||||
return {
|
||||
items: {
|
||||
enum: [...modifiers],
|
||||
type: 'string',
|
||||
},
|
||||
description: 'Modifier filters.',
|
||||
type: 'array',
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Builds JSON schema for custom group selector configuration.
|
||||
*
|
||||
* Creates a schema that validates a selector string used to match specific
|
||||
* types of elements in a custom group.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* // For class members:
|
||||
* buildCustomGroupSelectorJsonSchema([
|
||||
* 'property',
|
||||
* 'method',
|
||||
* 'constructor',
|
||||
* 'accessor',
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @param selectors - Array of valid selector names.
|
||||
* @returns JSON schema for selector validation.
|
||||
*/
|
||||
function buildCustomGroupSelectorJsonSchema(selectors) {
|
||||
return {
|
||||
description: 'Selector filter.',
|
||||
enum: [...selectors],
|
||||
type: 'string',
|
||||
}
|
||||
}
|
||||
function buildCommonCustomGroupJsonSchemas({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}) {
|
||||
return {
|
||||
fallbackSort: buildFallbackSortJsonSchema({
|
||||
additionalProperties: additionalSortProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
}),
|
||||
type: buildTypeJsonSchema({
|
||||
allowedAdditionalValues: allowedAdditionalTypeValues,
|
||||
}),
|
||||
groupName: {
|
||||
description: 'Custom group name.',
|
||||
type: 'string',
|
||||
},
|
||||
newlinesInside: newlinesInsideJsonSchema,
|
||||
order: orderJsonSchema,
|
||||
...additionalSortProperties,
|
||||
}
|
||||
}
|
||||
function buildPopulatedCustomGroupMatchPropertiesJsonSchema(
|
||||
customGroupMatchOptionsJsonSchema,
|
||||
) {
|
||||
return {
|
||||
elementNamePattern: buildRegexJsonSchema(),
|
||||
...customGroupMatchOptionsJsonSchema,
|
||||
}
|
||||
}
|
||||
export {
|
||||
buildCommonGroupsJsonSchemas,
|
||||
buildCustomGroupModifiersJsonSchema,
|
||||
buildCustomGroupSelectorJsonSchema,
|
||||
newlinesBetweenJsonSchema,
|
||||
}
|
||||
Generated
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'
|
||||
/**
|
||||
* JSON schema for the sort order option. Validates ascending or descending sort
|
||||
* direction.
|
||||
*/
|
||||
export declare let orderJsonSchema: JSONSchema4
|
||||
export declare let matchesAstSelectorJsonSchema: JSONSchema4
|
||||
/**
|
||||
* Builds a collection of common JSON schemas used across sorting rules.
|
||||
*
|
||||
* Creates schemas for standard sorting options that are shared by multiple
|
||||
* rules. This ensures consistent validation across the plugin.
|
||||
*
|
||||
* @param options - Configuration options.
|
||||
* @param options.additionalSortProperties - Extra sort-related option schemas
|
||||
* to add at the root level and inside fallbackSort.
|
||||
* @returns Object containing common JSON schemas for rule validation.
|
||||
*/
|
||||
export declare function buildCommonJsonSchemas({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
}?: {
|
||||
additionalSortProperties?: Record<string, JSONSchema4>
|
||||
allowedAdditionalTypeValues?: string[]
|
||||
}): Record<string, JSONSchema4>
|
||||
/**
|
||||
* Builds JSON schema for fallback sort configuration.
|
||||
*
|
||||
* Creates a schema for the fallback sorting option that is applied when the
|
||||
* primary sort results in equality. Allows customization through additional
|
||||
* properties.
|
||||
*
|
||||
* @param options - Configuration options.
|
||||
* @param options.additionalProperties - Extra properties to include in the
|
||||
* schema.
|
||||
* @returns JSON schema for fallback sort validation.
|
||||
*/
|
||||
export declare function buildFallbackSortJsonSchema({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalProperties,
|
||||
}: {
|
||||
additionalProperties: Record<string, JSONSchema4> | undefined
|
||||
allowedAdditionalTypeValues: undefined | string[]
|
||||
}): JSONSchema4
|
||||
/**
|
||||
* Builds JSON schema for conditional configuration blocks.
|
||||
*
|
||||
* Creates a schema for configuration that is applied only when certain
|
||||
* conditions are met. Used for context-specific sorting rules where different
|
||||
* configurations apply based on element patterns.
|
||||
*
|
||||
* @param options - Configuration options for the conditional block.
|
||||
* @param options.additionalProperties - Extra properties to include in the
|
||||
* schema.
|
||||
* @returns JSON schema for conditional configuration validation.
|
||||
*/
|
||||
export declare function buildUseConfigurationIfJsonSchema({
|
||||
additionalProperties,
|
||||
}?: {
|
||||
additionalProperties?: Record<string, JSONSchema4>
|
||||
}): JSONSchema4
|
||||
export declare function buildTypeJsonSchema({
|
||||
allowedAdditionalValues,
|
||||
}: {
|
||||
allowedAdditionalValues: undefined | string[]
|
||||
}): JSONSchema4
|
||||
export declare function buildRegexJsonSchema({
|
||||
additionalProperties,
|
||||
}?: {
|
||||
additionalProperties?: Record<string, JSONSchema4>
|
||||
}): JSONSchema4
|
||||
export declare let useExperimentalDependencyDetectionJsonSchema: JSONSchema4
|
||||
Generated
Vendored
+207
@@ -0,0 +1,207 @@
|
||||
/**
|
||||
* JSON schema for the sort order option. Validates ascending or descending sort
|
||||
* direction.
|
||||
*/
|
||||
var orderJsonSchema = {
|
||||
description:
|
||||
'Specifies whether to sort items in ascending or descending order.',
|
||||
enum: ['asc', 'desc'],
|
||||
type: 'string',
|
||||
}
|
||||
/**
|
||||
* JSON schema for the custom alphabet option. Used with 'custom' sort type to
|
||||
* define character ordering.
|
||||
*/
|
||||
var alphabetJsonSchema = {
|
||||
description:
|
||||
"Used only when the `type` option is set to `'custom'`. Specifies the custom alphabet for sorting.",
|
||||
type: 'string',
|
||||
}
|
||||
/**
|
||||
* JSON schema for the locales option. Validates locale settings for
|
||||
* locale-aware string comparison.
|
||||
*/
|
||||
var localesJsonSchema = {
|
||||
oneOf: [
|
||||
{ type: 'string' },
|
||||
{
|
||||
items: { type: 'string' },
|
||||
type: 'array',
|
||||
},
|
||||
],
|
||||
description: 'Specifies the sorting locales.',
|
||||
}
|
||||
/**
|
||||
* JSON schema for the ignoreCase option. Controls case sensitivity in string
|
||||
* comparisons.
|
||||
*/
|
||||
var ignoreCaseJsonSchema = {
|
||||
description: 'Controls whether sorting should be case-sensitive or not.',
|
||||
type: 'boolean',
|
||||
}
|
||||
/**
|
||||
* JSON schema for the special characters handling option. Defines how special
|
||||
* characters are treated during sorting.
|
||||
*/
|
||||
var specialCharactersJsonSchema = {
|
||||
description:
|
||||
'Specifies whether to trim, remove, or keep special characters before sorting.',
|
||||
enum: ['remove', 'trim', 'keep'],
|
||||
type: 'string',
|
||||
}
|
||||
var matchesAstSelectorJsonSchema = {
|
||||
description:
|
||||
'Specifies an AST selector to match elements for conditional configuration.',
|
||||
type: 'string',
|
||||
}
|
||||
/**
|
||||
* Builds a collection of common JSON schemas used across sorting rules.
|
||||
*
|
||||
* Creates schemas for standard sorting options that are shared by multiple
|
||||
* rules. This ensures consistent validation across the plugin.
|
||||
*
|
||||
* @param options - Configuration options.
|
||||
* @param options.additionalSortProperties - Extra sort-related option schemas
|
||||
* to add at the root level and inside fallbackSort.
|
||||
* @returns Object containing common JSON schemas for rule validation.
|
||||
*/
|
||||
function buildCommonJsonSchemas({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalSortProperties,
|
||||
} = {}) {
|
||||
return {
|
||||
fallbackSort: buildFallbackSortJsonSchema({
|
||||
additionalProperties: additionalSortProperties,
|
||||
allowedAdditionalTypeValues,
|
||||
}),
|
||||
type: buildTypeJsonSchema({
|
||||
allowedAdditionalValues: allowedAdditionalTypeValues,
|
||||
}),
|
||||
specialCharacters: specialCharactersJsonSchema,
|
||||
ignoreCase: ignoreCaseJsonSchema,
|
||||
alphabet: alphabetJsonSchema,
|
||||
locales: localesJsonSchema,
|
||||
order: orderJsonSchema,
|
||||
...additionalSortProperties,
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Builds JSON schema for fallback sort configuration.
|
||||
*
|
||||
* Creates a schema for the fallback sorting option that is applied when the
|
||||
* primary sort results in equality. Allows customization through additional
|
||||
* properties.
|
||||
*
|
||||
* @param options - Configuration options.
|
||||
* @param options.additionalProperties - Extra properties to include in the
|
||||
* schema.
|
||||
* @returns JSON schema for fallback sort validation.
|
||||
*/
|
||||
function buildFallbackSortJsonSchema({
|
||||
allowedAdditionalTypeValues,
|
||||
additionalProperties,
|
||||
}) {
|
||||
return {
|
||||
properties: {
|
||||
type: buildTypeJsonSchema({
|
||||
allowedAdditionalValues: allowedAdditionalTypeValues,
|
||||
}),
|
||||
order: orderJsonSchema,
|
||||
...additionalProperties,
|
||||
},
|
||||
description: 'Fallback sort order.',
|
||||
additionalProperties: false,
|
||||
required: ['type'],
|
||||
type: 'object',
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Builds JSON schema for conditional configuration blocks.
|
||||
*
|
||||
* Creates a schema for configuration that is applied only when certain
|
||||
* conditions are met. Used for context-specific sorting rules where different
|
||||
* configurations apply based on element patterns.
|
||||
*
|
||||
* @param options - Configuration options for the conditional block.
|
||||
* @param options.additionalProperties - Extra properties to include in the
|
||||
* schema.
|
||||
* @returns JSON schema for conditional configuration validation.
|
||||
*/
|
||||
function buildUseConfigurationIfJsonSchema({ additionalProperties } = {}) {
|
||||
return {
|
||||
description:
|
||||
'Specifies filters to match a particular options configuration for a given element to sort.',
|
||||
properties: {
|
||||
allNamesMatchPattern: buildRegexJsonSchema(),
|
||||
...additionalProperties,
|
||||
},
|
||||
additionalProperties: false,
|
||||
type: 'object',
|
||||
}
|
||||
}
|
||||
function buildTypeJsonSchema({ allowedAdditionalValues }) {
|
||||
return {
|
||||
enum: [
|
||||
'alphabetical',
|
||||
'natural',
|
||||
'line-length',
|
||||
'custom',
|
||||
'unsorted',
|
||||
'subgroup-order',
|
||||
...(allowedAdditionalValues ?? []),
|
||||
],
|
||||
description: 'Specifies the sorting method.',
|
||||
type: 'string',
|
||||
}
|
||||
}
|
||||
function buildRegexJsonSchema({ additionalProperties } = {}) {
|
||||
return {
|
||||
oneOf: [
|
||||
{
|
||||
items: buildSingleRegexJsonSchema({ additionalProperties }),
|
||||
type: 'array',
|
||||
},
|
||||
buildSingleRegexJsonSchema({ additionalProperties }),
|
||||
],
|
||||
description: 'Regular expression.',
|
||||
}
|
||||
}
|
||||
function buildSingleRegexJsonSchema({ additionalProperties }) {
|
||||
return {
|
||||
oneOf: [
|
||||
{
|
||||
properties: {
|
||||
...additionalProperties,
|
||||
pattern: {
|
||||
description: 'Regular expression pattern.',
|
||||
type: 'string',
|
||||
},
|
||||
flags: {
|
||||
description: 'Regular expression flags.',
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
required: ['pattern'],
|
||||
type: 'object',
|
||||
},
|
||||
{ type: 'string' },
|
||||
],
|
||||
description: 'Regular expression.',
|
||||
}
|
||||
}
|
||||
var useExperimentalDependencyDetectionJsonSchema = {
|
||||
description:
|
||||
'Enables experimental dependency detection for sorting rules that support it.',
|
||||
type: 'boolean',
|
||||
}
|
||||
export {
|
||||
buildCommonJsonSchemas,
|
||||
buildFallbackSortJsonSchema,
|
||||
buildRegexJsonSchema,
|
||||
buildTypeJsonSchema,
|
||||
buildUseConfigurationIfJsonSchema,
|
||||
matchesAstSelectorJsonSchema,
|
||||
orderJsonSchema,
|
||||
useExperimentalDependencyDetectionJsonSchema,
|
||||
}
|
||||
Generated
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'
|
||||
/**
|
||||
* JSON schema for the partition by comment option. Validates configuration for
|
||||
* splitting elements into partitions based on comments.
|
||||
*/
|
||||
export declare let partitionByCommentJsonSchema: JSONSchema4
|
||||
/**
|
||||
* JSON schema for the partition by new line option. Controls whether to create
|
||||
* separate partitions when newlines are encountered.
|
||||
*/
|
||||
export declare let partitionByNewLineJsonSchema: JSONSchema4
|
||||
Generated
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
import { buildRegexJsonSchema } from './common-json-schemas.js'
|
||||
var allowedPartitionByCommentJsonSchemas = [
|
||||
{ type: 'boolean' },
|
||||
buildRegexJsonSchema(),
|
||||
]
|
||||
/**
|
||||
* JSON schema for the partition by comment option. Validates configuration for
|
||||
* splitting elements into partitions based on comments.
|
||||
*/
|
||||
var partitionByCommentJsonSchema = {
|
||||
oneOf: [
|
||||
...allowedPartitionByCommentJsonSchemas,
|
||||
{
|
||||
properties: {
|
||||
block: {
|
||||
description: 'Enables specific block comments to separate the nodes.',
|
||||
oneOf: allowedPartitionByCommentJsonSchemas,
|
||||
},
|
||||
line: {
|
||||
description: 'Enables specific line comments to separate the nodes.',
|
||||
oneOf: allowedPartitionByCommentJsonSchemas,
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
minProperties: 1,
|
||||
type: 'object',
|
||||
},
|
||||
],
|
||||
description:
|
||||
'Enables the use of comments to separate the nodes into logical groups.',
|
||||
}
|
||||
/**
|
||||
* JSON schema for the partition by new line option. Controls whether to create
|
||||
* separate partitions when newlines are encountered.
|
||||
*/
|
||||
var partitionByNewLineJsonSchema = {
|
||||
description:
|
||||
'Enables the use of newlines to separate the nodes into logical groups.',
|
||||
type: 'boolean',
|
||||
}
|
||||
export { partitionByCommentJsonSchema, partitionByNewLineJsonSchema }
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'
|
||||
export declare let scopedRegexJsonSchema: JSONSchema4
|
||||
Generated
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
import { buildRegexJsonSchema } from './common-json-schemas.js'
|
||||
import { regexScopes } from '../../types/scoped-regex-option.js'
|
||||
var scopedRegexJsonSchema = buildRegexJsonSchema({
|
||||
additionalProperties: {
|
||||
scope: {
|
||||
enum: [...regexScopes],
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
})
|
||||
export { scopedRegexJsonSchema }
|
||||
Reference in New Issue
Block a user