Skip to content

Commit

Permalink
refactor: 💡 remove unnessesay eslint comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed Sep 12, 2022
1 parent 1f8c345 commit f695853
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions packages/utils/src/factory/create-mark.ts
Expand Up @@ -67,12 +67,11 @@ export const createMark = <SupportedKeys extends string = string, Options extend

const { id, commands, remarkPlugins, schema, inputRules, shortcuts, prosePlugins, view } = plugin;

const viewOption = options?.view;

const pluginOptions = {
...(options || {}),
view: options?.view
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
(ctx: Ctx) => ({ [id]: options!.view!(ctx) })
: undefined,
view: viewOption ? (ctx: Ctx) => ({ [id]: viewOption(ctx) }) : undefined,
};

pipelineCtx.set(idPipeCtx, id);
Expand Down
7 changes: 3 additions & 4 deletions packages/utils/src/factory/create-node.ts
Expand Up @@ -65,12 +65,11 @@ export const createNode = <SupportedKeys extends string = string, Options extend

const { id, commands, remarkPlugins, schema, inputRules, shortcuts, prosePlugins, view } = plugin;

const viewOption = options?.view;

const pluginOptions = {
...(options || {}),
view: options?.view
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
(ctx: Ctx) => ({ [id]: options!.view!(ctx) })
: undefined,
view: viewOption ? (ctx: Ctx) => ({ [id]: viewOption(ctx) }) : undefined,
};

pipelineCtx.set(idPipeCtx, id);
Expand Down

1 comment on commit f695853

@vercel
Copy link

@vercel vercel bot commented on f695853 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.