Skip to content

Commit 17aaac2

Browse files
committed
lint
1 parent dc2f217 commit 17aaac2

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

packages/core/eslint.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ export default [
2121
],
2222
ignoreTypeImport: true,
2323
}],
24+
// @todo: remove when we setup eslint to correctly handle the types
25+
'@typescript-eslint/no-unsafe-call': 'off',
26+
'@typescript-eslint/no-unsafe-member-access': 'off',
27+
'@typescript-eslint/no-unsafe-assignment': 'off',
28+
'@typescript-eslint/no-unsafe-argument': 'off',
2429
},
2530
},
2631
];

packages/core/src/api/BlocksAPI.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export class BlocksAPI implements BlocksApiInterface {
5959
): void {
6060
this.#blocksManager.insert({
6161
type,
62-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6362
data,
6463
index,
6564
replace,

packages/core/src/components/BlockManager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ export class BlocksManager {
119119
newIndex = this.#model.length + (replace ? 0 : 1);
120120
}
121121

122-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
123122
this.#model.addBlock(this.#config.userId, {
124123
...data,
125124
name: type,

packages/core/src/components/SelectionManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class SelectionManager {
5959
this.#eventBus.addEventListener(`core:${CoreEventType.ToolLoaded}`, (event: ToolLoadedCoreEvent) => {
6060
const { tool } = event.detail;
6161

62-
if (!tool.isInline()) {
62+
if ('isInline' in tool && tool.isInline() === false) {
6363
return;
6464
}
6565

packages/core/src/tools/ToolsFactory.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export class ToolsFactory {
4848
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4949
api: any
5050
) {
51-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5251
this.api = api;
5352
this.config = config;
5453
this.editorConfig = editorConfig;
@@ -64,7 +63,6 @@ export class ToolsFactory {
6463
const Constructor = this.getConstructor(constructable);
6564
// const isTune = constructable[InternalTuneSettings.IsTune];
6665

67-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
6866
return new Constructor({
6967
name,
7068
constructable,

packages/dom-adapters/src/BlockToolAdapter/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import {
2020
isNonTextInput
2121
} from '../utils/index.js';
2222
import { InputType } from './types/InputType.js';
23-
import { BeforeInputUIEventName, type BlockToolAdapter as BlockToolAdapterInterface, type CoreConfig } from '@editorjs/sdk';
23+
import { type BlockToolAdapter as BlockToolAdapterInterface, type CoreConfig } from '@editorjs/sdk';
2424
import type { FormattingAdapter } from '../FormattingAdapter/index.js';
25-
import type { BeforeInputUIEvent, EventBus } from '@editorjs/sdk';
25+
import type { EventBus } from '@editorjs/sdk';
2626

2727
/**
2828
* BlockToolAdapter is using inside Block tools to connect browser DOM elements to the model

packages/ui/src/Toolbox/Toolbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class ToolboxUI implements EditorjsPlugin {
5555
this.#eventBus.addEventListener(`core:${CoreEventType.ToolLoaded}`, (event: ToolLoadedCoreEvent) => {
5656
const { tool } = event.detail;
5757

58-
if (tool.isBlock()) {
58+
if ('isBlock' in tool && tool.isBlock()) {
5959
this.addTool(tool);
6060
}
6161
});

0 commit comments

Comments
 (0)