Refactoring based on LGTM (#1635)

* Refactoring based on LGTM

* Fixed jsdoc/no-undefined-types

Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
This commit is contained in:
Tomoyuki Hata 2021-04-09 03:32:49 +09:00 committed by GitHub
parent a88dc8e30b
commit 9cdda110da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 16 deletions

View file

@ -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": {

View file

@ -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

View file

@ -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';

View file

@ -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';
/**

View file

@ -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;

View file

@ -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';

View file

@ -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';

View file

@ -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';