Skip to content

Commit 35dbdcc

Browse files
committed
fix lint errors
1 parent ccb1dea commit 35dbdcc

9 files changed

Lines changed: 34 additions & 56 deletions

File tree

src/acl/access-groups.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @packageDocumentation
55
*/
66

7-
import { fetcher, IndexedFormula, NamedNode, sym, UpdateManager } from 'rdflib'
7+
import { fetcher, IndexedFormula, NamedNode, sym } from 'rdflib'
88
import { ACLbyCombination, readACL } from './acl'
99
import widgets from '../widgets'
1010
import ns from '../ns'

src/header/headerHelpers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Copied from mashlib/src/global/metadata.ts
33
*/
44
import { NamedNode, sym } from 'rdflib'
5-
import { log } from '../debug'
65
import { styleMap } from './styleMap'
76
import { getClasses } from '../jss'
87

src/header/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { IndexedFormula, NamedNode, sym } from 'rdflib'
66
import { loginStatusBox, solidAuthClient } from '../authn/authn'
77
import { widgets } from '../widgets'
88
import { emptyProfile } from './empty-profile'
9-
import { throttle, getPod, addStyleClassToElement } from './headerHelpers'
10-
import { log } from '../debug'
11-
import { getClasses } from '../jss'
12-
import { styleMap } from './styleMap'
9+
import { addStyleClassToElement, getPod, throttle } from './headerHelpers'
1310

1411
// SolidAuthorization, SolidClam, and SolidSession was copied from mashlib/typings/solid-auth-client
1512
// access_token, client_id, id_token, at_hash had to be converted to camelcase for typescript compatibility

src/widgets/forms/fieldParams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ns from '../../ns'
2-
import { formHeadingColor, formHeadingStyle, commentStyle } from '../../style'
2+
import { commentStyle, formHeadingStyle } from '../../style'
33

44
export type FieldParamsObject = {
55
size?: number, // input element size attribute

test/unit/acl/acl.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
fixIndividualACL,
99
fixIndividualCardACL,
1010
getACL,
11-
getACLorDefault,
1211
getProspectiveHolder,
1312
loadUnionACL,
1413
makeACLGraph,
@@ -32,7 +31,8 @@ import {
3231
DEFAULT_RESOURCE_ACL,
3332
DEFAULT_RESOURCE_DOC,
3433
getAgentMapForAclWithAllAgents,
35-
getAgentMapForAclWithAllAgentsUsingDefaults, mocks, PROFILE
34+
getAgentMapForAclWithAllAgentsUsingDefaults,
35+
mocks
3636
} from './acl.mocks'
3737
import { loadTurtleIntoGraph } from '../helpers/loadTurtleIntoGraph'
3838
import { createGraphFromTurtle } from '../helpers/createGraphFromTurtle'
@@ -227,10 +227,6 @@ describe('getACL', () => {
227227
})
228228
})
229229

