Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring based on LGTM #1635

Merged
merged 3 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 2.20.1

- `Refactoring` — Refactoring based on LGTM [#1577](https://github.com/codex-team/editor.js/issues/1577).

### 2.20.0

- `New` — [Block Tunes API](block-tunes.md) added
Expand Down
4 changes: 1 addition & 3 deletions src/components/block/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {
BlockAPI as BlockAPIInterface,
BlockTool as IBlockTool,
BlockToolConstructable,
BlockToolData,
BlockTune as IBlockTune,
SanitizerConfig,
ToolConfig,
ToolSettings
ToolConfig
} from '../../../types';

import { SavedData } from '../../../types/data-formats';
Expand Down
2 changes: 1 addition & 1 deletion src/components/inline-tools/inline-tool-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SelectionUtils from '../selection';

import $ from '../dom';
import * as _ from '../utils';
import { API, InlineTool, SanitizerConfig } from '../../../types';
import { InlineTool, SanitizerConfig } from '../../../types';
import { Notifier, Toolbar, I18n } from '../../../types/api';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/modules/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export default class Caret extends Module {
* @returns {boolean}
*/
public navigateNext(): boolean {
const { BlockManager, Tools } = this.Editor;
const { BlockManager } = this.Editor;
const { currentBlock, nextContentfulBlock } = BlockManager;
const { nextInput } = currentBlock;
const isAtEnd = this.isAtEnd;
Expand Down Expand Up @@ -531,7 +531,7 @@ export default class Caret extends Module {
* If there is no child node, append empty one
*/
if (fragment.childNodes.length === 0) {
fragment.appendChild(new Text(''));
fragment.appendChild(new Text());
}

const lastChild = fragment.lastChild;
Expand Down
1 change: 0 additions & 1 deletion src/components/modules/toolbar/conversion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Module from '../../__module';
import $ from '../../dom';
import { BlockToolConstructable } from '../../../../types';
import * as _ from '../../utils';
import { SavedData } from '../../../../types/data-formats';
import Flipper from '../../flipper';
Expand Down
1 change: 0 additions & 1 deletion src/components/modules/toolbar/toolbox.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Module from '../../__module';
import $ from '../../dom';
import * as _ from '../../utils';
import { BlockToolConstructable } from '../../../../types';
import Flipper from '../../flipper';
import { BlockToolAPI } from '../../block';
import I18n from '../../i18n';
Expand Down
7 changes: 1 addition & 6 deletions src/components/modules/tools.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import Paragraph from '../../tools/paragraph/dist/bundle';
import Module from '../__module';
import * as _ from '../utils';
import {
EditorConfig,
Tool,
ToolConstructable,
ToolSettings
} from '../../../types';
import { ToolConstructable, ToolSettings } from '../../../types';
import BoldInlineTool from '../inline-tools/inline-tool-bold';
import ItalicInlineTool from '../inline-tools/inline-tool-italic';
import LinkInlineTool from '../inline-tools/inline-tool-link';
Expand Down