Skip to content

Commit da4fe11

Browse files
committed
lint fix
1 parent fabb939 commit da4fe11

3 files changed

Lines changed: 24 additions & 24 deletions

File tree

src/acl/access-groups.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export class AccessGroups {
264264
: 'No RDF type was detected for this URI.'
265265
const error =
266266
`Error: Failed to add access target: ${uri} is not a recognized ACL target type.` +
267-
` Expected one of: vcard:WebID, vcard:Group, foaf:Person, foaf:Agent, solid:AppProvider, solid:AppProviderClass, or recognized ACL classes.` +
267+
' Expected one of: vcard:WebID, vcard:Group, foaf:Person, foaf:Agent, solid:AppProvider, solid:AppProviderClass, or recognized ACL classes.' +
268268
' Hint: try dropping a WebID profile URI, a vcard:Group URI, or a web app origin.' +
269269
typeDetails
270270
debug.error(error)

src/pad.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class NotepadPart extends HTMLElement {
4646
* @param {NamedNode} author - The author of text being displayed
4747
* @returns {String} The CSS color generated, constrained to be light for a background color
4848
*/
49-
export function lightColorHash(author?: NamedNode): string {
49+
export function lightColorHash (author?: NamedNode): string {
5050
const hash = function (x) {
5151
return x.split('').reduce(function (a, b) {
5252
a = (a << 5) - a + b.charCodeAt(0)
@@ -66,7 +66,7 @@ export function lightColorHash(author?: NamedNode): string {
6666
* @param {NamedNode} me - person who is logged into the pod
6767
* @param {notepadOptions} options - the options that can be passed in consist of statusArea, exists
6868
*/
69-
export function notepad(
69+
export function notepad (
7070
dom: HTMLDocument,
7171
padDoc: NamedNode,
7272
subject: NamedNode,
@@ -164,7 +164,7 @@ export function notepad(
164164
const next: any = kb.any(chunk as any, PAD('next'))
165165
if (prev.sameTerm(subject) && next.sameTerm(subject)) {
166166
// Last one
167-
log("You can't delete the only line.")
167+
log('You can\'t delete the only line.')
168168
return
169169
}
170170

@@ -210,7 +210,7 @@ export function notepad(
210210
}, 1000)
211211
} else {
212212
log(' removePart FAILED ' + chunk + ': ' + errorMessage)
213-
log(" removePart was deleting :'" + del)
213+
log(' removePart was deleting :\'' + del)
214214
setPartStyle(part, 'color: black; background-color: #fdd;') // failed
215215
const res = response
216216
? (response as any).status
@@ -235,9 +235,9 @@ export function notepad(
235235
updater.update(del, ins as any, function (uri, ok, errorBody) {
236236
if (!ok) {
237237
log(
238-
"Indent change FAILED '" +
238+
'Indent change FAILED \'' +
239239
newIndent +
240-
"' for " +
240+
'\' for ' +
241241
padDoc +
242242
': ' +
243243
errorBody
@@ -351,11 +351,11 @@ export function notepad(
351351
if (old !== part.lastSent) {
352352
// Non-fatal: log a warning instead of throwing, to avoid crashing the pad UI.
353353
console.warn(
354-
"Out of order, last sent expected '" +
354+
'Out of order, last sent expected \'' +
355355
old +
356-
"' but found '" +
356+
'\' but found \'' +
357357
part.lastSent +
358-
"'"
358+
'\''
359359
)
360360
}
361361
}
@@ -380,11 +380,11 @@ export function notepad(
380380
log(
381381
' patch FAILED ' +
382382
(xhr as any).status +
383-
" for '" +
383+
' for \'' +
384384
old +
385-
"' -> '" +
385+
'\' -> \'' +
386386
newOne +
387-
"': " +
387+
'\': ' +
388388
errorBody
389389
)
390390
if ((xhr as any).status === 409) {
@@ -421,7 +421,7 @@ export function notepad(
421421
} else {
422422
clearStatus(true) // upstream
423423
setPartStyle(part) // synced
424-
log(" Patch ok '" + old + "' -> '" + newOne + "' ")
424+
log(' Patch ok \'' + old + '\' -> \'' + newOne + '\' ')
425425

426426
if (part.state === 4) {
427427
// delete me
@@ -440,10 +440,10 @@ export function notepad(
440440
})
441441
}
442442

443-
part.addEventListener('input', function inputChangeListener(_event) {
443+
part.addEventListener('input', function inputChangeListener (_event) {
444444
// debug.log("input changed "+part.value);
445445
setPartStyle(part, undefined, true) // grey out - not synced
446-
log('Input event state ' + part.state + " value '" + part.value + "'")
446+
log('Input event state ' + part.state + ' value \'' + part.value + '\'')
447447
switch (part.state) {
448448
case 3: // being deleted
449449
return
@@ -498,7 +498,7 @@ export function notepad(
498498
addListeners(part, chunk)
499499
} else {
500500
setPartStyle(part, 'color: #222; background-color: #fff')
501-
log("Note can't add listeners - not logged in")
501+
log('Note can\'t add listeners - not logged in')
502502
}
503503
return part
504504
}
@@ -584,7 +584,7 @@ export function notepad(
584584
const consistencyCheck = function () {
585585
const found: { [uri: string]: boolean } = {}
586586
let failed = 0
587-
function complain2(msg) {
587+
function complain2 (msg) {
588588
complain(msg)
589589
failed++
590590
}
@@ -831,7 +831,7 @@ export function notepad(
831831
*/
832832

833833
// @ignore exporting this only for the unit test
834-
export function getChunks(subject: NamedNode, kb: IndexedFormula) {
834+
export function getChunks (subject: NamedNode, kb: IndexedFormula) {
835835
const chunks: any[] = []
836836
for (
837837
let chunk: any = kb.the(subject, PAD('next'));
@@ -847,7 +847,7 @@ export function getChunks(subject: NamedNode, kb: IndexedFormula) {
847847
* Encode content to be put in XML or HTML elements
848848
*/
849849
// @ignore exporting this only for the unit test
850-
export function xmlEncode(str) {
850+
export function xmlEncode (str) {
851851
return str.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
852852
}
853853

@@ -856,7 +856,7 @@ export function xmlEncode(str) {
856856
* @param { } pad - the notepad
857857
* @param {store} pad - the data store
858858
*/
859-
export function notepadToHTML(pad: any, kb: IndexedFormula) {
859+
export function notepadToHTML (pad: any, kb: IndexedFormula) {
860860
const chunks = getChunks(pad, kb)
861861
let html = '<html>\n <head>\n'
862862
const title = kb.anyValue(pad, ns.dct('title'))
@@ -866,13 +866,13 @@ export function notepadToHTML(pad: any, kb: IndexedFormula) {
866866
html += ' </head>\n <body>\n'
867867
let level = 0
868868

869-
function increaseLevel(indent) {
869+
function increaseLevel (indent) {
870870
for (; level < indent; level++) {
871871
html += '<ul>\n'
872872
}
873873
}
874874

875-
function decreaseLevel(indent) {
875+
function decreaseLevel (indent) {
876876
for (; level > indent; level--) {
877877
html += '</ul>\n'
878878
}

test/helpers/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ global.WritableStream = WritableStream
2121

2222
// Node provides MessagePort via worker_threads; jsdom/undici expects it in global scope
2323
try {
24-
// eslint-disable-next-line @typescript-eslint/no-var-requires
24+
// Intentionally require worker_threads in Jest setup to expose MessagePort globals.
2525
const { MessageChannel, MessagePort } = require('worker_threads')
2626
global.MessageChannel = MessageChannel
2727
global.MessagePort = MessagePort

0 commit comments

Comments
 (0)