Skip to content

Commit eb2a78d

Browse files
Lint fix
1 parent c917fe9 commit eb2a78d

31 files changed

Lines changed: 4105 additions & 3270 deletions

package-lock.json

Lines changed: 3261 additions & 2427 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@
5353
},
5454
"homepage": "https://github.com/solid/solid-ui",
5555
"dependencies": {
56-
"@babel/runtime": "^7.12.1",
56+
"@babel/runtime": "^7.12.5",
5757
"crypto-browserify": "^3.12.0",
5858
"escape-html": "^1.0.3",
5959
"jss": "^10.4.0",
6060
"jss-preset-default": "^10.4.0",
6161
"mime-types": "^2.1.27",
62-
"pane-registry": "^2.3.2",
62+
"pane-registry": "^2.3.3",
6363
"path-browserify": "^1.0.1",
6464
"rdflib": "^2.1.1",
65-
"solid-auth-client": "^2.5.2",
65+
"solid-auth-client": "^2.5.3",
6666
"solid-logic": "^1.2.4",
6767
"solid-namespace": "^0.5.0",
6868
"stream-browserify": "^3.0.0",
@@ -77,28 +77,28 @@
7777
"@babel/plugin-transform-runtime": "^7.12.1",
7878
"@babel/preset-env": "^7.12.1",
7979
"@babel/preset-typescript": "^7.12.1",
80-
"@storybook/addon-actions": "^6.0.27",
81-
"@storybook/addon-essentials": "^6.0.27",
82-
"@storybook/addon-links": "^6.0.27",
83-
"@storybook/html": "^6.0.27",
80+
"@storybook/addon-actions": "^6.0.28",
81+
"@storybook/addon-essentials": "^6.0.28",
82+
"@storybook/addon-links": "^6.0.28",
83+
"@storybook/html": "^6.0.28",
8484
"@types/jest": "^26.0.15",
85-
"@types/jsdom": "^16.2.4",
86-
"@types/node": "^14.14.3",
87-
"@typescript-eslint/eslint-plugin": "^4.5.0",
88-
"@typescript-eslint/parser": "^4.5.0",
89-
"babel-loader": "^8.1.0",
90-
"eslint": "^7.12.0",
91-
"eslint-plugin-jest": "^24.1.0",
85+
"@types/jsdom": "^16.2.5",
86+
"@types/node": "^14.14.7",
87+
"@typescript-eslint/eslint-plugin": "^4.7.0",
88+
"@typescript-eslint/parser": "^4.7.0",
89+
"babel-loader": "^8.2.1",
90+
"eslint": "^7.13.0",
91+
"eslint-plugin-jest": "^24.1.1",
9292
"husky": "^4.3.0",
93-
"jest": "^26.6.1",
93+
"jest": "^26.6.3",
9494
"jsdom": "^16.4.0",
95-
"lint-staged": "^10.4.2",
95+
"lint-staged": "^10.5.1",
9696
"react-is": "^17.0.1",
9797
"solid-auth-cli": "^1.0.15",
98-
"standard": "^15.0.0",
99-
"ts-jest": "^26.4.2",
98+
"standard": "^16.0.2",
99+
"ts-jest": "^26.4.4",
100100
"typedoc": "^0.19.2",
101-
"typescript": "^4.0.3",
101+
"typescript": "^4.0.5",
102102
"webpack": "^4.44.2",
103103
"webpack-cli": "^4.1.0"
104104
},

