Skip to content
Snippets Groups Projects
Commit 94d4b457 authored by chris's avatar chris
Browse files

more eslint config

parent a4b700e1
No related branches found
No related tags found
1 merge request!135Code block
......@@ -26,6 +26,8 @@ eslint.rules = {
},
],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'class-methods-use-this': [1, { exceptMethods: ['run', 'enable'] }],
'react/prop-types': [
2,
{ ignore: ['children', 'className', 'onClick', 'theme'] },
......
import Tools from '../lib/Tools';
import { injectable } from 'inversify';
import { icons } from 'wax-prosemirror-components';
import { Commands } from 'wax-prosemirror-utilities';
import Tools from '../lib/Tools';
@injectable()
class CodeBlockTool extends Tools {
......
import Tools from "../../lib/Tools";
import { injectable } from "inversify";
import { Commands } from "wax-prosemirror-utilities";
import { injectable } from 'inversify';
import { Commands } from 'wax-prosemirror-utilities';
import Tools from '../../lib/Tools';
@injectable()
export default class Author extends Tools {
title = "Change to Author";
content = "Author";
class Author extends Tools {
title = 'Change to Author';
content = 'Author';
get run() {
return (state, dispatch) => {
Commands.setBlockType(state.config.schema.nodes.author, {
class: "author"
class: 'author',
})(state, dispatch);
};
}
......@@ -21,3 +21,5 @@ export default class Author extends Tools {
};
}
}
export default Author;
import Tools from "../../lib/Tools";
import { injectable } from "inversify";
import { Commands } from "wax-prosemirror-utilities";
import Tools from '../../lib/Tools';
import { injectable } from 'inversify';
import { Commands } from 'wax-prosemirror-utilities';
@injectable()
export default class EpigraphPoetry extends Tools {
title = "Change to Epigraph Poetry";
content = "Epigraph Poetry";
class EpigraphPoetry extends Tools {
title = 'Change to Epigraph Poetry';
content = 'Epigraph Poetry';
get run() {
return (state, dispatch) => {
Commands.setBlockType(state.config.schema.nodes.epigraphPoetry, {
class: "epigraph-poetry"
class: 'epigraph-poetry',
})(state, dispatch);
};
}
......@@ -18,8 +18,10 @@ export default class EpigraphPoetry extends Tools {
get enable() {
return state => {
return Commands.setBlockType(state.config.schema.nodes.epigraphPoetry)(
state
state,
);
};
}
}
export default EpigraphPoetry;
import React from "react";
import { v4 as uuidv4 } from "uuid";
import { isEmpty } from "lodash";
import { injectable, inject } from "inversify";
import { Button } from "wax-prosemirror-components";
import React from 'react';
import { v4 as uuidv4 } from 'uuid';
import { isEmpty } from 'lodash';
import { injectable, inject } from 'inversify';
import { Button } from 'wax-prosemirror-components';
@injectable()
export default class Tools {
title = "title";
content = "content";
class Tools {
title = 'title';
content = 'content';
_isDisplayed = true;
_isHiddenInToolGroup = false;
onlyOnMain = false;
config = {};
pmplugins = {};
constructor(@inject("Config") config, @inject("PmPlugins") pmplugins) {
constructor(@inject('Config') config, @inject('PmPlugins') pmplugins) {
this.config = config;
this.pmplugins = pmplugins;
}
......@@ -43,7 +43,7 @@ export default class Tools {
run: this.run,
enable: this.enable,
select: this.select,
onlyOnMain: this.onlyOnMain
onlyOnMain: this.onlyOnMain,
};
}
......@@ -79,3 +79,4 @@ export default class Tools {
return this._isHiddenInToolGroup;
}
}
export default Tools;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment