mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Merge pull request #4112 from tridactyl/dependabot/npm_and_yarn/eslint-plugin-sonarjs-0.12.0
Bump eslint-plugin-sonarjs from 0.7.0 to 0.12.0
This commit is contained in:
commit
9b988e66a6
6 changed files with 40 additions and 52 deletions
|
@ -41,7 +41,7 @@
|
|||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint-plugin-jsdoc": "^39.2.9",
|
||||
"eslint-plugin-prefer-arrow": "^1.2.3",
|
||||
"eslint-plugin-sonarjs": "^0.7.0",
|
||||
"eslint-plugin-sonarjs": "^0.12.0",
|
||||
"geckodriver": "^3.0.1",
|
||||
"jasmine-fail-fast": "^2.0.1",
|
||||
"jest": "^25.5.4",
|
||||
|
|
|
@ -10,7 +10,10 @@
|
|||
|
||||
export function jack_in() {
|
||||
// chinese characters - taken from the unicode charset
|
||||
const chinese = "田由甲申甴电甶男甸甹町画甼甽甾甿畀畁畂畃畄畅畆畇畈畉畊畋界畍畎畏畐畑".split("")
|
||||
const chinese =
|
||||
"田由甲申甴电甶男甸甹町画甼甽甾甿畀畁畂畃畄畅畆畇畈畉畊畋界畍畎畏畐畑".split(
|
||||
"",
|
||||
)
|
||||
const colour = "#0F0" // green text
|
||||
rain(makeBlock(), chinese, colour)
|
||||
}
|
||||
|
@ -54,7 +57,7 @@ const clickY = []
|
|||
const clickDrag = []
|
||||
let ink
|
||||
|
||||
let eraser = false;
|
||||
let eraser = false
|
||||
export function eraser_toggle() {
|
||||
eraser = !eraser
|
||||
}
|
||||
|
@ -66,7 +69,7 @@ function addClick(x, y, dragging) {
|
|||
}
|
||||
|
||||
function redraw(context) {
|
||||
if(eraser) {
|
||||
if (eraser) {
|
||||
context.globalCompositeOperation = "destination-out"
|
||||
context.lineWidth = 18
|
||||
} else {
|
||||
|
@ -75,26 +78,26 @@ function redraw(context) {
|
|||
}
|
||||
context.strokeStyle = "#000000"
|
||||
context.lineJoin = "miter"
|
||||
for(let i=0; i < clickX.length; i++) {
|
||||
for (let i = 0; i < clickX.length; i++) {
|
||||
context.beginPath()
|
||||
if(clickDrag[i] && i){
|
||||
context.moveTo(clickX[i-1], clickY[i-1])
|
||||
if (clickDrag[i] && i) {
|
||||
context.moveTo(clickX[i - 1], clickY[i - 1])
|
||||
} else {
|
||||
context.moveTo(clickX[i]-1, clickY[i])
|
||||
context.moveTo(clickX[i] - 1, clickY[i])
|
||||
}
|
||||
context.lineTo(clickX[i], clickY[i])
|
||||
context.closePath()
|
||||
context.stroke()
|
||||
}
|
||||
}
|
||||
function handleDown(e, context){
|
||||
function handleDown(e, context) {
|
||||
ink = true
|
||||
addClick(e.pageX, e.pageY, false)
|
||||
redraw(context)
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
}
|
||||
function handleUp(e){
|
||||
function handleUp(e) {
|
||||
ink = false
|
||||
clickX.length = 0
|
||||
clickY.length = 0
|
||||
|
@ -103,9 +106,9 @@ function handleUp(e){
|
|||
e.preventDefault()
|
||||
}
|
||||
function handleMove(e, context) {
|
||||
if(ink){
|
||||
addClick(e.pageX, e.pageY, true);
|
||||
redraw(context);
|
||||
if (ink) {
|
||||
addClick(e.pageX, e.pageY, true)
|
||||
redraw(context)
|
||||
}
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
@ -118,20 +121,22 @@ function make_drawable(overlaydiv) {
|
|||
const context = c.getContext("2d")
|
||||
// making the canvas full screen
|
||||
c.height = document.documentElement.scrollHeight
|
||||
c.width = window.innerWidth*0.98 // workaround to fix canvas overflow
|
||||
c.width = window.innerWidth * 0.98 // workaround to fix canvas overflow
|
||||
c.style.touchAction = "none" // for pen tablet to work
|
||||
c.addEventListener("pointerdown", e=>handleDown(e,context))
|
||||
c.addEventListener("pointerdown", e => handleDown(e, context))
|
||||
c.addEventListener("pointerup", handleUp)
|
||||
c.addEventListener("pointermove", e=>handleMove(e,context))
|
||||
c.addEventListener("pointermove", e => handleMove(e, context))
|
||||
}
|
||||
|
||||
export function removeBlock() {
|
||||
Array.from(document.getElementsByClassName("_tridactyl_no_mouse_")).map((el: Element & { intid?: number | null}) => {
|
||||
if(typeof el.intid === "number") {
|
||||
clearInterval(el.intid)
|
||||
}
|
||||
el.remove()
|
||||
})
|
||||
Array.from(document.getElementsByClassName("_tridactyl_no_mouse_")).forEach(
|
||||
(el: Element & { intid?: number | null }) => {
|
||||
if (typeof el.intid === "number") {
|
||||
clearInterval(el.intid)
|
||||
}
|
||||
el.remove()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export const snow = () => rain(makeBlock(), ["❄"], "#FFF", 0.15)
|
||||
|
|
|
@ -114,8 +114,8 @@ export function getCommandlineFns(cmdline_state: {
|
|||
cmdline_state.clInput.value.substring(0, selectionStart) +
|
||||
" " +
|
||||
cmdline_state.clInput.value.substring(selectionEnd)
|
||||
cmdline_state.clInput.selectionStart = cmdline_state.clInput.selectionEnd =
|
||||
selectionStart + 1
|
||||
cmdline_state.clInput.selectionStart =
|
||||
cmdline_state.clInput.selectionEnd = selectionStart + 1
|
||||
}
|
||||
return cmdline_state.refresh_completions(
|
||||
cmdline_state.clInput.value,
|
||||
|
@ -148,10 +148,7 @@ export function getCommandlineFns(cmdline_state: {
|
|||
|
||||
const func = command.trim().split(/\s+/)[0]
|
||||
|
||||
if (func.length === 0 || func.startsWith("#")) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return !(func.length === 0 || func.startsWith("#"))
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -116,7 +116,7 @@ export class HintConfig implements HintOptions {
|
|||
let newOpenMode: undefined | OpenMode
|
||||
let newState: undefined | State
|
||||
|
||||
// eslint-disable-next-line sonarjs/max-switch-cases
|
||||
// eslint-disable-next-line sonarjs/max-switch-cases, sonarjs/no-nested-switch
|
||||
switch (flag) {
|
||||
case "br":
|
||||
// Equivalent to -qb, but deprecated
|
||||
|
|
24
src/perf.ts
24
src/perf.ts
|
@ -340,25 +340,11 @@ export class StatsFilter {
|
|||
|
||||
matches(entry: PerformanceEntry): boolean {
|
||||
const metricNameInfo = extractMetricName(entry.name)
|
||||
if (
|
||||
this.config.kind === "functionName" &&
|
||||
this.config.functionName !== metricNameInfo.functionName
|
||||
) {
|
||||
return false
|
||||
}
|
||||
if (
|
||||
this.config.kind === "ownerName" &&
|
||||
this.config.ownerName !== metricNameInfo.ownerName
|
||||
) {
|
||||
return false
|
||||
}
|
||||
if (
|
||||
this.config.kind === "eventType" &&
|
||||
this.config.eventType !== entry.entryType
|
||||
) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return !(
|
||||
(this.config.kind === "functionName" && this.config.functionName !== metricNameInfo.functionName) ||
|
||||
(this.config.kind === "ownerName" && this.config.ownerName !== metricNameInfo.ownerName) ||
|
||||
(this.config.kind === "eventType" && this.config.eventType !== entry.entryType)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2612,10 +2612,10 @@ eslint-plugin-prefer-arrow@^1.2.3:
|
|||
resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz#e7fbb3fa4cd84ff1015b9c51ad86550e55041041"
|
||||
integrity sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ==
|
||||
|
||||
eslint-plugin-sonarjs@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.7.0.tgz#2dbad45e03a6a4de687756b659e88bf3f977383f"
|
||||
integrity sha512-vi6zGkd5Eznc32AQlleWUOMrMeDiUih9wR7nPPfrDCyVRmwYNHIBRPZGv1EgXwELwaPghCSvoAoHoR7uSbBF/Q==
|
||||
eslint-plugin-sonarjs@^0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.12.0.tgz#03a160a58f179fde084135baec08656b59786b8c"
|
||||
integrity sha512-soxjK67hoYxO8hesKqXWN50GSM+oG2r35N5WnAMehetahO6zoVpv3HZbdziP0jYWNopEe6te/BFUZOYAZI+qhg==
|
||||
|
||||
eslint-scope@^5.1.1:
|
||||
version "5.1.1"
|
||||
|
|
Loading…
Add table
Reference in a new issue