230-
describe('getACLorDefault', () => {
231-
232-
})
233-
234230
describe('getProspectiveHolder', () => {
235231
it('exists', () => {
236232
expect(getProspectiveHolder).toBeInstanceOf(Function)

test/unit/chat/bookmarks.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { silenceDebugMessages } from '../../helpers/setup'
2-
import { findBookmarkDocument, toggleBookmark, renderBookmarksButton } from '../../../src/chat/bookmarks'
2+
import { findBookmarkDocument, renderBookmarksButton, toggleBookmark } from '../../../src/chat/bookmarks'
33
import { NamedNode, Namespace } from 'rdflib'
44
import store from '../../../src/store'
55
import { clearStore } from '../helpers/clearStore'
@@ -68,7 +68,7 @@ describe('findBookmarkDocument', () => {
6868
store.add(pubReg2, ns.solid('forClass'), BOOK('Bookmark'), context.publicTypeIndex)
6969
store.add(pubReg2, ns.solid('instance'), bookmarksDoc3, context.publicTypeIndex)
7070

71-
const result = await findBookmarkDocument(context)
71+
await findBookmarkDocument(context)
7272
expect((window.alert as any).mock.calls.length).toEqual(1)
7373
expect((window.alert as any).mock.calls[0][0]).toMatchSnapshot()
7474
})
@@ -106,17 +106,15 @@ describe('findBookmarkDocument', () => {
106106
store.add(pubReg2, ns.solid('forClass'), BOOK('Bookmark'), context.publicTypeIndex)
107107
store.add(pubReg2, ns.solid('instance'), bookmarksDoc3, context.publicTypeIndex)
108108

109-
const result = await findBookmarkDocument(context)
109+
await findBookmarkDocument(context)
110110
expect((window.alert as any).mock.calls.length).toEqual(1)
111111
expect((window.alert as any).mock.calls[0][0]).toMatchSnapshot()
112112
})
113113
it('does not complains if you have one bookmark docs', async () => {
114114
const privReg = new NamedNode('http://example.com/privType.ttl#reg1')
115115
const pubReg1 = new NamedNode('http://example.com/pubType.ttl#reg1')
116-
const pubReg2 = new NamedNode('http://example.com/pubType.ttl#reg2')
117116
const bookmarksDoc1 = new NamedNode('http://example.com/bookmarks1.ttl')
118117
const bookmarksDoc2 = new NamedNode('http://example.com/bookmarks2.ttl')
119-
const bookmarksDoc3 = new NamedNode('http://example.com/bookmarks3.ttl')
120118
const context = {
121119
me: new NamedNode('http://example.com/profile/card#me'),
122120
publicProfile: new NamedNode('http://example.com/profile/card'),
@@ -140,7 +138,7 @@ describe('findBookmarkDocument', () => {
140138
store.add(pubReg1, ns.solid('forClass'), BOOK('Bookmark'), context.publicTypeIndex)
141139
store.add(pubReg1, ns.solid('instance'), bookmarksDoc2, context.publicTypeIndex)
142140

143-
const result = await findBookmarkDocument(context)
141+
await findBookmarkDocument(context)
144142
expect((window.alert as any).mock.calls.length).toEqual(0)
145143
})
146144
})

test/unit/helpers/loadTurtleFileIntoGraph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IndexedFormula, NamedNode, parse } from 'rdflib'
1+
import { IndexedFormula } from 'rdflib'
22
import { getFileContent } from './getFileContent'
33
import { loadTurtleIntoGraph } from './loadTurtleIntoGraph'
44

test/unit/style.test.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { silenceDebugMessages } from '../helpers/setup'
22
import {
3-
textInputStyle,
43
buttonStyle,
5-
textButtonStyle,
6-
iconStyle,
74
classIconStyle,
8-
messageBodyStyle,
9-
pendingeditModifier,
10-
highlightColor,
11-
signInButtonStyle,
125
formBorderColor,
136
formHeadingColor,
147
formTextInput,
15-
multilineTextInputStyle
8+
highlightColor,
9+
iconStyle,
10+
messageBodyStyle,
11+
multilineTextInputStyle,
12+
pendingeditModifier,
13+
signInButtonStyle,
14+
textInputStyle
1615
} from '../../src/style'
1716

1817
silenceDebugMessages()

test/unit/table.test.ts

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
import { silenceDebugMessages } from '../helpers/setup'
2-
import { JSDOM } from 'jsdom'
32
import renderTableViewPane from '../../src/table'
43

54
import store from '../../src/store'
6-
import { NamedNode, sym, parse, variable, Namespace, Query } from 'rdflib'
7-
const kb = store
5+
import { NamedNode, Namespace, parse, Query, sym, variable } from 'rdflib'
86

9-
// import * as $rdf from 'rdflib'
7+
const kb = store
108

119
silenceDebugMessages()
12-
const window = new JSDOM('<!DOCTYPE html><p>Hello world</p>').window
13-
const dom = window.document
1410

1511
const tableData = `@prefix : <https://example.com/tests#> .
1612
:Alice :age 21; :name "Alice"; :hobby "Fishing"; :dob 1999-07-04Z .
1713
:Bob :age 18; :name "Bob"; :hobby "Hockey"; :dob 2002-05-12Z .
1814
:Charlie :age 15; :name "Charlie"; :hobby "Gym"; :dob 2005-01-31Z .
1915
`
2016

21-
const tableQuery = ` PREFIX : <https://example.com/tests#>
22-
SELECT ?who, ?name WHERE { ?who :name ?name . }
23-
`
2417
const doc = sym('https://example.com/tests')
2518
parse(tableData, kb, doc.uri) // should be able to omit tcontent type and callback
2619
// const query = $rdf.SPARQLToQuery(tableQuery) // TypeError: $rdf.SPARQLToQuery is not a function
@@ -60,16 +53,14 @@ describe('renderTableViewPane', () => {
6053
expect(renderTableViewPane(document, tableOptions).innerHTML).toMatch(/.*<table.*person.*name.*age.*hobby.*/)
6154
})
6255
it('calls onDone', async () => {
63-
var result
6456
const onDone = jest.fn() // mock function
65-
const widget = renderTableViewPane(document, { query, onDone }).innerHTML
57+
const _ = renderTableViewPane(document, { query, onDone }).innerHTML
6658
await new Promise(resolve => setTimeout(resolve, 1000))
6759
expect(onDone).toHaveBeenCalled()
6860
})
6961
it('includes the data', async () => {
70-
const options = { sourceDocument: null, tableClass: null, query: null }
71-
var result
72-
const widget = renderTableViewPane(document, { query, onDone })
62+
var result = null
63+
const _ = renderTableViewPane(document, { query, onDone })
7364

7465
function onDone (ele) {
7566
result = ele.innerHTML
@@ -82,9 +73,8 @@ describe('renderTableViewPane', () => {
8273
// expect(renderTableViewPane(document, tableOptions).innerHTML).toMatch(/.*<table.*person.*name.*age.*hobby.*/)
8374
})
8475
it('includes the data', async () => {
85-
const options = { sourceDocument: null, tableClass: null, query: null }
86-
var result
87-
const widget = renderTableViewPane(document, { query, onDone })
76+
var result = null
77+
const _ = renderTableViewPane(document, { query, onDone })
8878

8979
function onDone (ele) {
9080
result = ele.innerHTML
@@ -95,20 +85,19 @@ describe('renderTableViewPane', () => {
9585
})
9686
it('orders by age', async () => {
9787
const options = { query, onDone, sortBy: '?age', sortReverse: false }
98-
var result
88+
var result = null
9989
const widget = renderTableViewPane(document, options)
100-
function onDone (ele) {
90+
function onDone () {
10191
result = widget.innerHTML
102-
// result = ele.innerHTML
10392
}
10493
await new Promise(resolve => setTimeout(resolve, 3000))
10594
expect(result).toMatch(/.*Charlie.*Bob.*Alice.*/)
10695
})
10796

10897
it('orders by reverse age', async () => {
10998
const options = { query, onDone, sortBy: '?age', sortReverse: true }
110-
var result
111-
const widget = renderTableViewPane(document, options)
99+
var result = null
100+
const _ = renderTableViewPane(document, options)
112101
function onDone (ele) {
113102
result = ele.innerHTML
114103
}
@@ -118,8 +107,8 @@ describe('renderTableViewPane', () => {
118107

119108
it('orders by name', async () => {
120109
const options = { query, onDone, sortBy: '?name', sortReverse: false }
121-
var result
122-
const widget = renderTableViewPane(document, options)
110+
var result = null
111+
const _ = renderTableViewPane(document, options)
123112
function onDone (ele) {
124113
result = ele.innerHTML
125114
}
@@ -130,8 +119,8 @@ describe('renderTableViewPane', () => {
130119

131120
it('orders by hobby', async () => {
132121
const options = { query, onDone, sortBy: '?hobby', sortReverse: false }
133-
var result
134-
const widget = renderTableViewPane(document, options)
122+
var result = null
123+
const _ = renderTableViewPane(document, options)
135124
function onDone (ele) {
136125
result = ele.innerHTML
137126
}
@@ -151,8 +140,8 @@ describe('renderTableViewPane', () => {
151140
'?hobby': { label: 'WHY' }
152141
}
153142
}
154-
var result
155-
const widget = renderTableViewPane(document, options)
143+
var result = null
144+
const _ = renderTableViewPane(document, options)
156145
function onDone (ele) {
157146
result = ele.innerHTML
158147
}

0 commit comments

Comments
 (0)