Skip to content

Commit

Permalink
Resolve lint and type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Sep 24, 2020
1 parent 499eb04 commit 38f3e04
Show file tree
Hide file tree
Showing 11 changed files with 190 additions and 205 deletions.
1 change: 0 additions & 1 deletion packages/@remirror/core-utils/src/command-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
NodeType,
NodeTypeParameter,
ProsemirrorAttributes,
ProsemirrorCommandFunction,
RangeParameter,
Selection,
Transaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
OptionalProsemirrorNodeParameter,
PosParameter,
PredicateParameter,
ProsemirrorAttributes,
ProsemirrorNodeParameter,
} from '@remirror/core-types';

Expand Down
2 changes: 1 addition & 1 deletion packages/@remirror/core/src/builtins/helpers-extension.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorConstant, ExtensionPriority } from '@remirror/core-constants';
import { entries, invariant, object } from '@remirror/core-helpers';
import { entries, object } from '@remirror/core-helpers';
import type { AnyFunction, EmptyShape, ProsemirrorAttributes, Value } from '@remirror/core-types';
import { isMarkActive, isNodeActive } from '@remirror/core-utils';

Expand Down
3 changes: 1 addition & 2 deletions packages/@remirror/extension-bidi/src/bidi-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class BidiExtension extends PlainExtension<BidiOptions> {
update: () => {
const shouldUpdate = this.getPluginState<boolean>();
const state = this.store.getState();
const commands = this.store.getCommands();
const { autoUpdate, excludeNodes } = this.options;

if (!shouldUpdate || !autoUpdate) {
Expand All @@ -128,7 +127,7 @@ export class BidiExtension extends PlainExtension<BidiOptions> {
}

this.#ignoreNextUpdate = true;
commands.updateNodeAttributes(pos, { ...node.attrs, dir });
this.store.commands.updateNodeAttributes(pos, { ...node.attrs, dir });
},
}),
props: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class CodeBlockExtension extends NodeExtension<CodeBlockOptions> {
},

[this.options.keyboardShortcut]: ({ tr }) => {
const commands = this.store.getCommands();
const commands = this.store.commands;

if (!isNodeActive({ type: this.type, state: tr })) {
return false;
Expand Down
3 changes: 1 addition & 2 deletions packages/@remirror/extension-emoji/src/emoji-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ export class EmojiExtension extends PlainExtension<EmojiOptions> {
? this.frequentlyUsed
: sortEmojiMatches(query.full, this.options.maxResults);

const { getCommands } = this.store;
const create = getCommands().insertEmojiByObject;
const create = this.store.commands.insertEmojiByObject;

const command = (emoji: EmojiObject, skinVariation?: SkinVariation) => {
invariant(emoji, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class HardBreakExtension extends NodeExtension {

createKeymap(): KeyBindings {
const command = chainCommands(convertCommand(exitCode), () => {
this.store.getCommands().insertHardBreak();
this.store.commands.insertHardBreak();
return true;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class MentionAtomExtension extends NodeExtension<MentionAtomOptions> {
...matcher,
onChange: (parameter) => {
const { name, range } = parameter;
const { createMentionAtom } = this.store.getCommands();
const { createMentionAtom } = this.store.commands;

function command(attrs: Omit<MentionAtomNodeAttributes, 'name'>) {
createMentionAtom({ name, range }, attrs);
Expand Down
8 changes: 4 additions & 4 deletions packages/@remirror/extension-search/src/search-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class SearchExtension extends PlainExtension<SearchOptions> {
return false;
}

const { clearSearch } = this.store.getCommands();
const { clearSearch } = this.store.commands;
clearSearch();

return true;
Expand All @@ -232,7 +232,7 @@ export class SearchExtension extends PlainExtension<SearchOptions> {
searchTerm = this.#searchTerm;
}

const { find } = this.store.getCommands();
const { find } = this.store.commands;
find(searchTerm, direction);

return true;
Expand Down Expand Up @@ -316,7 +316,7 @@ export class SearchExtension extends PlainExtension<SearchOptions> {
const { from, to } = result;

dispatch(tr.insertText(replacement, from, to));
const { findNext } = this.store.getCommands();
const { findNext } = this.store.commands;
findNext();

return true;
Expand Down Expand Up @@ -361,7 +361,7 @@ export class SearchExtension extends PlainExtension<SearchOptions> {

dispatch(tr);

const { find } = this.store.getCommands();
const { find } = this.store.commands;
find(this.#searchTerm);

return true;
Expand Down

0 comments on commit 38f3e04

Please sign in to comment.