chore: Remove console.log left in code and added eslint rule to prevent it happening again
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import * as Sentry from "@sentry/react";
|
||||
import invariant from "invariant";
|
||||
import { NodeSelection } from "prosemirror-state";
|
||||
import { EditorView } from "prosemirror-view";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
@@ -43,10 +44,10 @@ const insertFiles = function (
|
||||
onShowToast,
|
||||
} = options;
|
||||
|
||||
if (!uploadFile) {
|
||||
console.warn("uploadFile callback must be defined to handle uploads.");
|
||||
return;
|
||||
}
|
||||
invariant(
|
||||
uploadFile,
|
||||
"uploadFile callback must be defined to handle uploads."
|
||||
);
|
||||
|
||||
// okay, we have some dropped files and a handler – lets stop this
|
||||
// event going any further up the stack
|
||||
|
||||
@@ -85,7 +85,6 @@ function getNewState({
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
const errorNode = document.getElementById(
|
||||
"d" + "mermaid-diagram-" + diagramId
|
||||
);
|
||||
|
||||
@@ -12,30 +12,26 @@ export default class Suggestion extends Extension {
|
||||
return [new SuggestionsMenuPlugin(this.editor, this.options)];
|
||||
}
|
||||
|
||||
inputRules = (_options: { type: NodeType; schema: Schema }) => {
|
||||
console.log(this.name, this.options.openRegex);
|
||||
|
||||
return [
|
||||
new InputRule(this.options.openRegex, (state, match) => {
|
||||
if (
|
||||
match &&
|
||||
state.selection.$from.parent.type.name === "paragraph" &&
|
||||
(!isInCode(state) || this.options.enabledInCode) &&
|
||||
(!isInTable(state) || this.options.enabledInTable)
|
||||
) {
|
||||
this.editor.events.emit(EventType.SuggestionsMenuOpen, {
|
||||
type: this.options.type,
|
||||
query: match[1],
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
new InputRule(this.options.closeRegex, (state, match) => {
|
||||
if (match) {
|
||||
this.editor.events.emit(EventType.SuggestionsMenuClose);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
];
|
||||
};
|
||||
inputRules = (_options: { type: NodeType; schema: Schema }) => [
|
||||
new InputRule(this.options.openRegex, (state, match) => {
|
||||
if (
|
||||
match &&
|
||||
state.selection.$from.parent.type.name === "paragraph" &&
|
||||
(!isInCode(state) || this.options.enabledInCode) &&
|
||||
(!isInTable(state) || this.options.enabledInTable)
|
||||
) {
|
||||
this.editor.events.emit(EventType.SuggestionsMenuOpen, {
|
||||
type: this.options.type,
|
||||
query: match[1],
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
new InputRule(this.options.closeRegex, (state, match) => {
|
||||
if (match) {
|
||||
this.editor.events.emit(EventType.SuggestionsMenuClose);
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ export default abstract class Mark extends Extension {
|
||||
return [];
|
||||
}
|
||||
|
||||
toMarkdown(state: MarkdownSerializerState, node: ProsemirrorNode) {
|
||||
console.error("toMarkdown not implemented", state, node);
|
||||
toMarkdown(_state: MarkdownSerializerState, _node: ProsemirrorNode) {
|
||||
throw new Error("toMarkdown not implemented");
|
||||
}
|
||||
|
||||
parseMarkdown(): TokenConfig | void {
|
||||
|
||||
@@ -37,8 +37,8 @@ export default abstract class Node extends Extension {
|
||||
return {};
|
||||
}
|
||||
|
||||
toMarkdown(state: MarkdownSerializerState, node: ProsemirrorNode): void {
|
||||
console.error("toMarkdown not implemented", state, node);
|
||||
toMarkdown(_state: MarkdownSerializerState, _node: ProsemirrorNode) {
|
||||
throw new Error("toMarkdown not implemented");
|
||||
}
|
||||
|
||||
parseMarkdown(): TokenConfig | void {
|
||||
|
||||
Reference in New Issue
Block a user