From 9aa601588fd7051c29105b3c25100bdeb5c891a3 Mon Sep 17 00:00:00 2001 From: Rel1cx Date: Tue, 15 Apr 2025 13:21:46 +0800 Subject: [PATCH] refactor(kit): improve readability --- .../core/src/component/component-collector.ts | 2 +- packages/core/src/component/component-name.ts | 2 +- .../src/rules/jsx.ts | 4 +- .../src/rules/no-script-url.ts | 2 +- .../src/rules/no-unknown-property.ts | 4 +- .../src/rules/component-name.ts | 2 +- .../src/rules/filename.ts | 2 +- .../src/rules/no-array-index-key.ts | 4 +- .../rules/no-leaked-conditional-rendering.ts | 4 +- .../rules/no-missing-context-display-name.ts | 2 +- .../src/rules/no-missing-key.ts | 4 +- .../src/rules/no-unstable-default-props.ts | 2 +- packages/shared/src/settings.ts | 2 +- .../namespaces/{RE => RegExp}/README.md | 4 +- .../{RE => RegExp}/functions/isRegExp.md | 2 +- .../{RE => RegExp}/functions/toRegExp.md | 2 +- .../variables/ANNOTATION_JSX.md | 2 +- .../variables/ANNOTATION_JSX_FRAG.md | 2 +- .../variables/ANNOTATION_JSX_IMPORT_SOURCE.md | 2 +- .../variables/ANNOTATION_JSX_RUNTIME.md | 2 +- .../{RE => RegExp}/variables/CAMEL_CASE.md | 2 +- .../variables/COMPONENT_NAME.md | 2 +- .../variables/COMPONENT_NAME_LOOSE.md | 2 +- .../{RE => RegExp}/variables/CONSTANT_CASE.md | 2 +- .../{RE => RegExp}/variables/HOOK_NAME.md | 2 +- .../{RE => RegExp}/variables/HTML_TAG.md | 2 +- .../variables/JAVASCRIPT_PROTOCOL.md | 2 +- .../{RE => RegExp}/variables/JS_EXT.md | 2 +- .../{RE => RegExp}/variables/JS_IDENTIFIER.md | 2 +- .../{RE => RegExp}/variables/KEBAB_CASE.md | 2 +- .../{RE => RegExp}/variables/PASCAL_CASE.md | 2 +- .../{RE => RegExp}/variables/REGEXP_STR.md | 2 +- .../{RE => RegExp}/variables/SNAKE_CASE.md | 2 +- .../{RE => RegExp}/variables/TS_EXT.md | 2 +- .../@eslint-react/namespaces/Report/README.md | 11 --- .../namespaces/Report/functions/make.md | 63 -------------- .../namespaces/Reporter/README.md | 16 ++++ .../namespaces/Reporter/functions/make.md | 51 +++++++++++ .../namespaces/Reporter/variables/send.md | 63 ++++++++++++++ .../Reporter/variables/sendOrElse.md | 85 +++++++++++++++++++ .../namespaces/{SEL => Selector}/README.md | 4 +- .../DisplayNameAssignmentExpression.md | 2 +- .../ImplicitReturnArrowFunctionExpression.md | 2 +- .../ObjectDestructuringVariableDeclarator.md | 2 +- .../DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md | 2 +- ...PLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md | 2 +- ...BJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md | 2 +- packages/utilities/kit/docs/README.md | 6 +- .../utilities/kit/src/JsxConfig/JsxConfig.ts | 2 +- .../utilities/kit/src/{RE.ts => RegExp.ts} | 0 packages/utilities/kit/src/Report.ts | 16 ---- packages/utilities/kit/src/Reporter.ts | 29 +++++++ .../utilities/kit/src/{SEL.ts => Selector.ts} | 0 packages/utilities/kit/src/index.ts | 6 +- 54 files changed, 299 insertions(+), 145 deletions(-) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/README.md (94%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/functions/isRegExp.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/functions/toRegExp.md (88%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/ANNOTATION_JSX.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/ANNOTATION_JSX_FRAG.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/ANNOTATION_JSX_IMPORT_SOURCE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/ANNOTATION_JSX_RUNTIME.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/CAMEL_CASE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/COMPONENT_NAME.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/COMPONENT_NAME_LOOSE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/CONSTANT_CASE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/HOOK_NAME.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/HTML_TAG.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/JAVASCRIPT_PROTOCOL.md (70%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/JS_EXT.md (76%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/JS_IDENTIFIER.md (76%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/KEBAB_CASE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/PASCAL_CASE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/REGEXP_STR.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/SNAKE_CASE.md (75%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{RE => RegExp}/variables/TS_EXT.md (76%) delete mode 100644 packages/utilities/kit/docs/@eslint-react/namespaces/Report/README.md delete mode 100644 packages/utilities/kit/docs/@eslint-react/namespaces/Report/functions/make.md create mode 100644 packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/README.md create mode 100644 packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/functions/make.md create mode 100644 packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/send.md create mode 100644 packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/sendOrElse.md rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/README.md (91%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/type-aliases/DisplayNameAssignmentExpression.md (84%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/type-aliases/ImplicitReturnArrowFunctionExpression.md (70%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/type-aliases/ObjectDestructuringVariableDeclarator.md (73%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md (60%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md (71%) rename packages/utilities/kit/docs/@eslint-react/namespaces/{SEL => Selector}/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md (60%) rename packages/utilities/kit/src/{RE.ts => RegExp.ts} (100%) delete mode 100644 packages/utilities/kit/src/Report.ts create mode 100644 packages/utilities/kit/src/Reporter.ts rename packages/utilities/kit/src/{SEL.ts => Selector.ts} (100%) diff --git a/packages/core/src/component/component-collector.ts b/packages/core/src/component/component-collector.ts index 2e26c6f53e..5d4052046d 100644 --- a/packages/core/src/component/component-collector.ts +++ b/packages/core/src/component/component-collector.ts @@ -4,7 +4,7 @@ import type { ComponentDetectionHint } from "./component-detection-hint"; import type { FunctionComponent } from "./component-semantic-node"; import * as AST from "@eslint-react/ast"; import { _ } from "@eslint-react/eff"; -import { type RuleContext, SEL } from "@eslint-react/kit"; +import { type RuleContext, Selector as SEL } from "@eslint-react/kit"; import { getId } from "@eslint-react/shared"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; diff --git a/packages/core/src/component/component-name.ts b/packages/core/src/component/component-name.ts index 6d3e0b5521..61c9e47104 100644 --- a/packages/core/src/component/component-name.ts +++ b/packages/core/src/component/component-name.ts @@ -2,7 +2,7 @@ import type * as AST from "@eslint-react/ast"; import type { RuleContext } from "@eslint-react/kit"; import type { TSESTree } from "@typescript-eslint/types"; import { _ } from "@eslint-react/eff"; -import { RE } from "@eslint-react/kit"; +import { RegExp as RE } from "@eslint-react/kit"; import { getFunctionComponentId } from "./component-id"; diff --git a/packages/plugins/eslint-plugin-react-debug/src/rules/jsx.ts b/packages/plugins/eslint-plugin-react-debug/src/rules/jsx.ts index ff9a496103..622df00f0b 100644 --- a/packages/plugins/eslint-plugin-react-debug/src/rules/jsx.ts +++ b/packages/plugins/eslint-plugin-react-debug/src/rules/jsx.ts @@ -2,7 +2,7 @@ import type { RuleListener } from "@typescript-eslint/utils/ts-eslint"; import type { CamelCase } from "string-ts"; import * as ER from "@eslint-react/core"; import { flow } from "@eslint-react/eff"; -import { JsxConfig, Report, type RuleContext, type RuleFeature } from "@eslint-react/kit"; +import { JsxConfig, Reporter as RPT, type RuleContext, type RuleFeature } from "@eslint-react/kit"; import { AST_NODE_TYPES as T, type TSESTree } from "@typescript-eslint/types"; import { match, P } from "ts-pattern"; import { JsxEmit } from "typescript"; @@ -71,6 +71,6 @@ export function create(context: RuleContext): RuleListener { } as const); } return { - "JSXElement, JSXFragment": flow(getReportDescriptor(context), Report.make(context).send), + "JSXElement, JSXFragment": flow(getReportDescriptor(context), RPT.make(context).send), }; } diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-script-url.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-script-url.ts index 589884eef6..792676827c 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-script-url.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-script-url.ts @@ -2,7 +2,7 @@ import type { RuleContext, RuleFeature } from "@eslint-react/kit"; import type { RuleListener } from "@typescript-eslint/utils/ts-eslint"; import type { CamelCase } from "string-ts"; import * as ER from "@eslint-react/core"; -import { RE } from "@eslint-react/kit"; +import { RegExp as RE } from "@eslint-react/kit"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; import { createRule } from "../utils"; diff --git a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unknown-property.ts b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unknown-property.ts index a05c47e90a..aa1aae0c24 100644 --- a/packages/plugins/eslint-plugin-react-dom/src/rules/no-unknown-property.ts +++ b/packages/plugins/eslint-plugin-react-dom/src/rules/no-unknown-property.ts @@ -5,7 +5,7 @@ import { getSettingsFromContext } from "@eslint-react/shared"; import { createRule } from "../utils"; import { compare } from "compare-versions"; -import { Report } from "@eslint-react/kit"; +import { Reporter as RPT } from "@eslint-react/kit"; import type { RuleContext, RuleFeature } from "@eslint-react/kit"; import type { RuleListener } from "@typescript-eslint/utils/ts-eslint"; @@ -1090,7 +1090,7 @@ export default createRule({ }); export function create(context: RuleContext): RuleListener { - const report = Report.make(context); + const report = RPT.make(context); function getIgnoreConfig() { return context.options[0]?.ignore || DEFAULTS.ignore; } diff --git a/packages/plugins/eslint-plugin-react-naming-convention/src/rules/component-name.ts b/packages/plugins/eslint-plugin-react-naming-convention/src/rules/component-name.ts index 3e8eae7bc8..e6ab37c758 100644 --- a/packages/plugins/eslint-plugin-react-naming-convention/src/rules/component-name.ts +++ b/packages/plugins/eslint-plugin-react-naming-convention/src/rules/component-name.ts @@ -4,7 +4,7 @@ import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema"; import type { RuleListener } from "@typescript-eslint/utils/ts-eslint"; import * as AST from "@eslint-react/ast"; import * as ER from "@eslint-react/core"; -import { RE } from "@eslint-react/kit"; +import { RegExp as RE } from "@eslint-react/kit"; import { createRule } from "../utils"; diff --git a/packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts b/packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts index 16b41404cc..53c40089dd 100644 --- a/packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts +++ b/packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts @@ -3,7 +3,7 @@ import type { RuleContext, RuleFeature } from "@eslint-react/kit"; import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema"; import type { RuleListener } from "@typescript-eslint/utils/ts-eslint"; import path from "node:path"; -import { RE } from "@eslint-react/kit"; +import { RegExp as RE } from "@eslint-react/kit"; import { camelCase, kebabCase, pascalCase, snakeCase } from "string-ts"; import { match } from "ts-pattern"; diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-array-index-key.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-array-index-key.ts index 8b3a0fdac3..100ce510e3 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-array-index-key.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-array-index-key.ts @@ -4,7 +4,7 @@ import type { CamelCase } from "string-ts"; import * as AST from "@eslint-react/ast"; import * as ER from "@eslint-react/core"; import { _ } from "@eslint-react/eff"; -import { Report, type RuleContext, type RuleFeature } from "@eslint-react/kit"; +import { Reporter as RPT, type RuleContext, type RuleFeature } from "@eslint-react/kit"; import { unsafeDecodeSettings } from "@eslint-react/shared"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; import { isMatching } from "ts-pattern"; @@ -109,7 +109,7 @@ export default createRule<[], MessageID>({ }); export function create(context: RuleContext): RuleListener { - const report = Report.make(context); + const report = RPT.make(context); const indexParamNames: Array = []; function isArrayIndex(node: TSESTree.Node): node is TSESTree.Identifier { diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-leaked-conditional-rendering.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-leaked-conditional-rendering.ts index fbe0b72973..2a275abfd5 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-leaked-conditional-rendering.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-leaked-conditional-rendering.ts @@ -3,7 +3,7 @@ import type { ReportDescriptor, RuleListener } from "@typescript-eslint/utils/ts import type { CamelCase } from "string-ts"; import * as AST from "@eslint-react/ast"; import { _, flow } from "@eslint-react/eff"; -import { Report, type RuleContext, type RuleFeature } from "@eslint-react/kit"; +import { Reporter as RPT, type RuleContext, type RuleFeature } from "@eslint-react/kit"; import { getSettingsFromContext } from "@eslint-react/shared"; import * as VAR from "@eslint-react/var"; import { getConstrainedTypeAtLocation } from "@typescript-eslint/type-utils"; @@ -268,7 +268,7 @@ export function create(context: RuleContext): RuleListener { .otherwise(() => _); } return { - JSXExpressionContainer: flow(getReportDescriptor, Report.make(context).send), + JSXExpressionContainer: flow(getReportDescriptor, RPT.make(context).send), }; } diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-context-display-name.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-context-display-name.ts index d2d70fab71..60abcd5544 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-context-display-name.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-context-display-name.ts @@ -2,7 +2,7 @@ import type { TSESTree } from "@typescript-eslint/types"; import type { RuleListener } from "@typescript-eslint/utils/ts-eslint"; import type { CamelCase } from "string-ts"; import * as ER from "@eslint-react/core"; -import { type RuleContext, type RuleFeature, SEL } from "@eslint-react/kit"; +import { type RuleContext, type RuleFeature, Selector as SEL } from "@eslint-react/kit"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; import { createRule } from "../utils"; diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-key.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-key.ts index 43c0ffc9bc..8c2c5e689e 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-key.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-missing-key.ts @@ -3,7 +3,7 @@ import type { ReportDescriptor, RuleListener } from "@typescript-eslint/utils/ts import * as AST from "@eslint-react/ast"; import * as ER from "@eslint-react/core"; -import { Report, type RuleContext, type RuleFeature } from "@eslint-react/kit"; +import { Reporter as RPT, type RuleContext, type RuleFeature } from "@eslint-react/kit"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; import { match } from "ts-pattern"; @@ -36,7 +36,7 @@ export default createRule<[], MessageID>({ }); export function create(context: RuleContext): RuleListener { - const report = Report.make(context); + const report = RPT.make(context); const state = { isWithinChildrenToArray: false }; function checkIteratorElement(node: TSESTree.Node): null | ReportDescriptor { diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-unstable-default-props.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-unstable-default-props.ts index 4cb7a878e8..2a3f20a15c 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-unstable-default-props.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-unstable-default-props.ts @@ -4,7 +4,7 @@ import type { CamelCase } from "string-ts"; import * as AST from "@eslint-react/ast"; import * as ER from "@eslint-react/core"; import { getOrElseUpdate } from "@eslint-react/eff"; -import { SEL } from "@eslint-react/kit"; +import { Selector as SEL } from "@eslint-react/kit"; import * as VAR from "@eslint-react/var"; import { AST_NODE_TYPES as T } from "@typescript-eslint/types"; import { match } from "ts-pattern"; diff --git a/packages/shared/src/settings.ts b/packages/shared/src/settings.ts index b09c11ddf3..1cb40ba2f2 100644 --- a/packages/shared/src/settings.ts +++ b/packages/shared/src/settings.ts @@ -3,7 +3,7 @@ import type { SharedConfigurationSettings } from "@typescript-eslint/utils/ts-es import type { PartialDeep } from "type-fest"; import type { CustomHooks, ESLintReactSettings } from "./schemas"; import { identity } from "@eslint-react/eff"; -import { RE } from "@eslint-react/kit"; +import { RegExp as RE } from "@eslint-react/kit"; import * as z from "@zod/mini"; import { shallowEqual } from "fast-equals"; import memoize from "micro-memoize"; diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/README.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/README.md similarity index 94% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/README.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/README.md index 16c6bcee7b..a2021e4766 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/README.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/README.md @@ -2,9 +2,9 @@ *** -[@eslint-react/kit](../../../README.md) / RE +[@eslint-react/kit](../../../README.md) / RegExp -# RE +# RegExp ## Variables diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/functions/isRegExp.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/functions/isRegExp.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/functions/isRegExp.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/functions/isRegExp.md index 9fe11463d2..fbf670e3c9 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/functions/isRegExp.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/functions/isRegExp.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / isRegExp +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / isRegExp # Function: isRegExp() diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/functions/toRegExp.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/functions/toRegExp.md similarity index 88% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/functions/toRegExp.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/functions/toRegExp.md index c7237bce31..a5d6c68ad0 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/functions/toRegExp.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/functions/toRegExp.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / toRegExp +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / toRegExp # Function: toRegExp() diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX.md index e735055ab6..5d6901a7d2 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / ANNOTATION\_JSX +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / ANNOTATION\_JSX # Variable: ANNOTATION\_JSX diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_FRAG.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_FRAG.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_FRAG.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_FRAG.md index dbdcc901fe..dc0ae0bf70 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_FRAG.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_FRAG.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / ANNOTATION\_JSX\_FRAG +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / ANNOTATION\_JSX\_FRAG # Variable: ANNOTATION\_JSX\_FRAG diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_IMPORT_SOURCE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_IMPORT_SOURCE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_IMPORT_SOURCE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_IMPORT_SOURCE.md index 4be38e813a..79147ebb45 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_IMPORT_SOURCE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_IMPORT_SOURCE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / ANNOTATION\_JSX\_IMPORT\_SOURCE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / ANNOTATION\_JSX\_IMPORT\_SOURCE # Variable: ANNOTATION\_JSX\_IMPORT\_SOURCE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_RUNTIME.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_RUNTIME.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_RUNTIME.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_RUNTIME.md index 38435ab3ba..3e9c39ab09 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/ANNOTATION_JSX_RUNTIME.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/ANNOTATION_JSX_RUNTIME.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / ANNOTATION\_JSX\_RUNTIME +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / ANNOTATION\_JSX\_RUNTIME # Variable: ANNOTATION\_JSX\_RUNTIME diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/CAMEL_CASE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/CAMEL_CASE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/CAMEL_CASE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/CAMEL_CASE.md index 6dcb1b8f8b..8418a11bc8 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/CAMEL_CASE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/CAMEL_CASE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / CAMEL\_CASE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / CAMEL\_CASE # Variable: CAMEL\_CASE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/COMPONENT_NAME.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/COMPONENT_NAME.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/COMPONENT_NAME.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/COMPONENT_NAME.md index a91b2797fa..58f2ad31ee 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/COMPONENT_NAME.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/COMPONENT_NAME.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / COMPONENT\_NAME +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / COMPONENT\_NAME # Variable: COMPONENT\_NAME diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/COMPONENT_NAME_LOOSE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/COMPONENT_NAME_LOOSE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/COMPONENT_NAME_LOOSE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/COMPONENT_NAME_LOOSE.md index 1613c08c6b..1e6a68b115 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/COMPONENT_NAME_LOOSE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/COMPONENT_NAME_LOOSE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / COMPONENT\_NAME\_LOOSE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / COMPONENT\_NAME\_LOOSE # Variable: COMPONENT\_NAME\_LOOSE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/CONSTANT_CASE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/CONSTANT_CASE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/CONSTANT_CASE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/CONSTANT_CASE.md index abfca93296..aa181a9038 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/CONSTANT_CASE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/CONSTANT_CASE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / CONSTANT\_CASE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / CONSTANT\_CASE # Variable: CONSTANT\_CASE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/HOOK_NAME.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/HOOK_NAME.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/HOOK_NAME.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/HOOK_NAME.md index b2b4794fdd..bc9e427269 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/HOOK_NAME.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/HOOK_NAME.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / HOOK\_NAME +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / HOOK\_NAME # Variable: HOOK\_NAME diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/HTML_TAG.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/HTML_TAG.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/HTML_TAG.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/HTML_TAG.md index 0c7f5bf33c..68a44d68b2 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/HTML_TAG.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/HTML_TAG.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / HTML\_TAG +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / HTML\_TAG # Variable: HTML\_TAG diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JAVASCRIPT_PROTOCOL.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JAVASCRIPT_PROTOCOL.md similarity index 70% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JAVASCRIPT_PROTOCOL.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JAVASCRIPT_PROTOCOL.md index db8c77171c..81ef3b3371 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JAVASCRIPT_PROTOCOL.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JAVASCRIPT_PROTOCOL.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / JAVASCRIPT\_PROTOCOL +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / JAVASCRIPT\_PROTOCOL # Variable: JAVASCRIPT\_PROTOCOL diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JS_EXT.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JS_EXT.md similarity index 76% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JS_EXT.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JS_EXT.md index be320c4da1..6447f265d5 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JS_EXT.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JS_EXT.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / JS\_EXT +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / JS\_EXT # Variable: JS\_EXT diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JS_IDENTIFIER.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JS_IDENTIFIER.md similarity index 76% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JS_IDENTIFIER.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JS_IDENTIFIER.md index 9d1dfc1e4b..ee5e462f21 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/JS_IDENTIFIER.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/JS_IDENTIFIER.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / JS\_IDENTIFIER +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / JS\_IDENTIFIER # Variable: JS\_IDENTIFIER diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/KEBAB_CASE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/KEBAB_CASE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/KEBAB_CASE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/KEBAB_CASE.md index 02458f3a57..de856deee9 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/KEBAB_CASE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/KEBAB_CASE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / KEBAB\_CASE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / KEBAB\_CASE # Variable: KEBAB\_CASE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/PASCAL_CASE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/PASCAL_CASE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/PASCAL_CASE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/PASCAL_CASE.md index f50b2de00a..d99e369a63 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/PASCAL_CASE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/PASCAL_CASE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / PASCAL\_CASE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / PASCAL\_CASE # Variable: PASCAL\_CASE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/REGEXP_STR.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/REGEXP_STR.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/REGEXP_STR.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/REGEXP_STR.md index cc254b89e0..2eecac023e 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/REGEXP_STR.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/REGEXP_STR.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / REGEXP\_STR +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / REGEXP\_STR # Variable: REGEXP\_STR diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/SNAKE_CASE.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/SNAKE_CASE.md similarity index 75% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/SNAKE_CASE.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/SNAKE_CASE.md index 467e5c509a..bdef79aad2 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/SNAKE_CASE.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/SNAKE_CASE.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / SNAKE\_CASE +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / SNAKE\_CASE # Variable: SNAKE\_CASE diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/TS_EXT.md b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/TS_EXT.md similarity index 76% rename from packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/TS_EXT.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/TS_EXT.md index 051488557d..d6509bc5c7 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/RE/variables/TS_EXT.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/RegExp/variables/TS_EXT.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [RE](../README.md) / TS\_EXT +[@eslint-react/kit](../../../../README.md) / [RegExp](../README.md) / TS\_EXT # Variable: TS\_EXT diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/Report/README.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Report/README.md deleted file mode 100644 index 4dacde9b7c..0000000000 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/Report/README.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@eslint-react/kit**](../../../README.md) - -*** - -[@eslint-react/kit](../../../README.md) / Report - -# Report - -## Functions - -- [make](functions/make.md) diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/Report/functions/make.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Report/functions/make.md deleted file mode 100644 index 5b4f394d06..0000000000 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/Report/functions/make.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@eslint-react/kit**](../../../../README.md) - -*** - -[@eslint-react/kit](../../../../README.md) / [Report](../README.md) / make - -# Function: make() - -> **make**\<`TMessageID`\>(`context`): `object` - -## Type Parameters - -### TMessageID - -`TMessageID` *extends* `string` - -## Parameters - -### context - -[`RuleContext`](../../../../type-aliases/RuleContext.md)\<`TMessageID`\> - -## Returns - -`object` - -### send() - -> `readonly` **send**(`descriptor`): `void` - -#### Parameters - -##### descriptor - -`undefined` | `null` | `ReportDescriptor`\<`TMessageID`\> - -#### Returns - -`void` - -### sendOrElse() - -> `readonly` **sendOrElse**\<`TElse`\>(`descriptor`, `fallback`): `void` \| `TElse` - -#### Type Parameters - -##### TElse - -`TElse` - -#### Parameters - -##### descriptor - -`undefined` | `null` | `ReportDescriptor`\<`TMessageID`\> - -##### fallback - -() => `TElse` - -#### Returns - -`void` \| `TElse` diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/README.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/README.md new file mode 100644 index 0000000000..9018243bf1 --- /dev/null +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/README.md @@ -0,0 +1,16 @@ +[**@eslint-react/kit**](../../../README.md) + +*** + +[@eslint-react/kit](../../../README.md) / Reporter + +# Reporter + +## Variables + +- [send](variables/send.md) +- [sendOrElse](variables/sendOrElse.md) + +## Functions + +- [make](functions/make.md) diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/functions/make.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/functions/make.md new file mode 100644 index 0000000000..d87a3928de --- /dev/null +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/functions/make.md @@ -0,0 +1,51 @@ +[**@eslint-react/kit**](../../../../README.md) + +*** + +[@eslint-react/kit](../../../../README.md) / [Reporter](../README.md) / make + +# Function: make() + +> **make**(`context`): `object` + +## Parameters + +### context + +[`RuleContext`](../../../../type-aliases/RuleContext.md) + +## Returns + +`object` + +### send() + +> `readonly` **send**: (`descriptor`) => `void` + +#### Parameters + +##### descriptor + +`undefined` | `null` | `ReportDescriptor`\<`string`\> + +#### Returns + +`void` + +### sendOrElse() + +> `readonly` **sendOrElse**: (`descriptor`, `cb`) => `unknown` + +#### Parameters + +##### descriptor + +`undefined` | `null` | `ReportDescriptor`\<`string`\> + +##### cb + +() => `unknown` + +#### Returns + +`unknown` diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/send.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/send.md new file mode 100644 index 0000000000..e4174a2375 --- /dev/null +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/send.md @@ -0,0 +1,63 @@ +[**@eslint-react/kit**](../../../../README.md) + +*** + +[@eslint-react/kit](../../../../README.md) / [Reporter](../README.md) / send + +# Variable: send() + +> `const` **send**: \{\<`TMessageID`\>(`context`, `descriptor`): `void`; \<`TMessageID`\>(`context`): (`descriptor`) => `void`; \} + +## Call Signature + +> \<`TMessageID`\>(`context`, `descriptor`): `void` + +### Type Parameters + +#### TMessageID + +`TMessageID` *extends* `string` + +### Parameters + +#### context + +[`RuleContext`](../../../../type-aliases/RuleContext.md) + +#### descriptor + +`undefined` | `null` | `ReportDescriptor`\<`TMessageID`\> + +### Returns + +`void` + +## Call Signature + +> \<`TMessageID`\>(`context`): (`descriptor`) => `void` + +### Type Parameters + +#### TMessageID + +`TMessageID` *extends* `string` + +### Parameters + +#### context + +[`RuleContext`](../../../../type-aliases/RuleContext.md) + +### Returns + +> (`descriptor`): `void` + +#### Parameters + +##### descriptor + +`undefined` | `null` | `ReportDescriptor`\<`TMessageID`\> + +#### Returns + +`void` diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/sendOrElse.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/sendOrElse.md new file mode 100644 index 0000000000..80172bf12a --- /dev/null +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Reporter/variables/sendOrElse.md @@ -0,0 +1,85 @@ +[**@eslint-react/kit**](../../../../README.md) + +*** + +[@eslint-react/kit](../../../../README.md) / [Reporter](../README.md) / sendOrElse + +# Variable: sendOrElse() + +> `const` **sendOrElse**: \{\<`TMessageID`, `TElse`\>(`context`, `descriptor`, `cb`): `undefined` \| `TElse`; \<`TMessageID`, `TElse`\>(`context`): (`descriptor`) => (`cb`) => `undefined` \| `TElse`; \} + +## Call Signature + +> \<`TMessageID`, `TElse`\>(`context`, `descriptor`, `cb`): `undefined` \| `TElse` + +### Type Parameters + +#### TMessageID + +`TMessageID` *extends* `string` + +#### TElse + +`TElse` + +### Parameters + +#### context + +[`RuleContext`](../../../../type-aliases/RuleContext.md) + +#### descriptor + +`undefined` | `null` | `ReportDescriptor`\<`TMessageID`\> + +#### cb + +() => `TElse` + +### Returns + +`undefined` \| `TElse` + +## Call Signature + +> \<`TMessageID`, `TElse`\>(`context`): (`descriptor`) => (`cb`) => `undefined` \| `TElse` + +### Type Parameters + +#### TMessageID + +`TMessageID` *extends* `string` + +#### TElse + +`TElse` + +### Parameters + +#### context + +[`RuleContext`](../../../../type-aliases/RuleContext.md) + +### Returns + +> (`descriptor`): (`cb`) => `undefined` \| `TElse` + +#### Parameters + +##### descriptor + +`undefined` | `null` | `ReportDescriptor`\<`TMessageID`\> + +#### Returns + +> (`cb`): `undefined` \| `TElse` + +##### Parameters + +###### cb + +() => `TElse` + +##### Returns + +`undefined` \| `TElse` diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/README.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/README.md similarity index 91% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/README.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/README.md index 4479eeaba6..e23d50aa23 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/README.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/README.md @@ -2,9 +2,9 @@ *** -[@eslint-react/kit](../../../README.md) / SEL +[@eslint-react/kit](../../../README.md) / Selector -# SEL +# Selector ## Type Aliases diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/DisplayNameAssignmentExpression.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/DisplayNameAssignmentExpression.md similarity index 84% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/DisplayNameAssignmentExpression.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/DisplayNameAssignmentExpression.md index 46a031dbb5..e0b955109a 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/DisplayNameAssignmentExpression.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/DisplayNameAssignmentExpression.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [SEL](../README.md) / DisplayNameAssignmentExpression +[@eslint-react/kit](../../../../README.md) / [Selector](../README.md) / DisplayNameAssignmentExpression # Type Alias: DisplayNameAssignmentExpression diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/ImplicitReturnArrowFunctionExpression.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/ImplicitReturnArrowFunctionExpression.md similarity index 70% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/ImplicitReturnArrowFunctionExpression.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/ImplicitReturnArrowFunctionExpression.md index 9ec35da25e..8be06bf6e3 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/ImplicitReturnArrowFunctionExpression.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/ImplicitReturnArrowFunctionExpression.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [SEL](../README.md) / ImplicitReturnArrowFunctionExpression +[@eslint-react/kit](../../../../README.md) / [Selector](../README.md) / ImplicitReturnArrowFunctionExpression # Type Alias: ImplicitReturnArrowFunctionExpression diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/ObjectDestructuringVariableDeclarator.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/ObjectDestructuringVariableDeclarator.md similarity index 73% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/ObjectDestructuringVariableDeclarator.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/ObjectDestructuringVariableDeclarator.md index 36f36f2d09..89690aa807 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/type-aliases/ObjectDestructuringVariableDeclarator.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/type-aliases/ObjectDestructuringVariableDeclarator.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [SEL](../README.md) / ObjectDestructuringVariableDeclarator +[@eslint-react/kit](../../../../README.md) / [Selector](../README.md) / ObjectDestructuringVariableDeclarator # Type Alias: ObjectDestructuringVariableDeclarator diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md similarity index 60% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md index f22157c4a1..82ca82fad0 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/DISPLAY_NAME_ASSIGNMENT_EXPRESSION.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [SEL](../README.md) / DISPLAY\_NAME\_ASSIGNMENT\_EXPRESSION +[@eslint-react/kit](../../../../README.md) / [Selector](../README.md) / DISPLAY\_NAME\_ASSIGNMENT\_EXPRESSION # Variable: DISPLAY\_NAME\_ASSIGNMENT\_EXPRESSION diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md similarity index 71% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md index 94ad6220f2..10fc00bb34 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [SEL](../README.md) / IMPLICIT\_RETURN\_ARROW\_FUNCTION\_EXPRESSION +[@eslint-react/kit](../../../../README.md) / [Selector](../README.md) / IMPLICIT\_RETURN\_ARROW\_FUNCTION\_EXPRESSION # Variable: IMPLICIT\_RETURN\_ARROW\_FUNCTION\_EXPRESSION diff --git a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md similarity index 60% rename from packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md rename to packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md index 7ede42fb54..646ae21a63 100644 --- a/packages/utilities/kit/docs/@eslint-react/namespaces/SEL/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md +++ b/packages/utilities/kit/docs/@eslint-react/namespaces/Selector/variables/OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR.md @@ -2,7 +2,7 @@ *** -[@eslint-react/kit](../../../../README.md) / [SEL](../README.md) / OBJECT\_DESTRUCTURING\_VARIABLE\_DECLARATOR +[@eslint-react/kit](../../../../README.md) / [Selector](../README.md) / OBJECT\_DESTRUCTURING\_VARIABLE\_DECLARATOR # Variable: OBJECT\_DESTRUCTURING\_VARIABLE\_DECLARATOR diff --git a/packages/utilities/kit/docs/README.md b/packages/utilities/kit/docs/README.md index d9d6e880e2..55f7a61073 100644 --- a/packages/utilities/kit/docs/README.md +++ b/packages/utilities/kit/docs/README.md @@ -8,9 +8,9 @@ - [JsxConfig](@eslint-react/namespaces/JsxConfig/README.md) - [LanguagePreference](@eslint-react/namespaces/LanguagePreference/README.md) -- [RE](@eslint-react/namespaces/RE/README.md) -- [Report](@eslint-react/namespaces/Report/README.md) -- [SEL](@eslint-react/namespaces/SEL/README.md) +- [RegExp](@eslint-react/namespaces/RegExp/README.md) +- [Reporter](@eslint-react/namespaces/Reporter/README.md) +- [Selector](@eslint-react/namespaces/Selector/README.md) ## Type Aliases diff --git a/packages/utilities/kit/src/JsxConfig/JsxConfig.ts b/packages/utilities/kit/src/JsxConfig/JsxConfig.ts index 85058d5d5c..ee442abae0 100644 --- a/packages/utilities/kit/src/JsxConfig/JsxConfig.ts +++ b/packages/utilities/kit/src/JsxConfig/JsxConfig.ts @@ -1,7 +1,7 @@ import type { RuleContext } from "../types"; import { getOrElseUpdate } from "@eslint-react/eff"; import { type CompilerOptions, JsxEmit } from "typescript"; -import * as RE from "../RE"; +import * as RE from "../RegExp"; export type JsxConfig = Pick< CompilerOptions, diff --git a/packages/utilities/kit/src/RE.ts b/packages/utilities/kit/src/RegExp.ts similarity index 100% rename from packages/utilities/kit/src/RE.ts rename to packages/utilities/kit/src/RegExp.ts diff --git a/packages/utilities/kit/src/Report.ts b/packages/utilities/kit/src/Report.ts deleted file mode 100644 index ce45768344..0000000000 --- a/packages/utilities/kit/src/Report.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; -import type { RuleContext } from "./types"; -import { type _ } from "@eslint-react/eff"; - -export function make(context: RuleContext) { - return { - send(descriptor: _ | null | ReportDescriptor) { - if (descriptor == null) return; - return context.report(descriptor); - }, - sendOrElse(descriptor: _ | null | ReportDescriptor, fallback: () => TElse) { - if (descriptor == null) return fallback(); - return context.report(descriptor); - }, - } as const; -} diff --git a/packages/utilities/kit/src/Reporter.ts b/packages/utilities/kit/src/Reporter.ts new file mode 100644 index 0000000000..7758bbcdc9 --- /dev/null +++ b/packages/utilities/kit/src/Reporter.ts @@ -0,0 +1,29 @@ +import type { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint"; +import type { RuleContext } from "./types"; +import { type _, dual } from "@eslint-react/eff"; + +export const send: { + (context: RuleContext, descriptor: _ | null | ReportDescriptor): void; + (context: RuleContext): (descriptor: _ | null | ReportDescriptor) => void; +} = dual(2, (context: RuleContext, descriptor: _ | null | ReportDescriptor) => { + if (descriptor == null) return; + return context.report(descriptor); +}); + +export const sendOrElse: { + // dprint-ignore + (context: RuleContext, descriptor: _ | null | ReportDescriptor, cb: () => TElse): _ | TElse; + // dprint-ignore + (context: RuleContext): (descriptor: _ | null | ReportDescriptor) => (cb: () => TElse) => _ | TElse; +} = dual(3, (context: RuleContext, descriptor: _ | null | ReportDescriptor, cb: () => unknown) => { + if (descriptor == null) return cb(); + return context.report(descriptor); +}); + +export const make = (context: RuleContext) => { + return { + send: (descriptor: _ | null | ReportDescriptor) => send(context, descriptor), + // dprint-ignore + sendOrElse: (descriptor: _ | null | ReportDescriptor, cb: () => unknown) => sendOrElse(context, descriptor, cb), + } as const; +}; diff --git a/packages/utilities/kit/src/SEL.ts b/packages/utilities/kit/src/Selector.ts similarity index 100% rename from packages/utilities/kit/src/SEL.ts rename to packages/utilities/kit/src/Selector.ts diff --git a/packages/utilities/kit/src/index.ts b/packages/utilities/kit/src/index.ts index 5dc565db9f..d28b014bec 100644 --- a/packages/utilities/kit/src/index.ts +++ b/packages/utilities/kit/src/index.ts @@ -1,6 +1,6 @@ export * as JsxConfig from "./JsxConfig"; export * as LanguagePreference from "./LanguagePreference"; -export * as RE from "./RE"; -export * as Report from "./Report"; -export * as SEL from "./SEL"; +export * as RegExp from "./RegExp"; +export * as Reporter from "./Reporter"; +export * as Selector from "./Selector"; export type * from "./types";