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 all commits
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
9 changes: 8 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
* Temporary suppress some errors. We need to fix them partially in next patches
*/
"import/no-duplicates": ["warn"],
"@typescript-eslint/triple-slash-reference": ["off"]
"@typescript-eslint/triple-slash-reference": ["off"],
"jsdoc/no-undefined-types": ["warn", {"definedTypes": [
"API",
"BlockToolConstructable",
"EditorConfig",
"Tool",
"ToolSettings"
]}]
},
"settings": {
"jsdoc": {
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

### 2.20.1


- `Fix` — Fix sanitisation problem with Inline Tools [#1631](https://github.com/codex-team/editor.js/issues/1631)
- `Refactoring` - The Sanitizer module is util now.
- `Refactoring` - Tooltip module is util now.
- `Refactoring` — Refactoring based on LGTM [#1577](https://github.com/codex-team/editor.js/issues/1577).

### 2.20.0

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
2 changes: 1 addition & 1 deletion src/components/modules/caret.ts
Original file line number Diff line number Diff line change
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, EditorConfig } from '../../../../types';
import Flipper from '../../flipper';
import { BlockToolAPI } from '../../block';
import I18n from '../../i18n';
Expand Down
8 changes: 1 addition & 7 deletions src/components/modules/tools.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import Paragraph from '../../tools/paragraph/dist/bundle';
import Module from '../__module';
import * as _ from '../utils';
import {
EditorConfig,
SanitizerConfig,
Tool,
ToolConstructable,
ToolSettings
} from '../../../types';
import { SanitizerConfig, 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