src/acl/acl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function ACLunion (list: Array<AgentMapMap | AgentMapUnion>): AgentMapUni
136136
const b = list[0]
137137
let a, ag
138138
for (let k = 1; k < list.length; k++) {
139-
;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].map(
139+
;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(
140140
function (pred) {
141141
a = list[k]
142142
if (a[pred]) {
@@ -195,7 +195,7 @@ export function loadUnionACL (subjectList: Array<NamedNode>, callbackFunction: l
195195
*/
196196
export function ACLbyCombination (ac: AgentMapMap | AgentMapUnion): ComboList {
197197
const byCombo = {}
198-
;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].map(function (pred) {
198+
;['agent', 'agentClass', 'agentGroup', 'origin', 'originClass'].forEach(function (pred) {
199199
for (const agent in ac[pred]) {
200200
const combo: string[] = []
201201
for (const mode in ac[pred][agent]) {

src/authn/authn.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ export function selectWorkspace (
11351135
const storages = solidLogicSingleton.store.each(id, ns.space('storage')) // @@ No provenance requirement at the moment
11361136
if (w.length === 0 && storages) {
11371137
say(`You don't seem to have any workspaces. You have ${storages.length} storage spaces.`)
1138-
storages.map(function (s) {
1138+
storages.forEach(function (s) {
11391139
w = w.concat(solidLogicSingleton.store.each(s, ns.ldp('contains')))
11401140
}).filter(file => ['public', 'private'].includes(file.id().toLowerCase()))
11411141
}
@@ -1144,7 +1144,7 @@ export function selectWorkspace (
11441144
say(`Workspace used: ${w[0].uri}`) // @@ allow user to see URI
11451145
newBase = figureOutBase(w[0])
11461146
// callbackWS(w[0], newBase)
1147-
} else if (w.length === 0) {
1147+
// } else if (w.length === 0) {
11481148
}
11491149

11501150
// Prompt for ws selection or creation

src/authn/signup.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var defaultConfig = require('./config-default')
1+
const defaultConfig = require('./config-default')
22

33
/**
44
* Provides functionality for signing up with a Solid provider
@@ -19,18 +19,18 @@ function Signup (config) {
1919
* @return {Promise<String>} Event listener promise, resolves to user's WebID
2020
*/
2121
Signup.prototype.listen = function listen () {
22-
var promise = new Promise(function (resolve, reject) {
23-
var eventMethod = window.addEventListener
22+
const promise = new Promise(function (resolve, reject) {
23+
const eventMethod = window.addEventListener
2424
? 'addEventListener'
2525
: 'attachEvent'
26-
var eventListener = window[eventMethod]
27-
var messageEvent = eventMethod === 'attachEvent'
26+
const eventListener = window[eventMethod]
27+
const messageEvent = eventMethod === 'attachEvent'
2828
? 'onmessage'
2929
: 'message'
3030
eventListener(messageEvent, function (e) {
31-
var u = e.data
31+
const u = e.data
3232
if (u.slice(0, 5) === 'User:') {
33-
var user = u.slice(5, u.length)
33+
const user = u.slice(5, u.length)
3434
if (user && user.length > 0 && user.slice(0, 4) === 'http') {
3535
return resolve(user)
3636
} else {
@@ -52,19 +52,19 @@ Signup.prototype.listen = function listen () {
5252
*/
5353
Signup.prototype.signup = function signup (signupUrl) {
5454
signupUrl = signupUrl || this.config.signupEndpoint
55-
var width = this.config.signupWindowWidth
56-
var height = this.config.signupWindowHeight
55+
const width = this.config.signupWindowWidth
56+
const height = this.config.signupWindowHeight
5757
// set borders
58-
var leftPosition = (window.screen.width / 2) - ((width / 2) + 10)
58+
const leftPosition = (window.screen.width / 2) - ((width / 2) + 10)
5959
// set title and status bars
60-
var topPosition = (window.screen.height / 2) - ((height / 2) + 50)
61-
var windowTitle = 'Solid signup'
62-
var windowUrl = signupUrl + '?origin=' +
60+
const topPosition = (window.screen.height / 2) - ((height / 2) + 50)
61+
const windowTitle = 'Solid signup'
62+
const windowUrl = signupUrl + '?origin=' +
6363
encodeURIComponent(window.location.origin)
64-
var windowSpecs = 'resizable,scrollbars,status,width=' + width + ',height=' +
64+
const windowSpecs = 'resizable,scrollbars,status,width=' + width + ',height=' +
6565
height + ',left=' + leftPosition + ',top=' + topPosition
6666
window.open(windowUrl, windowTitle, windowSpecs)
67-
var self = this
67+
const self = this
6868
return new Promise(function (resolve) {
6969
self.listen()
7070
.then(function (webid) {

src/chat/bookmarks.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export async function findBookmarkDocument (userContext) {
109109
} else {
110110
if (userContext.publicProfile) {
111111
// publicProfile or preferencesFile
112-
var newBookmarkFile = $rdf.sym(
112+
const newBookmarkFile = $rdf.sym(
113113
userContext.publicProfile.dir().uri + fileTail
114114
)
115115
try {
@@ -149,11 +149,11 @@ async function addBookmark (context, target) {
149149
bookm:recalls wiki:Heron;
150150
n0:maker c:me.
151151
*/
152-
var title = ''
153-
var me = UI.authn.currentUser() // If already logged on
152+
let title = ''
153+
const me = UI.authn.currentUser() // If already logged on
154154
if (!me) throw new Error('Must be logged on to add Bookmark')
155155

156-
var author = kb.any(target, ns.foaf('maker'))
156+
const author = kb.any(target, ns.foaf('maker'))
157157
title =
158158
label(author) + ': ' + kb.anyValue(target, ns.sioc('content')).slice(0, 80) // @@ add chat title too?
159159
const bookmarkDoc = context.bookmarkDocument
@@ -217,7 +217,7 @@ export async function renderBookmarksButton (userContext, target) {
217217
if (bookmarked) bookmarkButton.style.backgroundColor = 'yellow'
218218
}
219219

220-
var bookmarkButton
220+
let bookmarkButton
221221
if (userContext.bookmarkDocument) {
222222
bookmarkButton = UI.widgets.button(
223223
dom,

src/chat/dateFolder.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = class DateFolder {
2626
leafDocumentFromDate (date) {
2727
// debug.log('incoming date: ' + date)
2828
const isoDate = date.toISOString() // Like "2018-05-07T17:42:46.576Z"
29-
var path = isoDate.split('T')[0].replace(/-/g, '/') // Like "2018/05/07"
29+
let path = isoDate.split('T')[0].replace(/-/g, '/') // Like "2018/05/07"
3030
path = this.root.dir().uri + path + '/' + this.leafFileName
3131
return kb.sym(path)
3232
}
@@ -37,7 +37,7 @@ module.exports = class DateFolder {
3737
const head = this.rootFolder.uri.length
3838
const str = doc.uri.slice(head, head + 10).replace(/\//g, '-')
3939
// let date = new Date(str + 'Z') // GMT - but fails in FF - invalid format :-(
40-
var date = new Date(str) // not explicitly UTC but is assumed so in spec
40+
const date = new Date(str) // not explicitly UTC but is assumed so in spec
4141
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
4242
debug.log('Date for ' + doc + ':' + date.toISOString())
4343
return date
@@ -81,7 +81,7 @@ module.exports = class DateFolder {
8181
// debug.log(' previousPeriod level' + level + ' file ' + file)
8282
const parent = file.dir()
8383
await kb.fetcher.load(parent)
84-
var siblings = kb.each(parent, ns.ldp('contains'))
84+
let siblings = kb.each(parent, ns.ldp('contains'))
8585
siblings = siblings.filter(younger)
8686
const folder = await lastNonEmpty(siblings)
8787
if (folder) return folder
@@ -91,7 +91,7 @@ module.exports = class DateFolder {
9191
const uncle = await previousPeriod(parent, level - 1)
9292
if (!uncle) return null // reached first ever
9393
await kb.fetcher.load(uncle)
94-
var cousins = kb.each(uncle, ns.ldp('contains'))
94+
const cousins = kb.each(uncle, ns.ldp('contains'))
9595
const result = await lastNonEmpty(cousins)
9696
return result
9797
} // previousPeriod
@@ -107,8 +107,8 @@ module.exports = class DateFolder {
107107

108108
async firstLeaf (backwards) {
109109
// backwards -> last leafObject
110-
var folderStore = $rdf.graph()
111-
var folderFetcher = new $rdf.Fetcher(folderStore)
110+
const folderStore = $rdf.graph()
111+
const folderFetcher = new $rdf.Fetcher(folderStore)
112112
async function earliestSubfolder (parent) {
113113
function suitable (x) {
114114
const tail = x.uri
@@ -125,7 +125,7 @@ module.exports = class DateFolder {
125125
// }catch (err) {
126126
// }
127127

128-
var kids = folderStore.each(parent, ns.ldp('contains'))
128+
let kids = folderStore.each(parent, ns.ldp('contains'))
129129
kids = kids.filter(suitable)
130130
if (kids.length === 0) {
131131
throw new Error(' @@@ No children to parent2 ' + parent)

0 commit comments

Comments
 (0)