Refactoring based on ESLint (#1637)

* Refactoring based on ESLint

* Update .eslintrc

Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
This commit is contained in:
Tomoyuki Hata 2021-04-09 04:53:11 +09:00 committed by GitHub
parent 14acef136c
commit d5217067a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 15 deletions

View file

@ -9,6 +9,7 @@
"import/no-duplicates": ["warn"],
"@typescript-eslint/triple-slash-reference": ["off"],
"jsdoc/no-undefined-types": ["warn", {"definedTypes": [
"ConstructorOptions",
"API",
"BlockToolConstructable",
"EditorConfig",

View file

@ -8,6 +8,7 @@
- `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).
- `Refactoring` — Refactoring based on ESLint [#1636](https://github.com/codex-team/editor.js/issues/1636).
### 2.20.0

View file

@ -92,9 +92,8 @@ export default class Module<T extends ModuleNodes = {}> {
/**
* @class
* @param {object} moduleConfiguration - Module Configuration
* @param {EditorConfig} moduleConfiguration.config - Editor's config
* @param {EventsDispatcher} moduleConfiguration.eventsDispatcher - Editor's event dispatcher
*
* @param {ModuleConfig} - Module config
*/
constructor({ config, eventsDispatcher }: ModuleConfig) {
if (new.target === Module) {

View file

@ -107,15 +107,14 @@ export default class Saver extends Module {
return;
}
const output: any = {
const output = {
type: tool,
data,
...!_.isEmpty(tunes) && {
tunes,
},
};
if (!_.isEmpty(tunes)) {
output.tunes = tunes;
}
blocks.push(output);
});

View file

@ -175,13 +175,7 @@ export default abstract class BaseTool<Type extends Tool = Tool> {
/**
* @class
*
* @param name - Tool name
* @param constructable - Tool constructable blueprint
* @param config - user specified Tool config
* @param api - EditorJS API module
* @param defaultTool - default Tool name
* @param isInternal - is current Tool internal
* @param defaultPlaceholder - default user specified placeholder
* @param {ConstructorOptions} - Constructor options
*/
constructor({
name,
@ -278,5 +272,6 @@ export default abstract class BaseTool<Type extends Tool = Tool> {
*
* @param args
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public abstract create(...args: any[]): Type;
}