mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-14 03:03:58 +02:00
fix lint
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
"lint:eslint": "eslint \"./{packages,site}/**/*.{js,jsx,ts,tsx}\"",
|
"lint:eslint": "eslint \"./{packages,site}/**/*.{js,jsx,ts,tsx}\"",
|
||||||
"lint:prettier": "prettier --list-different \"**/*.{css,md,js,jsx,json,ts,tsx}\"",
|
"lint:prettier": "prettier --list-different \"**/*.{css,md,js,jsx,json,ts,tsx}\"",
|
||||||
"open": "open http://localhost:3000",
|
"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",
|
"serve": "cd ./site && next",
|
||||||
"start": "npm-run-all --parallel --print-label watch serve",
|
"start": "npm-run-all --parallel --print-label watch serve",
|
||||||
"test": "mocha --require ./config/babel/register.cjs ./packages/*/test/index.js",
|
"test": "mocha --require ./config/babel/register.cjs ./packages/*/test/index.js",
|
||||||
|
@@ -358,8 +358,8 @@ export const LocationQueries = {
|
|||||||
pass: ([n]) => Element.isElement(n) && editor.isVoid(n),
|
pass: ([n]) => Element.isElement(n) && editor.isVoid(n),
|
||||||
})
|
})
|
||||||
|
|
||||||
let universalMarks: Mark[] = []
|
const universalMarks: Mark[] = []
|
||||||
let distinctMarks: Mark[] = []
|
const distinctMarks: Mark[] = []
|
||||||
let universalEntries: MarkEntry[] = []
|
let universalEntries: MarkEntry[] = []
|
||||||
let first = true
|
let first = true
|
||||||
|
|
||||||
@@ -372,10 +372,8 @@ export const LocationQueries = {
|
|||||||
return Mark.matches(entry[0], m)
|
return Mark.matches(entry[0], m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debugger
|
|
||||||
|
|
||||||
if (mode === 'universal') {
|
if (mode === 'universal') {
|
||||||
debugger
|
|
||||||
if (first) {
|
if (first) {
|
||||||
universalMarks.push(...node.marks)
|
universalMarks.push(...node.marks)
|
||||||
universalEntries = node.marks.map((m, i) => [m, i, node, path])
|
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
|
// PERF: If we're in universal mode and the eligible marks hits zero
|
||||||
// it can never increase again, so we can exit early.
|
// it can never increase again, so we can exit early.
|
||||||
if (universalMarks.length === 0) {
|
if (universalMarks.length === 0) {
|
||||||
debugger
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
debugger
|
|
||||||
for (let i = universalMarks.length - 1; i >= 0; i--) {
|
for (let i = universalMarks.length - 1; i >= 0; i--) {
|
||||||
const existing = universalMarks[i]
|
const existing = universalMarks[i]
|
||||||
|
|
||||||
@@ -428,7 +424,6 @@ export const LocationQueries = {
|
|||||||
// In universal mode, the marks are collected while iterating and we can
|
// In universal mode, the marks are collected while iterating and we can
|
||||||
// only be certain of which are universal when we've finished.
|
// only be certain of which are universal when we've finished.
|
||||||
if (mode === 'universal') {
|
if (mode === 'universal') {
|
||||||
debugger
|
|
||||||
yield* universalEntries
|
yield* universalEntries
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user