diff --git a/.oxlintrc.json b/.oxlintrc.json index e3f32451..7676c02f 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -16,7 +16,7 @@ ], "categories": {}, "rules": { - "import/no-cycle": "warn", + "import/no-cycle": "error", "import/no-duplicates": "error", "import/no-extraneous-dependencies": "error", "import/no-unresolved": "error", @@ -98,6 +98,7 @@ "typescript/no-wrapper-object-types": "warn", "typescript/prefer-as-const": "warn", "typescript/triple-slash-reference": "warn", + "typescript/consistent-type-imports": "error", "unicorn/no-await-in-promise-methods": "warn", "unicorn/no-empty-file": "warn", "unicorn/no-invalid-fetch-options": "warn", @@ -110,7 +111,10 @@ "unicorn/no-useless-length-check": "warn", "unicorn/no-useless-spread": "warn", "unicorn/prefer-set-size": "warn", - "unicorn/prefer-string-starts-ends-with": "warn" + "unicorn/prefer-string-starts-ends-with": "warn", + "jest/valid-expect": "off", + "react/exhaustive-deps": "off", + "jsx_a11y/click-events-have-key-events": "off" }, "settings": { "jsx-a11y": { diff --git a/packages/core/src/features/caret/TriggerFinder.spec.ts b/packages/core/src/features/caret/TriggerFinder.spec.ts index c491cf1a..7b61e779 100644 --- a/packages/core/src/features/caret/TriggerFinder.spec.ts +++ b/packages/core/src/features/caret/TriggerFinder.spec.ts @@ -1,7 +1,7 @@ import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest' import {TriggerFinder} from './TriggerFinder' import {Caret} from './Caret' -import {Markup} from '../parsing/ParserV2/types' +import type {Markup} from '../parsing/ParserV2/types' // Mock DOM const mockCreateTextNode = vi.fn( diff --git a/packages/core/src/features/caret/TriggerFinder.ts b/packages/core/src/features/caret/TriggerFinder.ts index d412cf19..5f7be75c 100644 --- a/packages/core/src/features/caret/TriggerFinder.ts +++ b/packages/core/src/features/caret/TriggerFinder.ts @@ -1,5 +1,5 @@ import {Caret} from './Caret' -import {OverlayMatch} from '../../shared/types' +import type {OverlayMatch} from '../../shared/types' import {escape} from '../../shared/escape' /** Regex to match word characters from the start of a string */ diff --git a/packages/core/src/features/events/EventBus.spec.ts b/packages/core/src/features/events/EventBus.spec.ts index 74fc3b45..ad160332 100644 --- a/packages/core/src/features/events/EventBus.spec.ts +++ b/packages/core/src/features/events/EventBus.spec.ts @@ -1,6 +1,6 @@ import {beforeEach, describe, expect, it, vi} from 'vitest' import {EventBus} from '.' -import {EventKey} from '../../shared/types' +import type {EventKey} from '../../shared/types' describe(`Utility: ${EventBus.name}`, () => { let eventBus: EventBus diff --git a/packages/core/src/features/events/EventBus.ts b/packages/core/src/features/events/EventBus.ts index 1ba5a639..2a8b7615 100644 --- a/packages/core/src/features/events/EventBus.ts +++ b/packages/core/src/features/events/EventBus.ts @@ -1,4 +1,4 @@ -import {EventKey, Listener} from '../../shared/types' +import type {EventKey, Listener} from '../../shared/types' export class EventBus { readonly #SystemEvents = new Map, Set>() diff --git a/packages/core/src/features/events/constants.ts b/packages/core/src/features/events/constants.ts index 56a3a6d9..0a58fc7d 100644 --- a/packages/core/src/features/events/constants.ts +++ b/packages/core/src/features/events/constants.ts @@ -1,5 +1,5 @@ -import {Token} from '../parsing/ParserV2/types' -import {EventKey, OverlayMatch} from '../../shared/types' +import type {Token} from '../parsing/ParserV2/types' +import type {EventKey, OverlayMatch} from '../../shared/types' export const SystemEvent = { STORE_UPDATED: Symbol() as EventKey, diff --git a/packages/core/src/features/parsing/ParserV2/Parser.spec.ts b/packages/core/src/features/parsing/ParserV2/Parser.spec.ts index a5c0cff1..4d17d7d5 100644 --- a/packages/core/src/features/parsing/ParserV2/Parser.spec.ts +++ b/packages/core/src/features/parsing/ParserV2/Parser.spec.ts @@ -1,6 +1,6 @@ import {beforeEach, describe, expect, it} from 'vitest' import {Parser} from './Parser' -import {MarkToken, Markup, Token} from './types' +import type {MarkToken, Markup, Token} from './types' import {faker} from '@faker-js/faker' describe('ParserV2', () => { diff --git a/packages/core/src/features/parsing/ParserV2/Parser.ts b/packages/core/src/features/parsing/ParserV2/Parser.ts index bbfd2bfb..075a38b0 100644 --- a/packages/core/src/features/parsing/ParserV2/Parser.ts +++ b/packages/core/src/features/parsing/ParserV2/Parser.ts @@ -1,11 +1,11 @@ -import {Markup, Token, MarkToken} from './types' +import type {Markup, Token, MarkToken} from './types' import {MarkupRegistry} from './core/MarkupRegistry' import {PatternMatcher} from './core/PatternMatcher' import {SegmentMatcher} from './core/SegmentMatcher' import {createTextToken} from './utils/createTextToken' import {TreeBuilder} from './core/TreeBuilder' import {toString as tokensToString} from './utils/toString' -import {processTokensWithCallback} from './utils/denote' +import {processTokensWithCallback} from './utils/processTokens' /** * Parser - High-performance tree-based markup parser diff --git a/packages/core/src/features/parsing/ParserV2/core/MarkupDescriptor.ts b/packages/core/src/features/parsing/ParserV2/core/MarkupDescriptor.ts index 2201fb70..f917efd2 100644 --- a/packages/core/src/features/parsing/ParserV2/core/MarkupDescriptor.ts +++ b/packages/core/src/features/parsing/ParserV2/core/MarkupDescriptor.ts @@ -1,6 +1,7 @@ -import {GAP_TYPE, GapType, PLACEHOLDER} from '../constants' -import {Markup} from '../types' -import {SegmentDefinition} from './SegmentMatcher' +import type {GapType} from '../constants' +import {GAP_TYPE, PLACEHOLDER} from '../constants' +import type {Markup} from '../types' +import type {SegmentDefinition} from './SegmentMatcher' /** * Descriptor for segment-based markup parsing @@ -53,7 +54,7 @@ export function createMarkupDescriptor(markup: Markup, index: number): MarkupDes gapTypes, hasNested: counts.nested === 1, hasTwoValues, - segmentGlobalIndices: new Array(segments.length), // Will be populated by MarkupRegistry + segmentGlobalIndices: Array.from({length: segments.length}), // Will be populated by MarkupRegistry } } diff --git a/packages/core/src/features/parsing/ParserV2/core/MarkupRegistry.ts b/packages/core/src/features/parsing/ParserV2/core/MarkupRegistry.ts index 3216e930..766115cf 100644 --- a/packages/core/src/features/parsing/ParserV2/core/MarkupRegistry.ts +++ b/packages/core/src/features/parsing/ParserV2/core/MarkupRegistry.ts @@ -1,6 +1,7 @@ -import {Markup} from '../types' -import {MarkupDescriptor, createMarkupDescriptor} from '../core/MarkupDescriptor' -import {SegmentDefinition} from './SegmentMatcher' +import type {Markup} from '../types' +import type {MarkupDescriptor} from '../core/MarkupDescriptor' +import {createMarkupDescriptor} from '../core/MarkupDescriptor' +import type {SegmentDefinition} from './SegmentMatcher' /** * Registry for managing markup descriptors diff --git a/packages/core/src/features/parsing/ParserV2/core/Match.ts b/packages/core/src/features/parsing/ParserV2/core/Match.ts index 79e85781..d67a4c16 100644 --- a/packages/core/src/features/parsing/ParserV2/core/Match.ts +++ b/packages/core/src/features/parsing/ParserV2/core/Match.ts @@ -1,7 +1,7 @@ -import {GapType} from '../constants' -import {PositionRange} from '../types' -import {SegmentMatch} from './SegmentMatcher' -import {MarkupDescriptor} from './MarkupDescriptor' +import type {GapType} from '../constants' +import type {PositionRange} from '../types' +import type {SegmentMatch} from './SegmentMatcher' +import type {MarkupDescriptor} from './MarkupDescriptor' import {getSegmentIndex} from '../utils/getSegmentIndex' /** diff --git a/packages/core/src/features/parsing/ParserV2/core/PatternMatcher.ts b/packages/core/src/features/parsing/ParserV2/core/PatternMatcher.ts index 3a2be833..26876b97 100644 --- a/packages/core/src/features/parsing/ParserV2/core/PatternMatcher.ts +++ b/packages/core/src/features/parsing/ParserV2/core/PatternMatcher.ts @@ -12,8 +12,8 @@ * - Gap position management for nested content extraction */ -import {MarkupRegistry} from './MarkupRegistry' -import {SegmentMatch} from './SegmentMatcher' +import type {MarkupRegistry} from './MarkupRegistry' +import type {SegmentMatch} from './SegmentMatcher' import {Match} from './Match' import {getSegmentIndex} from '../utils/getSegmentIndex' import type {MarkupDescriptor} from './MarkupDescriptor' diff --git a/packages/core/src/features/parsing/ParserV2/core/SegmentMatcher.spec.ts b/packages/core/src/features/parsing/ParserV2/core/SegmentMatcher.spec.ts index 8126dff6..79c5737f 100644 --- a/packages/core/src/features/parsing/ParserV2/core/SegmentMatcher.spec.ts +++ b/packages/core/src/features/parsing/ParserV2/core/SegmentMatcher.spec.ts @@ -1,7 +1,8 @@ import {describe, expect, it} from 'vitest' -import {SegmentDefinition, SegmentMatcher} from './SegmentMatcher' +import type {SegmentDefinition} from './SegmentMatcher' +import {SegmentMatcher} from './SegmentMatcher' import {MarkupRegistry} from './MarkupRegistry' -import {Markup} from '../types' +import type {Markup} from '../types' describe('SegmentMatcher', () => { describe('static segments', () => { diff --git a/packages/core/src/features/parsing/ParserV2/core/TreeBuilder.ts b/packages/core/src/features/parsing/ParserV2/core/TreeBuilder.ts index dfd0d733..d4801793 100644 --- a/packages/core/src/features/parsing/ParserV2/core/TreeBuilder.ts +++ b/packages/core/src/features/parsing/ParserV2/core/TreeBuilder.ts @@ -1,5 +1,5 @@ -import {MarkToken, PositionRange, TextToken, Token} from '../types' -import {Match} from './Match' +import type {MarkToken, PositionRange, TextToken, Token} from '../types' +import type {Match} from './Match' import {createTextToken} from '../utils/createTextToken' /** diff --git a/packages/core/src/features/parsing/ParserV2/types.ts b/packages/core/src/features/parsing/ParserV2/types.ts index df2df7c6..97750fd0 100644 --- a/packages/core/src/features/parsing/ParserV2/types.ts +++ b/packages/core/src/features/parsing/ParserV2/types.ts @@ -1,5 +1,5 @@ -import {PLACEHOLDER} from './constants' -import {MarkupDescriptor} from './core/MarkupDescriptor' +import type {PLACEHOLDER} from './constants' +import type {MarkupDescriptor} from './core/MarkupDescriptor' export type Token = TextToken | MarkToken diff --git a/packages/core/src/features/parsing/ParserV2/utils/annotate.spec.ts b/packages/core/src/features/parsing/ParserV2/utils/annotate.spec.ts index 53ebb40c..28077d0b 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/annotate.spec.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/annotate.spec.ts @@ -1,5 +1,5 @@ import {describe, expect, it} from 'vitest' -import {Markup} from '../types' +import type {Markup} from '../types' import {annotate} from './annotate' describe(`Utility: ${annotate.name}`, () => { diff --git a/packages/core/src/features/parsing/ParserV2/utils/annotate.ts b/packages/core/src/features/parsing/ParserV2/utils/annotate.ts index b153fe0c..2186c706 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/annotate.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/annotate.ts @@ -1,5 +1,5 @@ import {PLACEHOLDER} from '../constants' -import {Markup} from '../types' +import type {Markup} from '../types' /** * Make annotation from the markup for ParserV2 diff --git a/packages/core/src/features/parsing/ParserV2/utils/createTextToken.ts b/packages/core/src/features/parsing/ParserV2/utils/createTextToken.ts index cdbeedd8..7e4239d2 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/createTextToken.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/createTextToken.ts @@ -1,4 +1,4 @@ -import {TextToken} from '../types' +import type {TextToken} from '../types' /** * Creates a text token for a range in the input diff --git a/packages/core/src/features/parsing/ParserV2/utils/denote.spec.ts b/packages/core/src/features/parsing/ParserV2/utils/denote.spec.ts index 6dc4fc49..1d191b17 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/denote.spec.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/denote.spec.ts @@ -1,5 +1,5 @@ import {describe, expect, it} from 'vitest' -import {Markup} from '../types' +import type {Markup} from '../types' import {denote} from './denote' describe('Utility: denote', () => { diff --git a/packages/core/src/features/parsing/ParserV2/utils/denote.ts b/packages/core/src/features/parsing/ParserV2/utils/denote.ts index c84a75ce..c6ff048b 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/denote.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/denote.ts @@ -1,5 +1,6 @@ import {Parser} from '../Parser' -import {MarkToken, Markup, Token} from '../types' +import type {MarkToken, Markup} from '../types' +import {processTokensWithCallback} from './processTokens' /** * Transform annotated text to another text by recursively processing all tokens @@ -23,38 +24,3 @@ export function denote(value: string, callback: (mark: MarkToken) => string, mar return processTokensWithCallback(tokens, callback) } - -/** - * Internal function to process tokens with a callback - * @param tokens - Tokens to process - * @param callback - Function to transform each MarkToken - * @returns Transformed text - */ -export function processTokensWithCallback(tokens: Token[], callback: (mark: MarkToken) => string): string { - let result = '' - for (const token of tokens) { - if (token.type === 'text') { - result += token.content - } else { - // For MarkToken with children, we need to decide: - // - If we want to transform the mark itself AND its children - // - Or transform children and include them in the mark's transformation - - if (token.children.length > 0) { - // Recursively process children to get their transformed content - const processedChildren = processTokensWithCallback(token.children, callback) - - // Create a modified token with processed children as the value - // This allows the callback to use the already-processed nested content - const modifiedToken: MarkToken = { - ...token, - value: processedChildren, - } - result += callback(modifiedToken) - } else { - result += callback(token) - } - } - } - return result -} diff --git a/packages/core/src/features/parsing/ParserV2/utils/processTokens.ts b/packages/core/src/features/parsing/ParserV2/utils/processTokens.ts new file mode 100644 index 00000000..2875f6d4 --- /dev/null +++ b/packages/core/src/features/parsing/ParserV2/utils/processTokens.ts @@ -0,0 +1,36 @@ +import type {MarkToken, Token} from '../types' + +/** + * Internal function to process tokens with a callback + * @param tokens - Tokens to process + * @param callback - Function to transform each MarkToken + * @returns Transformed text + */ +export function processTokensWithCallback(tokens: Token[], callback: (mark: MarkToken) => string): string { + let result = '' + for (const token of tokens) { + if (token.type === 'text') { + result += token.content + } else { + // For MarkToken with children, we need to decide: + // - If we want to transform the mark itself AND its children + // - Or transform children and include them in the mark's transformation + + if (token.children.length > 0) { + // Recursively process children to get their transformed content + const processedChildren = processTokensWithCallback(token.children, callback) + + // Create a modified token with processed children as the value + // This allows the callback to use the already-processed nested content + const modifiedToken: MarkToken = { + ...token, + value: processedChildren, + } + result += callback(modifiedToken) + } else { + result += callback(token) + } + } + } + return result +} diff --git a/packages/core/src/features/parsing/ParserV2/utils/toString.spec.ts b/packages/core/src/features/parsing/ParserV2/utils/toString.spec.ts index 5191b4df..00baa945 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/toString.spec.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/toString.spec.ts @@ -1,5 +1,5 @@ import {describe, expect, it} from 'vitest' -import {Markup} from '../types' +import type {Markup} from '../types' import {toString} from './toString' import {Parser} from '../Parser' diff --git a/packages/core/src/features/parsing/ParserV2/utils/toString.ts b/packages/core/src/features/parsing/ParserV2/utils/toString.ts index 680ba82b..7d88f661 100644 --- a/packages/core/src/features/parsing/ParserV2/utils/toString.ts +++ b/packages/core/src/features/parsing/ParserV2/utils/toString.ts @@ -1,4 +1,4 @@ -import {Token} from '../types' +import type {Token} from '../types' import {PLACEHOLDER} from '../constants' import {annotate} from './annotate' diff --git a/packages/core/src/features/parsing/parser.profile.bench.ts b/packages/core/src/features/parsing/parser.profile.bench.ts index 3522e3cd..05a12ab9 100644 --- a/packages/core/src/features/parsing/parser.profile.bench.ts +++ b/packages/core/src/features/parsing/parser.profile.bench.ts @@ -1,6 +1,6 @@ import {afterAll, bench, describe} from 'vitest' import {Parser} from './ParserV2/Parser' -import {Markup, Token} from './ParserV2/types' +import type {Markup, Token} from './ParserV2/types' import * as fs from 'fs' import * as path from 'path' diff --git a/packages/core/src/features/store/Store.ts b/packages/core/src/features/store/Store.ts index 091482fb..f08c2401 100644 --- a/packages/core/src/features/store/Store.ts +++ b/packages/core/src/features/store/Store.ts @@ -1,9 +1,9 @@ import {NodeProxy} from '../../shared/classes/NodeProxy' -import {Token} from '../parsing/ParserV2/types' -import {OverlayMatch, Recovery, CoreMarkputProps} from '../../shared/types' +import type {Token} from '../parsing/ParserV2/types' +import type {OverlayMatch, Recovery, CoreMarkputProps} from '../../shared/types' import {EventBus, SystemEvent} from '../events' import {KeyGenerator} from '../../shared/classes/KeyGenerator' -import {Parser} from '../parsing/ParserV2/Parser' +import type {Parser} from '../parsing/ParserV2/Parser' export class Store { // Utils domain diff --git a/packages/core/src/features/text-manipulation/utils/deleteMark.ts b/packages/core/src/features/text-manipulation/utils/deleteMark.ts index 6c2a3c85..e0d22c29 100644 --- a/packages/core/src/features/text-manipulation/utils/deleteMark.ts +++ b/packages/core/src/features/text-manipulation/utils/deleteMark.ts @@ -1,4 +1,4 @@ -import {Store} from '../../store' +import type {Store} from '../../store' import {toString} from '../../parsing' export function deleteMark(place: 'prev' | 'self' | 'next', store: Store) { diff --git a/packages/core/src/shared/classes/NodeProxy.ts b/packages/core/src/shared/classes/NodeProxy.ts index 339a6a69..99d49840 100644 --- a/packages/core/src/shared/classes/NodeProxy.ts +++ b/packages/core/src/shared/classes/NodeProxy.ts @@ -1,4 +1,4 @@ -import {Store} from '../../features/store' +import type {Store} from '../../features/store' import {Caret} from '../../features/caret' export class NodeProxy { diff --git a/packages/core/src/shared/types.ts b/packages/core/src/shared/types.ts index 89d4dade..a10d633b 100644 --- a/packages/core/src/shared/types.ts +++ b/packages/core/src/shared/types.ts @@ -1,4 +1,4 @@ -import {NodeProxy} from './classes/NodeProxy' +import type {NodeProxy} from './classes/NodeProxy' import type {Markup} from '../features/parsing/ParserV2/types' /** @@ -83,7 +83,7 @@ export type OverlayMatch = { export type Listener = (e: T) => void -// eslint-disable-next-line @typescript-eslint/no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars, oxlint-disable-next-line no-wrapper-object-types export interface EventKey extends Symbol {} export type Recovery = { diff --git a/packages/markput/src/components/EditableSpan.tsx b/packages/markput/src/components/EditableSpan.tsx index 7d477eea..ff4cf5a8 100644 --- a/packages/markput/src/components/EditableSpan.tsx +++ b/packages/markput/src/components/EditableSpan.tsx @@ -1,4 +1,4 @@ -import {ClipboardEvent} from 'react' +import type {ClipboardEvent} from 'react' import {resolveSlot, resolveSlotProps} from '../utils/functions/resolveSlot' import {useMark} from '../utils/hooks/useMark' import {useStore} from '../utils/hooks/useStore' diff --git a/packages/markput/src/components/Featurer.tsx b/packages/markput/src/components/Featurer.tsx index da00f3af..43b8c845 100644 --- a/packages/markput/src/components/Featurer.tsx +++ b/packages/markput/src/components/Featurer.tsx @@ -1,4 +1,4 @@ -import {ForwardedRef} from 'react' +import type {ForwardedRef} from 'react' import {useCloseOverlayByEsc} from '../features/events/useCloseOverlayByEsc' import {useCloseOverlayByOutsideClick} from '../features/events/useCloseOverlayByOutsideClick' import {useKeyDown} from '../features/events/useKeyDown' @@ -11,7 +11,7 @@ import {useCheckTrigger} from '../features/overlay/useCheckTrigger' import {useTrigger} from '../features/overlay/useTrigger' import {useValueParser} from '../features/parsing/useValueParser' import {useMarkedInputHandler} from '../features/useMarkedInputHandler' -import {MarkedInputHandler} from '../types' +import type {MarkedInputHandler} from '../types' export const Featurer = ({inRef}: {inRef: ForwardedRef}) => { useMarkedInputHandler(inRef) diff --git a/packages/markput/src/components/MarkedInput.tsx b/packages/markput/src/components/MarkedInput.tsx index 51e3b0ac..5d64b55c 100644 --- a/packages/markput/src/components/MarkedInput.tsx +++ b/packages/markput/src/components/MarkedInput.tsx @@ -1,11 +1,12 @@ -import {CSSProperties, ComponentType, ForwardedRef, forwardRef} from 'react' +import type {CSSProperties, ComponentType, ForwardedRef} from 'react' +import {forwardRef} from 'react' import '@markput/core/styles.css' -import {MarkedInputHandler, Option, Slots, SlotProps, OverlayProps, MarkProps} from '../types' +import type {MarkedInputHandler, Option, Slots, SlotProps, OverlayProps, MarkProps} from '../types' import {Container} from './Container' import {Featurer} from './Featurer' import {StoreProvider} from './StoreProvider' import {Whisper} from './Whisper' -import {CoreMarkputProps, OverlayTrigger} from '@markput/core' +import type {CoreMarkputProps, OverlayTrigger} from '@markput/core' /** * Props for MarkedInput component with hierarchical type support. diff --git a/packages/markput/src/components/Piece.tsx b/packages/markput/src/components/Piece.tsx index 8ecc114e..599cfe1e 100644 --- a/packages/markput/src/components/Piece.tsx +++ b/packages/markput/src/components/Piece.tsx @@ -1,7 +1,8 @@ -import {ReactNode} from 'react' +import type {ReactNode} from 'react' import {useStore} from '../utils/hooks/useStore' import {useSlot} from '../utils/hooks/useSlot' import {useToken} from '../utils/providers/TokenProvider' +// eslint-disable-next-line import/no-cycle -- Legitimate recursive component relationship: Token renders Piece, Piece renders Token for children import {Token} from './Token' import type {MarkProps} from '../types' diff --git a/packages/markput/src/components/StoreProvider.tsx b/packages/markput/src/components/StoreProvider.tsx index d591fd39..15e1dd7b 100644 --- a/packages/markput/src/components/StoreProvider.tsx +++ b/packages/markput/src/components/StoreProvider.tsx @@ -1,6 +1,7 @@ -import {ReactNode, useEffect, useState} from 'react' +import type {ReactNode} from 'react' +import {useEffect, useState} from 'react' import {Store, DEFAULT_CLASS_NAME} from '@markput/core' -import {MarkedInputProps} from './MarkedInput' +import type {MarkedInputProps} from './MarkedInput' import {StoreContext} from '../utils/providers/StoreContext' import {mergeClassNames, mergeStyles} from '../utils/functions/resolveSlot' import {DEFAULT_OPTIONS} from '../constants' diff --git a/packages/markput/src/components/Suggestions/Suggestions.tsx b/packages/markput/src/components/Suggestions/Suggestions.tsx index 129ed82c..60e2ba17 100644 --- a/packages/markput/src/components/Suggestions/Suggestions.tsx +++ b/packages/markput/src/components/Suggestions/Suggestions.tsx @@ -1,4 +1,5 @@ -import {RefObject, useMemo, useState} from 'react' +import type {RefObject} from 'react' +import {useMemo, useState} from 'react' import {useDownOf} from '../../utils/hooks/useDownOf' import {useOverlay} from '../../utils/hooks/useOverlay' import {KEYBOARD} from '@markput/core' diff --git a/packages/markput/src/components/TextSpan.tsx b/packages/markput/src/components/TextSpan.tsx index 2eede9af..a0cd0d78 100644 --- a/packages/markput/src/components/TextSpan.tsx +++ b/packages/markput/src/components/TextSpan.tsx @@ -1,4 +1,5 @@ -import {ClipboardEvent, useRef} from 'react' +import type {ClipboardEvent} from 'react' +import {useRef} from 'react' import {resolveSlot, resolveSlotProps} from '../utils/functions/resolveSlot' import {useStore} from '../utils/hooks/useStore' import {useToken} from '../utils/providers/TokenProvider' diff --git a/packages/markput/src/components/Token.tsx b/packages/markput/src/components/Token.tsx index 86aa1fc2..185cbccd 100644 --- a/packages/markput/src/components/Token.tsx +++ b/packages/markput/src/components/Token.tsx @@ -1,6 +1,7 @@ import {memo} from 'react' -import {Token as TokenType} from '@markput/core' +import type {Token as TokenType} from '@markput/core' import {TokenProvider} from '../utils/providers/TokenProvider' +// eslint-disable-next-line import/no-cycle -- Legitimate recursive component relationship: Token renders Piece, Piece renders Token for children import {Piece} from './Piece' import {TextSpan} from './TextSpan' diff --git a/packages/markput/src/constants.ts b/packages/markput/src/constants.ts index 8a3b5361..b962251f 100644 --- a/packages/markput/src/constants.ts +++ b/packages/markput/src/constants.ts @@ -1,5 +1,5 @@ import {DEFAULT_MARKUP, DEFAULT_OVERLAY_TRIGGER} from '@markput/core' -import {Option} from './types' +import type {Option} from './types' /** * React-specific default options for MarkedInput. diff --git a/packages/markput/src/features/events/useCloseOverlayByEsc.tsx b/packages/markput/src/features/events/useCloseOverlayByEsc.tsx index 5d3693bc..0d8ed8d6 100644 --- a/packages/markput/src/features/events/useCloseOverlayByEsc.tsx +++ b/packages/markput/src/features/events/useCloseOverlayByEsc.tsx @@ -20,5 +20,5 @@ export function useCloseOverlayByEsc() { window.addEventListener('keydown', handle) return () => window.removeEventListener('keydown', handle) - }, [match]) + }, [match, bus]) } diff --git a/packages/markput/src/features/overlay/useCheckTrigger.tsx b/packages/markput/src/features/overlay/useCheckTrigger.tsx index e30c0f9e..6550c4d9 100644 --- a/packages/markput/src/features/overlay/useCheckTrigger.tsx +++ b/packages/markput/src/features/overlay/useCheckTrigger.tsx @@ -1,7 +1,8 @@ import {useCallback} from 'react' import {useListener} from '../../utils/hooks/useListener' import {useStore} from '../../utils/hooks/useStore' -import {OverlayTrigger, SystemEvent} from '@markput/core' +import type {OverlayTrigger} from '@markput/core' +import {SystemEvent} from '@markput/core' export function useCheckTrigger() { const store = useStore() diff --git a/packages/markput/src/features/parsing/useValueParser.tsx b/packages/markput/src/features/parsing/useValueParser.tsx index 3f467a53..e54c88ad 100644 --- a/packages/markput/src/features/parsing/useValueParser.tsx +++ b/packages/markput/src/features/parsing/useValueParser.tsx @@ -1,7 +1,8 @@ import {useEffect, useRef} from 'react' import {useListener} from '../../utils/hooks/useListener' import {useStore} from '../../utils/hooks/useStore' -import {Parser, SystemEvent, Store, findGap, getClosestIndexes} from '@markput/core' +import type {Store} from '@markput/core' +import {Parser, SystemEvent, findGap, getClosestIndexes} from '@markput/core' export const useValueParser = () => { const store = useStore() diff --git a/packages/markput/src/features/useMarkedInputHandler.tsx b/packages/markput/src/features/useMarkedInputHandler.tsx index 7d2496b2..f5c9ee7d 100644 --- a/packages/markput/src/features/useMarkedInputHandler.tsx +++ b/packages/markput/src/features/useMarkedInputHandler.tsx @@ -1,6 +1,7 @@ -import {ForwardedRef, useImperativeHandle} from 'react' -import {MarkedInputHandler} from '../types' -import {Store} from '@markput/core' +import type {ForwardedRef} from 'react' +import {useImperativeHandle} from 'react' +import type {MarkedInputHandler} from '../types' +import type {Store} from '@markput/core' import {useStore} from '../utils/hooks/useStore' const initHandler = (store: Store): MarkedInputHandler => ({ diff --git a/packages/markput/src/types.ts b/packages/markput/src/types.ts index 2f94fa80..37ecc12a 100644 --- a/packages/markput/src/types.ts +++ b/packages/markput/src/types.ts @@ -1,6 +1,6 @@ -import {ComponentType, ElementType, FunctionComponent, HTMLAttributes, ReactNode} from 'react' -import {MarkedInputProps} from './components/MarkedInput' -import {CoreOption} from '@markput/core' +import type {ComponentType, ElementType, FunctionComponent, HTMLAttributes, ReactNode} from 'react' +import type {MarkedInputProps} from './components/MarkedInput' +import type {CoreOption} from '@markput/core' /** * Utility type to extract props from a ComponentType. diff --git a/packages/markput/src/utils/functions/createContext.ts b/packages/markput/src/utils/functions/createContext.ts index 71872f98..8ea3c925 100644 --- a/packages/markput/src/utils/functions/createContext.ts +++ b/packages/markput/src/utils/functions/createContext.ts @@ -1,4 +1,5 @@ -import React, {Context, useContext} from 'react' +import type {Context} from 'react' +import React, {useContext} from 'react' export const createContext = ( name: string diff --git a/packages/markput/src/utils/functions/createMarkedInput.ts b/packages/markput/src/utils/functions/createMarkedInput.ts index f38c59ad..b9bb7179 100644 --- a/packages/markput/src/utils/functions/createMarkedInput.ts +++ b/packages/markput/src/utils/functions/createMarkedInput.ts @@ -1,6 +1,8 @@ -import {ForwardedRef, forwardRef} from 'react' -import {MarkedInputProps, _MarkedInput} from '../../components/MarkedInput' -import {ConfiguredMarkedInput, MarkProps, OverlayProps} from '../../types' +import type {ForwardedRef} from 'react' +import {forwardRef} from 'react' +import type {MarkedInputProps} from '../../components/MarkedInput' +import {_MarkedInput} from '../../components/MarkedInput' +import type {ConfiguredMarkedInput, MarkProps, OverlayProps} from '../../types' /** * Create the configured MarkedInput component. diff --git a/packages/markput/src/utils/functions/resolveSlot.ts b/packages/markput/src/utils/functions/resolveSlot.ts index 39b72c17..dca71741 100644 --- a/packages/markput/src/utils/functions/resolveSlot.ts +++ b/packages/markput/src/utils/functions/resolveSlot.ts @@ -1,6 +1,6 @@ -import {CSSProperties, ElementType, HTMLAttributes} from 'react' -import {Store} from '@markput/core' -import {MarkedInputProps} from '../../components/MarkedInput' +import type {CSSProperties, ElementType, HTMLAttributes} from 'react' +import type {Store} from '@markput/core' +import type {MarkedInputProps} from '../../components/MarkedInput' import {convertDataAttrs} from './dataAttributes' /** diff --git a/packages/markput/src/utils/hooks/useDownOf.tsx b/packages/markput/src/utils/hooks/useDownOf.tsx index 603fd0e2..7ae7817b 100644 --- a/packages/markput/src/utils/hooks/useDownOf.tsx +++ b/packages/markput/src/utils/hooks/useDownOf.tsx @@ -1,6 +1,6 @@ -import {DependencyList} from 'react' +import type {DependencyList} from 'react' import {useListener} from './useListener' -import {KEYBOARD} from '@markput/core' +import type {KEYBOARD} from '@markput/core' export function useDownOf(key: KEYBOARD, callback: (event: KeyboardEvent) => void, deps: DependencyList = []) { useListener( diff --git a/packages/markput/src/utils/hooks/useListener.tsx b/packages/markput/src/utils/hooks/useListener.tsx index dc738c39..cbafcc11 100644 --- a/packages/markput/src/utils/hooks/useListener.tsx +++ b/packages/markput/src/utils/hooks/useListener.tsx @@ -1,7 +1,8 @@ -import {DependencyList, useContext, useEffect} from 'react' -import {EventKey, Listener, assertNonNullable} from '@markput/core' +import type {DependencyList} from 'react' +import {useContext, useEffect} from 'react' +import type {EventKey, Listener} from '@markput/core' +import {assertNonNullable} from '@markput/core' import {StoreContext} from '../providers/StoreContext' -import {useStore} from './useStore' export function useListener(key: EventKey, listener: Listener, deps?: DependencyList): void export function useListener( @@ -29,9 +30,9 @@ function useContainerListener( listener: Listener, deps?: DependencyList ) { - const store = useStore() + const store = useContext(StoreContext) useEffect(() => { - store.refs.container?.addEventListener(key, listener) - return () => store.refs.container?.removeEventListener(key, listener) + store?.refs.container?.addEventListener(key, listener) + return () => store?.refs.container?.removeEventListener(key, listener) }, deps) } diff --git a/packages/markput/src/utils/hooks/useMark.ts b/packages/markput/src/utils/hooks/useMark.ts index 10403d76..d8c2fc98 100644 --- a/packages/markput/src/utils/hooks/useMark.ts +++ b/packages/markput/src/utils/hooks/useMark.ts @@ -1,5 +1,7 @@ -import {RefObject, useEffect, useMemo, useRef, useState} from 'react' -import {MarkToken, Store, SystemEvent, Token} from '@markput/core' +import type {RefObject} from 'react' +import {useEffect, useMemo, useRef, useState} from 'react' +import type {MarkToken, Store, Token} from '@markput/core' +import {SystemEvent} from '@markput/core' import {useToken} from '../providers/TokenProvider' import {useStore} from './useStore' diff --git a/packages/markput/src/utils/hooks/useOverlay.tsx b/packages/markput/src/utils/hooks/useOverlay.tsx index e3d87fd9..dc4ba430 100644 --- a/packages/markput/src/utils/hooks/useOverlay.tsx +++ b/packages/markput/src/utils/hooks/useOverlay.tsx @@ -1,5 +1,7 @@ -import {RefObject, useCallback} from 'react' -import {Caret, OverlayMatch, SystemEvent, Token} from '@markput/core' +import type {RefObject} from 'react' +import {useCallback} from 'react' +import type {OverlayMatch, Token} from '@markput/core' +import {Caret, SystemEvent} from '@markput/core' import type {Option} from '../../types' import {useStore} from './useStore' diff --git a/packages/markput/src/utils/hooks/useSlot.ts b/packages/markput/src/utils/hooks/useSlot.ts index 0136bfca..2063c36e 100644 --- a/packages/markput/src/utils/hooks/useSlot.ts +++ b/packages/markput/src/utils/hooks/useSlot.ts @@ -1,4 +1,4 @@ -import {ComponentType} from 'react' +import type {ComponentType} from 'react' import {useStore} from './useStore' import type {Option, MarkProps} from '../../types' diff --git a/packages/markput/src/utils/hooks/useStore.ts b/packages/markput/src/utils/hooks/useStore.ts index 0703b0bf..0a80971e 100644 --- a/packages/markput/src/utils/hooks/useStore.ts +++ b/packages/markput/src/utils/hooks/useStore.ts @@ -2,7 +2,7 @@ import {useContext, useState} from 'react' import type {Store} from '@markput/core' import {SystemEvent, assertNonNullable, shallow} from '@markput/core' import {StoreContext} from '../providers/StoreContext' -import {MarkedInputProps} from '../../components/MarkedInput' +import type {MarkedInputProps} from '../../components/MarkedInput' import {useListener} from './useListener' export function useStore(): Store diff --git a/packages/markput/src/utils/providers/StoreContext.ts b/packages/markput/src/utils/providers/StoreContext.ts index fb932a08..26ffe291 100644 --- a/packages/markput/src/utils/providers/StoreContext.ts +++ b/packages/markput/src/utils/providers/StoreContext.ts @@ -1,6 +1,6 @@ import {createContext} from 'react' -import {Store} from '@markput/core' -import {MarkedInputProps} from '../../components/MarkedInput' +import type {Store} from '@markput/core' +import type {MarkedInputProps} from '../../components/MarkedInput' export const StoreContext = createContext | undefined>(undefined) StoreContext.displayName = 'StoreContext' diff --git a/packages/markput/src/utils/providers/TokenProvider.ts b/packages/markput/src/utils/providers/TokenProvider.ts index b5b0a5f5..cc0268ab 100644 --- a/packages/markput/src/utils/providers/TokenProvider.ts +++ b/packages/markput/src/utils/providers/TokenProvider.ts @@ -1,4 +1,4 @@ import {createContext} from '../functions/createContext' -import {Token} from '@markput/core' +import type {Token} from '@markput/core' export const [useToken, TokenProvider] = createContext('NodeProvider') diff --git a/packages/storybook/assets/MaterialMentions/Mention.tsx b/packages/storybook/assets/MaterialMentions/Mention.tsx index bb542daa..e96cae56 100644 --- a/packages/storybook/assets/MaterialMentions/Mention.tsx +++ b/packages/storybook/assets/MaterialMentions/Mention.tsx @@ -1,6 +1,6 @@ import {Avatar, Chip} from '@mui/material' -import {MarkToken} from 'rc-marked-input' -import {User} from './types' +import type {MarkToken} from 'rc-marked-input' +import type {User} from './types' import {useFetch} from './utils/useFetch' export const Mention = ({value}: MarkToken) => { diff --git a/packages/storybook/assets/MaterialMentions/UserList/UserItem.tsx b/packages/storybook/assets/MaterialMentions/UserList/UserItem.tsx index dd8fb7cc..093bb1a1 100644 --- a/packages/storybook/assets/MaterialMentions/UserList/UserItem.tsx +++ b/packages/storybook/assets/MaterialMentions/UserList/UserItem.tsx @@ -1,6 +1,6 @@ import {Avatar, ListItem, ListItemAvatar, ListItemButton, ListItemText} from '@mui/material' -import {MarkToken} from 'rc-marked-input' -import {SearchUser} from '../types' +import type {MarkToken} from 'rc-marked-input' +import type {SearchUser} from '../types' export interface UserItemProps { onSelect: (mark: Pick) => void diff --git a/packages/storybook/assets/MaterialMentions/UserList/UserList.tsx b/packages/storybook/assets/MaterialMentions/UserList/UserList.tsx index 67fb03d9..3ec189c4 100644 --- a/packages/storybook/assets/MaterialMentions/UserList/UserList.tsx +++ b/packages/storybook/assets/MaterialMentions/UserList/UserList.tsx @@ -1,6 +1,6 @@ import {List, Paper} from '@mui/material' import {useOverlay} from 'rc-marked-input' -import {SearchUser} from '../types' +import type {SearchUser} from '../types' import {useFetch} from '../utils/useFetch' import {UserItem} from './UserItem' diff --git a/packages/storybook/assets/Tabs/Tabs.tsx b/packages/storybook/assets/Tabs/Tabs.tsx index 837c6288..08d242d2 100644 --- a/packages/storybook/assets/Tabs/Tabs.tsx +++ b/packages/storybook/assets/Tabs/Tabs.tsx @@ -1,4 +1,4 @@ -import {CSSProperties, ReactNode} from 'react' +import type {CSSProperties, ReactNode} from 'react' export interface Tab { value: string diff --git a/packages/storybook/main.ts b/packages/storybook/main.ts index ae0d3b3a..c0a4c100 100644 --- a/packages/storybook/main.ts +++ b/packages/storybook/main.ts @@ -1,4 +1,4 @@ -import {StorybookConfig} from '@storybook/react-vite' +import type {StorybookConfig} from '@storybook/react-vite' const config: StorybookConfig = { stories: ['./stories'], diff --git a/packages/storybook/preview.ts b/packages/storybook/preview.ts index 49b18c49..575a7e64 100644 --- a/packages/storybook/preview.ts +++ b/packages/storybook/preview.ts @@ -1,4 +1,4 @@ -import {Preview} from '@storybook/react-vite' +import type {Preview} from '@storybook/react-vite' const preview: Preview = { parameters: { diff --git a/packages/storybook/stories/Base.stories.tsx b/packages/storybook/stories/Base.stories.tsx index 440ee536..6e24da06 100644 --- a/packages/storybook/stories/Base.stories.tsx +++ b/packages/storybook/stories/Base.stories.tsx @@ -1,4 +1,4 @@ -import {Meta, StoryObj} from '@storybook/react-vite' +import type {Meta, StoryObj} from '@storybook/react-vite' import {MarkedInput, createMarkedInput, denote} from 'rc-marked-input' import type {MarkToken, Markup} from 'rc-marked-input' import {useState} from 'react' diff --git a/packages/storybook/stories/Material.stories.tsx b/packages/storybook/stories/Material.stories.tsx index c1d2b598..90ddf35d 100644 --- a/packages/storybook/stories/Material.stories.tsx +++ b/packages/storybook/stories/Material.stories.tsx @@ -1,5 +1,6 @@ import {Chip, Input} from '@mui/material' -import {MarkToken, MarkedInput} from 'rc-marked-input' +import type {MarkToken} from 'rc-marked-input' +import {MarkedInput} from 'rc-marked-input' import {useState} from 'react' import {MaterialMentions} from '../assets/MaterialMentions' import {Text} from '../assets/Text' diff --git a/packages/storybook/stories/Nested.stories.tsx b/packages/storybook/stories/Nested.stories.tsx index 38397932..d9addaed 100644 --- a/packages/storybook/stories/Nested.stories.tsx +++ b/packages/storybook/stories/Nested.stories.tsx @@ -1,7 +1,8 @@ -import {Meta, StoryObj} from '@storybook/react-vite' +import type {Meta, StoryObj} from '@storybook/react-vite' import {MarkedInput, createMarkedInput, useMark} from 'rc-marked-input' import type {MarkToken, Markup} from 'rc-marked-input' -import {ReactNode, useState} from 'react' +import type {ReactNode} from 'react' +import {useState} from 'react' import {Text} from '../assets/Text' import {useTab} from '../assets/Tabs' import {markdownOptions as MarkdownOptions} from './MarkdownOptions' diff --git a/packages/storybook/stories/Overlay.stories.tsx b/packages/storybook/stories/Overlay.stories.tsx index ec3e473c..4dad9af6 100644 --- a/packages/storybook/stories/Overlay.stories.tsx +++ b/packages/storybook/stories/Overlay.stories.tsx @@ -1,5 +1,6 @@ -import {Meta, StoryObj} from '@storybook/react-vite' -import {MarkToken, MarkedInput, useOverlay} from 'rc-marked-input' +import type {Meta, StoryObj} from '@storybook/react-vite' +import type {MarkToken} from 'rc-marked-input' +import {MarkedInput, useOverlay} from 'rc-marked-input' import {useState} from 'react' export default { diff --git a/packages/storybook/stories/Rsuite.stories.tsx b/packages/storybook/stories/Rsuite.stories.tsx index 88be3843..786f0bab 100644 --- a/packages/storybook/stories/Rsuite.stories.tsx +++ b/packages/storybook/stories/Rsuite.stories.tsx @@ -1,4 +1,4 @@ -import {Meta} from '@storybook/react-vite' +import type {Meta} from '@storybook/react-vite' import {MarkedInput, useOverlay} from 'rc-marked-input' import type {Markup} from 'rc-marked-input' import {useEffect, useState} from 'react' diff --git a/packages/storybook/stories/Slots.stories.tsx b/packages/storybook/stories/Slots.stories.tsx index df876636..7513b4cf 100644 --- a/packages/storybook/stories/Slots.stories.tsx +++ b/packages/storybook/stories/Slots.stories.tsx @@ -1,4 +1,4 @@ -import {Meta, StoryObj} from '@storybook/react-vite' +import type {Meta, StoryObj} from '@storybook/react-vite' import {MarkedInput} from 'rc-marked-input' import {forwardRef, useState} from 'react' import {Text} from '../assets/Text' diff --git a/packages/tests/integrations/MarkedInputHandler.spec.tsx b/packages/tests/integrations/MarkedInputHandler.spec.tsx index 629957f6..1bce3f90 100644 --- a/packages/tests/integrations/MarkedInputHandler.spec.tsx +++ b/packages/tests/integrations/MarkedInputHandler.spec.tsx @@ -1,8 +1,7 @@ -/// import '@testing-library/jest-dom' import {render} from '@testing-library/react' import {describe, expect, it} from 'vitest' -import {MarkedInputHandler} from 'rc-marked-input' +import type {MarkedInputHandler} from 'rc-marked-input' import {Story} from '../../storybook/stories' const {Default} = Story.Base diff --git a/packages/tests/integrations/createMarkedInput.spec.tsx b/packages/tests/integrations/createMarkedInput.spec.tsx index 83b23772..70a9f1cc 100644 --- a/packages/tests/integrations/createMarkedInput.spec.tsx +++ b/packages/tests/integrations/createMarkedInput.spec.tsx @@ -1,7 +1,8 @@ import '@testing-library/jest-dom' import {act, render} from '@testing-library/react' import user from '@testing-library/user-event' -import {MarkedInputHandler, createMarkedInput} from 'rc-marked-input' +import type {MarkedInputHandler} from 'rc-marked-input' +import {createMarkedInput} from 'rc-marked-input' import {forwardRef} from 'react' import {describe, expect, it, vi} from 'vitest' import {Story} from '../../storybook/stories' diff --git a/packages/tests/integrations/nested.spec.tsx b/packages/tests/integrations/nested.spec.tsx index 17a1acec..aa3fc31b 100644 --- a/packages/tests/integrations/nested.spec.tsx +++ b/packages/tests/integrations/nested.spec.tsx @@ -2,7 +2,7 @@ import '@testing-library/jest-dom' import {render, screen} from '@testing-library/react' import {MarkedInput, useMark} from 'rc-marked-input' import type {Markup} from 'rc-marked-input' -import {ReactNode} from 'react' +import type {ReactNode} from 'react' import {describe, expect, it} from 'vitest' describe('Nested Marks Rendering', () => { @@ -105,12 +105,13 @@ describe('Nested Marks Rendering', () => { }) it('should pass children to Mark component for nested content', () => { + let hasChildrenAtDepthZero = false + const CapturingMark = ({children}: {value?: string; children?: ReactNode}) => { const mark = useMark() - // Root mark should have children + // Capture whether root mark has children if (mark.depth === 0 && mark.hasChildren) { - expect(children).not.toBeNull() - expect(children).not.toBeUndefined() + hasChildrenAtDepthZero = children != null } // Render both children and value to show all content return ( @@ -130,6 +131,8 @@ describe('Nested Marks Rendering', () => { expect(container.textContent).toContain('before') expect(container.textContent).toContain('after') expect(container.textContent).toContain('nested') + // Verify that root mark with children received them + expect(hasChildrenAtDepthZero).toBe(true) }) }) diff --git a/packages/tests/integrations/stories.spec.tsx b/packages/tests/integrations/stories.spec.tsx index a4fb1be1..98c64674 100644 --- a/packages/tests/integrations/stories.spec.tsx +++ b/packages/tests/integrations/stories.spec.tsx @@ -1,4 +1,3 @@ -/// import '@testing-library/jest-dom' import {render} from '@testing-library/react' import {describe, expect, it} from 'vitest' diff --git a/packages/tests/template.ts b/packages/tests/template.ts index eb110d9a..66249878 100644 --- a/packages/tests/template.ts +++ b/packages/tests/template.ts @@ -1,9 +1,8 @@ -/// import {describe, it} from 'vitest' //Types: Utility, Component, Hook, etc. describe(`[Type]: [name of tested]`, () => { - it('should do this thing', () => {}) + it.todo('should do this thing', () => {}) - it('does this thing', () => {}) + it.todo('does this thing', () => {}) })