mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-10 01:29:49 +02:00
add eslint rule consistent-type-definations
This commit is contained in:
@@ -53,6 +53,7 @@ module.exports = {
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/no-unused-vars': 'warn',
|
||||
'@typescript-eslint/consistent-type-definitions': 'warn',
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error',
|
||||
{
|
||||
|
@@ -11,8 +11,9 @@ import {
|
||||
setDiagramTitle,
|
||||
} from '../common/commonDb.js';
|
||||
import { ImperativeState } from '../../utils/imperativeState.js';
|
||||
import type { Actor, AddMessageParams, Box, Message } from './types.js';
|
||||
import type { Actor, AddMessageParams, Box, Message, Note } from './types.js';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
type State = {
|
||||
prevActor?: string;
|
||||
actors: Record<string, Actor>;
|
||||
@@ -20,7 +21,7 @@ type State = {
|
||||
destroyedActors: Record<string, number>;
|
||||
boxes: Box[];
|
||||
messages: Message[];
|
||||
notes: unknown[];
|
||||
notes: Note[];
|
||||
sequenceNumbersEnabled: boolean;
|
||||
wrapEnabled?: boolean;
|
||||
currentBox?: Box;
|
||||
@@ -343,7 +344,7 @@ export const addNote = function (
|
||||
placement: Message['placement'],
|
||||
message: { text: string; wrap?: boolean }
|
||||
) {
|
||||
const note = {
|
||||
const note: Note = {
|
||||
actor: actor,
|
||||
placement: placement,
|
||||
message: message.text,
|
||||
|
@@ -83,3 +83,10 @@ export interface AddMessageParams {
|
||||
|
||||
activate: boolean;
|
||||
}
|
||||
|
||||
export interface Note {
|
||||
actor: { actor: string };
|
||||
placement: Message['placement'];
|
||||
message: string;
|
||||
wrap: boolean;
|
||||
}
|
||||
|
Reference in New Issue
Block a user