From 76afb00631c820c30f83ae89f2f259a270d49d9b Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Sat, 30 Nov 2019 01:40:01 -0500 Subject: [PATCH] fix lint --- package.json | 2 +- packages/slate/src/interfaces/editor/queries/location.ts | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 368077403..eaa2ed63e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lint:eslint": "eslint \"./{packages,site}/**/*.{js,jsx,ts,tsx}\"", "lint:prettier": "prettier --list-different \"**/*.{css,md,js,jsx,json,ts,tsx}\"", "open": "open http://localhost:3000", - "release": "NODE_ENV=production yarn build:rollup && yarn test && lerna publish", + "release": "NODE_ENV=production yarn build:rollup && yarn test && yarn lint && lerna publish", "serve": "cd ./site && next", "start": "npm-run-all --parallel --print-label watch serve", "test": "mocha --require ./config/babel/register.cjs ./packages/*/test/index.js", diff --git a/packages/slate/src/interfaces/editor/queries/location.ts b/packages/slate/src/interfaces/editor/queries/location.ts index 810c5e7f5..8a1acbdaf 100644 --- a/packages/slate/src/interfaces/editor/queries/location.ts +++ b/packages/slate/src/interfaces/editor/queries/location.ts @@ -358,8 +358,8 @@ export const LocationQueries = { pass: ([n]) => Element.isElement(n) && editor.isVoid(n), }) - let universalMarks: Mark[] = [] - let distinctMarks: Mark[] = [] + const universalMarks: Mark[] = [] + const distinctMarks: Mark[] = [] let universalEntries: MarkEntry[] = [] let first = true @@ -372,10 +372,8 @@ export const LocationQueries = { return Mark.matches(entry[0], m) } } - debugger if (mode === 'universal') { - debugger if (first) { universalMarks.push(...node.marks) universalEntries = node.marks.map((m, i) => [m, i, node, path]) @@ -386,11 +384,9 @@ export const LocationQueries = { // PERF: If we're in universal mode and the eligible marks hits zero // it can never increase again, so we can exit early. if (universalMarks.length === 0) { - debugger return } - debugger for (let i = universalMarks.length - 1; i >= 0; i--) { const existing = universalMarks[i] @@ -428,7 +424,6 @@ export const LocationQueries = { // In universal mode, the marks are collected while iterating and we can // only be certain of which are universal when we've finished. if (mode === 'universal') { - debugger yield* universalEntries } },