Skip to content

Commit

Permalink
fixed prettier and eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
forgodtosave committed Jul 1, 2023
1 parent 1f63f2f commit c01d684
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion dev-dist/registerSW.js

This file was deleted.

6 changes: 2 additions & 4 deletions src/plugins/Codemirror/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"extensions": ["ts"],
"node-option": [
"loader=ts-node/esm"
]
}
"node-option": ["loader=ts-node/esm"]
}
16 changes: 8 additions & 8 deletions src/plugins/Codemirror/mochaFileTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function getLineNumber(text: string, index: number) {
}

export function fileTests(file: string, fileName: string, onlyNoError = false, mayIgnore = defaultIgnore) {
let caseExpr = /\s*#[ \t]*(.*)(?:\r\n|\r|\n)([^]*?)==+>([^]*?)(?:$|(?:\r\n|\r|\n)+(?=#))/gy
let tests: {
const caseExpr = /\s*#[ \t]*(.*)(?:\r\n|\r|\n)([^]*?)==+>([^]*?)(?:$|(?:\r\n|\r|\n)+(?=#))/gy
const tests: {
name: string
text: string
expected: string
Expand Down Expand Up @@ -60,12 +60,12 @@ export function fileTests(file: string, fileName: string, onlyNoError = false, m
})
} else {
for (;;) {
let m = caseExpr.exec(file)
const m = caseExpr.exec(file)
if (!m) throw new Error(`Unexpected file format in ${fileName} around\n\n${toLineContext(file, lastIndex)}`)

let text = m[2]
let expected = m[3].trim()
let [, name, configStr] = /(.*?)(\{.*?\})?$/.exec(m[1])!
const text = m[2]
const expected = m[3].trim()
const [, name, configStr] = /(.*?)(\{.*?\})?$/.exec(m[1])!

if (expected == 'error') {
tests.push({
Expand All @@ -85,8 +85,8 @@ export function fileTests(file: string, fileName: string, onlyNoError = false, m
},
})
} else {
let config = configStr ? JSON.parse(configStr) : null
let strict = !/⚠|\.\.\./.test(expected)
const config = configStr ? JSON.parse(configStr) : null
const strict = !/⚠|\.\.\./.test(expected)
tests.push({
name,
text,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/Codemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"import": "./dist/klipperCfgParser.es.js",
"require": "./dist/klipperCfgParser.cjs"
}
}
}

0 comments on commit c01d684

Please sign in to comment.