From 239aaf6fb03dc15cfbf2d577d09e3137d5aebc81 Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Wed, 3 Jun 2020 11:03:51 +0300 Subject: [PATCH] lint code --- src/components/block/index.ts | 12 ++++++------ src/components/flipper.ts | 2 -- src/components/modules/blockManager.ts | 21 ++++++++++++--------- src/components/tools/stub/index.ts | 7 ++++--- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/components/block/index.ts b/src/components/block/index.ts index 836c6fb1..9e810c3c 100644 --- a/src/components/block/index.ts +++ b/src/components/block/index.ts @@ -193,12 +193,12 @@ export default class Block { private readonly blockAPI: BlockAPIInterface; /** - * @class - * @param {string} tool - Tool name that passed on initialization - * @param {BlockToolData} data - Tool's initial data - * @param {BlockToolConstructable} Tool — Tool's class - * @param {ToolSettings} settings - default tool's config - * @param {ApiModule} api - Editor API module for pass it to the Block Tunes + * @param {object} options - block constructor options + * @param {string} options.name - Tool name that passed on initialization + * @param {BlockToolData} options.data - Tool's initial data + * @param {BlockToolConstructable} options.Tool — Tool's class + * @param {ToolSettings} options.settings - default tool's config + * @param {ApiModule} options.api - Editor API module for pass it to the Block Tunes */ constructor({ name, diff --git a/src/components/flipper.ts b/src/components/flipper.ts index dad0ddd6..dd632f40 100644 --- a/src/components/flipper.ts +++ b/src/components/flipper.ts @@ -65,8 +65,6 @@ export default class Flipper { private readonly activateCallback: (item: HTMLElement) => void; /** - * @class - * * @param {FlipperOptions} options - different constructing settings */ constructor(options: FlipperOptions) { diff --git a/src/components/modules/blockManager.ts b/src/components/modules/blockManager.ts index e4806d5b..2d52533c 100644 --- a/src/components/modules/blockManager.ts +++ b/src/components/modules/blockManager.ts @@ -204,8 +204,9 @@ export default class BlockManager extends Module { /** * Creates Block instance by tool name * - * @param {string} tool - tools passed in editor config {@link EditorConfig#tools} - * @param {BlockToolData} [data] - constructor params + * @param {object} options - block creation options + * @param {string} options.tool - tools passed in editor config {@link EditorConfig#tools} + * @param {BlockToolData} [options.data] - constructor params * * @returns {Block} */ @@ -228,11 +229,12 @@ export default class BlockManager extends Module { /** * Insert new block into _blocks * - * @param {string} tool — plugin name, by default method inserts initial block type - * @param {object} data — plugin data - * @param {number} index - index where to insert new Block - * @param {boolean} needToFocus - flag shows if needed to update current Block index - * @param {boolean} replace - flag shows if block by passed index should be replaced with inserted one + * @param {object} options - insert options + * @param {string} options.tool - plugin name, by default method inserts initial block type + * @param {object} options.data - plugin data + * @param {number} options.index - index where to insert new Block + * @param {boolean} options.needToFocus - flag shows if needed to update current Block index + * @param {boolean} options.replace - flag shows if block by passed index should be replaced with inserted one * * @returns {Block} */ @@ -274,8 +276,9 @@ export default class BlockManager extends Module { /** * Replace current working block * - * @param {string} tool — plugin name - * @param {BlockToolData} data — plugin data + * @param {object} options - replace options + * @param {string} options.tool — plugin name + * @param {BlockToolData} options.data — plugin data * * @returns {Block} */ diff --git a/src/components/tools/stub/index.ts b/src/components/tools/stub/index.ts index 2248d657..df6eb577 100644 --- a/src/components/tools/stub/index.ts +++ b/src/components/tools/stub/index.ts @@ -14,7 +14,7 @@ export default class Stub implements BlockTool { /** * Stub styles * - * @type {{wrapper: string; info: string; title: string; subtitle: string}} + * @type {{wrapper: string, info: string, title: string, subtitle: string}} */ private CSS = { wrapper: 'ce-stub', @@ -49,8 +49,9 @@ export default class Stub implements BlockTool { private readonly savedData: BlockToolData; /** - * @param data - stub tool data - * @param api - Editor.js API + * @param options - constructor options + * @param options.data - stub tool data + * @param options.api - Editor.js API */ constructor({ data, api }: BlockToolConstructorOptions) { this.api = api;