Skip to content

Commit 2cc072f

Browse files
authored
Upgrade to latest linting config (#2680)
1 parent b82344b commit 2cc072f

File tree

201 files changed

+6995
-6716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+6995
-6716
lines changed

.eslintignore

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Please run
5555
in your project folder and paste the output here:
5656
-->
5757

58-
```
58+
```sh
5959
$ npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers
6060
```
6161

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ This PR fixes #<issue ID>.
88

99
<!-- When adding a new feature: -->
1010

11-
# New feature description
11+
## New feature description
1212

13-
# Checklist
13+
## Checklist
1414

1515
- [ ] All acceptance criteria are met.
1616
- [ ] Relevant documentation, if any, has been written/updated.
@@ -24,7 +24,7 @@ This PR fixes #<issue ID>.
2424

2525
This PR bumps the version to <version number>.
2626

27-
# Checklist
27+
## Checklist
2828

2929
- [ ] I inspected the changelog to determine if the release was major, minor or patch. I then used the command `npm version <major|minor|patch>` to update the `package.json` and `package-lock.json` (and locally create a tag).
3030
- [ ] The CHANGELOG has been updated to show version and release date - https://keepachangelog.com/en/1.0.0/.

ARCHITECTURE.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# `@inrupt/solid-client` architectural overview
2+
13
This document describes the general design principles and modules of solid-client,
24
to help contributors make sure their and others' work is coherent with what's
35
there. It assumes that you are already familiar with the external API and
@@ -13,9 +15,9 @@ It can also be insightful to use `git blame` liberally. We've generally kept
1315
fairly good Git hygiene, so reading the commit that introduced some code can be
1416
helpful in understanding how it relates to the rest of the codebase.
1517

16-
# Design principles
18+
## Design principles
1719

18-
## Avoidance of side effects
20+
### Avoidance of side effects
1921

2022
Generally, our API's tend to avoid side effects whenever possible. That means
2123
that we have a number of functions that only perform the side effects we cannot
@@ -32,7 +34,7 @@ support this common use case. (SolidDatasets used to be built on top of
3234
[RDF/JS Datasets](https://rdf.js.org/dataset-spec/), but we moved away from that
3335
to avoid its mutability and lack of serialisability because of the above.)
3436

35-
## Lumping ACLs and Resources together
37+
### Lumping ACLs and Resources together
3638

3739
Linked Resources, such as an Access Control Lists, are currently attached to the
3840
same object that represents the Resource they are linked to. The reason for this
@@ -57,9 +59,9 @@ Resource itself, but also that in one or more linked Resources.
5759
This concern was mainly brought up by @pmcb55, so further questions regarding
5860
this can be directed to him.
5961

60-
# Concepts
62+
## Concepts
6163

62-
## Resources, Files and SolidDatasets
64+
### Resources, Files and SolidDatasets
6365

6466
`solid-client` refers to everything that can be fetched from a URL as a Resource.
6567
There are two types of Resources: those containing RDF in a serialisation that
@@ -82,7 +84,7 @@ XML or OpenDocument) or files containing structured data in an RDF format not re
8284
by the Solid Protocol (for example RDF/XML) it is up to the server to accept that
8385
payload and treat it as a binary resource, interpret it as RDF, or reject it.
8486

85-
## `With*` types
87+
### `With*` types
8688

8789
Although SolidDatasets and Files (see previous section) are different types of
8890
Resources, there is certain data that is common to all Resources. This data is
@@ -106,9 +108,9 @@ the implementation of these data structures. If developers want to access the
106108
data contained in them, they should use the functions we provide for them, such
107109
as `getContentType`. We can, of course, use those internally as well.
108110

109-
# Module map
111+
## Module map
110112

111-
## `src/resource/*`
113+
### `src/resource/*`
112114

113115
Everything related to fetching and storing data. `file.ts` has everything
114116
related to fetching Files, which is mostly a thin wrapper around a regular
@@ -123,18 +125,18 @@ SolidDatasets with the appropriate meta data in their unit tests. This helps
123125
avoiding developers from attempting to recreate our metadata data structures,
124126
and then breaking in a non-major version.
125127

126-
## `src/thing/*`
128+
### `src/thing/*`
127129

128130
Everything related to reading and manipulating data in a SolidDataset.
129131

130-
## `src/formats/*`
132+
### `src/formats/*`
131133

132134
We currently just support parsing Turtle natively (though developers can pass in
133135
their own parsers), since the spec mandates that all servers should be able to
134136
serialise RDF to that, and since we already have a Turtle library to produce
135137
serialisations for PATCH requests.
136138

137-
## `universalAccess`, `src/acl/*` and `acp_ess_`
139+
### `universalAccess`, `src/acl/*` and `acp_ess_`
138140

139141
At first, there was one [authorization mechanism in Solid](https://solidproject.org/TR/protocol#authorization):
140142
Web Access Control ([WAC](https://solidproject.org/TR/wac)). WAC uses the Access
@@ -153,7 +155,7 @@ authorization systems (ACL: `src/acl/*` and ACP: `acp_ess_`). Those lower level
153155
functions are for the time being still experimental and we don't advise using
154156
them in production code.
155157

156-
## `e2e/browser` and `e2e/node`
158+
### `e2e/browser` and `e2e/node`
157159

158160
`solid-client` can run in both Node and in the browser. To ensure that everything
159161
works as intended, we have a suite of tests that attempts to use its APIs to
@@ -170,7 +172,7 @@ The Node-based end-to-end test suite is the more extensive one. It verifies not
170172
just that the library works in Node, but also that e.g. manipulating access
171173
correctly prevents or allows the right people access _in practice_.
172174

173-
# Opportunities for improvement
175+
## Opportunities for improvement
174176

175177
Given that the code base has existed for more than a day, some parts of the code
176178
have evolved in a certain way that would have been done differently if they had
@@ -180,7 +182,7 @@ across them and start wondering whether there's a good reason for things to be
180182
that way. In the spirit of [Chesterton's Fence](https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence),
181183
if I tell you why they are the way they are, you can feel safe to change them!
182184

183-
## Using the solid-client-authn-browser default session
185+
### Using the solid-client-authn-browser default session
184186

185187
Currently, developers wanting to make authenticated requests will have to make
186188
sure they pass in an authenticated `fetch` function. However, in the browser,
@@ -195,7 +197,7 @@ implemented yet.
195197
The interaction with bundlers here can be pretty tricky so, when implementing
196198
this, be sure to test it well.
197199

198-
## The entire low-level Access Control Policies API
200+
### The entire low-level Access Control Policies API
199201

200202
(i.e. `acp_ess_1` and `acp_ess_2`)
201203

@@ -222,27 +224,27 @@ mechanism to attach linked Resources in general. (Keep in mind that that will
222224
not work for Web Access Control, since that might require fetching a Resource
223225
linked to a Resource higher up in the Container hierarchy.)
224226

225-
## `WithServerResourceInfo["aclUrl"]`
227+
### `WithServerResourceInfo["aclUrl"]`
226228

227229
When the `aclUrl` property was added to the `WithServerResourceInfo` interface,
228230
it was not clear to us that linked resources (i.e. those linked in the HTTP
229231
Link header) would be a commonly-used mechanism to expose related data.
230-
We later added the `WithServerResourceInfo["linkedResources"] property, which
232+
We later added the `WithServerResourceInfo["linkedResources"]` property, which
231233
_also_ exposes the ACL URL, but didn't bother to update the old code to make
232234
use of that instead.
233235

234-
## `src/interfaces.ts`
236+
### `src/interfaces.ts`
235237

236238
The interfaces defined here would probably make more sense defined in the
237239
relevant modules. It might not even be necessary to add aliases from the old
238240
module to the new one, as long as TypeScript does not support exports maps
239241
yet. (Though adding them just to be sure probably isn't a bad idea.)
240242

241-
## ChangeLog
243+
### ChangeLog
242244

243245
The ChangeLog currently consists of two arrays of RDF/JS Quads. This can be
244246
problematic since those are instantiated classes, conflicting with e.g. [Vue's
245-
desire to keep [data] plain](https://vuex.vuejs.org/guide/state.html#single-state-tree)
247+
desire to keep data plain](https://vuex.vuejs.org/guide/state.html#single-state-tree)
246248
or [SWR only considering own properties](https://swr.vercel.app/advanced/performance#deep-comparison).
247249
In practice this is probably not much of a problem, since the ChangeLog is only
248250
updated when the SolidDataset itself is as well. However, if it turns out
@@ -251,7 +253,7 @@ objects.
251253

252254
Or alternatively...
253255

254-
## PATCH and 412 conflicts
256+
### PATCH and 412 conflicts
255257

256258
...it could be considered to remove the ChangeLog functionality altogether. One
257259
of the most recurring problems people run into is not using the return value
@@ -266,7 +268,7 @@ calling `overwriteFile`. This might more often do what the developer expects,
266268
at the cost of sending bigger payloads and bigger risk of overwriting data that
267269
was inserted in parallel on a different device or by a different user.
268270

269-
## `File`
271+
### `File`
270272

271273
`File` is a bit awkward now for two reasons:
272274

@@ -281,7 +283,7 @@ was inserted in parallel on a different device or by a different user.
281283
This too, is hard to change without being breaking, although of course an
282284
alias could be added.
283285

284-
## ThingBuilder
286+
### ThingBuilder
285287

286288
`ThingBuilder` was created after the observation that this was a common pattern:
287289

@@ -318,7 +320,7 @@ Given that ThingBuilders are usually limited to a local scope, making it
318320
stateful could be a nice quality of life improvement, and can be implemented
319321
without breaking anything.
320322

321-
## `*StringNoLocale`
323+
### `*StringNoLocale`
322324

323325
It might seem weird that there are `*StringNoLocale` and `*StringWithLocale`
324326
functions, rather than just `*String` functions with an optional `locale`

0 commit comments

Comments
 (0)