Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 86be7fa

Browse files
committed
Fix linting
1 parent c4cbcdc commit 86be7fa

9 files changed

+91
-159
lines changed

stories/components/link.stories.tsx

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121

2222
import type { ReactElement } from "react";
2323
import React from "react";
24-
import { addUrl, createThing, setThing, createSolidDataset } from "@inrupt/solid-client";
24+
import {
25+
addUrl,
26+
createThing,
27+
setThing,
28+
createSolidDataset,
29+
} from "@inrupt/solid-client";
2530
import { Link } from "../../src/components/link";
2631

2732
export default {
@@ -48,11 +53,7 @@ export default {
4853

4954
export function WithChildren({ property }: { property: string }): ReactElement {
5055
const exampleUrl = "http://test.url";
51-
const exampleThing = addUrl(
52-
createThing(),
53-
property,
54-
exampleUrl,
55-
);
56+
const exampleThing = addUrl(createThing(), property, exampleUrl);
5657
return (
5758
<Link thing={exampleThing} property={property}>
5859
<span>Example child</span>
@@ -74,11 +75,7 @@ export function WithoutChildren({
7475
property: string;
7576
}): ReactElement {
7677
const exampleUrl = "http://test.url";
77-
const exampleThing = addUrl(
78-
createThing(),
79-
property,
80-
exampleUrl,
81-
);
78+
const exampleThing = addUrl(createThing(), property, exampleUrl);
8279
return <Link thing={exampleThing} property={property} />;
8380
}
8481

@@ -92,16 +89,9 @@ WithoutChildren.args = {
9289

9390
export function Editable({ property }: { property: string }): ReactElement {
9491
const exampleUrl = "http://test.url";
95-
const exampleThing = addUrl(
96-
createThing(),
97-
property,
98-
exampleUrl,
99-
);
92+
const exampleThing = addUrl(createThing(), property, exampleUrl);
10093

101-
const exampleDataset = setThing(
102-
createSolidDataset(),
103-
exampleThing,
104-
);
94+
const exampleDataset = setThing(createSolidDataset(), exampleThing);
10595

10696
return (
10797
<Link
@@ -124,11 +114,7 @@ Editable.args = {
124114
export function ErrorComponent(): ReactElement {
125115
const exampleUrl = "http://test.url";
126116
const property = "http://xmlns.com/foaf/0.1/homepage";
127-
const exampleThing = addUrl(
128-
createThing(),
129-
property,
130-
exampleUrl,
131-
);
117+
const exampleThing = addUrl(createThing(), property, exampleUrl);
132118
return (
133119
<Link
134120
thing={exampleThing}

stories/components/table.stories.tsx

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@
2121

2222
import type { ReactElement } from "react";
2323
import React, { useContext } from "react";
24-
import { addDatetime, addStringNoLocale, createSolidDataset, createThing, getThing, getUrl, setThing, SolidDataset } from "@inrupt/solid-client";
24+
import type { SolidDataset } from "@inrupt/solid-client";
25+
import {
26+
addDatetime,
27+
addStringNoLocale,
28+
createSolidDataset,
29+
createThing,
30+
getThing,
31+
getUrl,
32+
setThing,
33+
} from "@inrupt/solid-client";
2534
import DatasetContext, {
2635
DatasetProvider,
2736
} from "../../src/context/datasetContext";
@@ -76,11 +85,7 @@ export function BasicExample(): ReactElement {
7685
namePredicate,
7786
`example name 2`,
7887
);
79-
const thing2 = addDatetime(
80-
thing2A,
81-
datePredicate,
82-
new Date("1999-01-02"),
83-
);
88+
const thing2 = addDatetime(thing2A, datePredicate, new Date("1999-01-02"));
8489

8590
const emptyDataset = createSolidDataset();
8691
const datasetWithThing1 = setThing(emptyDataset, thing1);
@@ -113,21 +118,9 @@ export function MultipleValues(): ReactElement {
113118
namePredicate,
114119
`example name 1`,
115120
);
116-
const thing1B = addStringNoLocale(
117-
thing1A,
118-
nickPredicate,
119-
`Nickname`,
120-
);
121-
const thing1C = addStringNoLocale(
122-
thing1B,
123-
nickPredicate,
124-
`Alt Nickname`,
125-
);
126-
const thing1 = addStringNoLocale(
127-
thing1C,
128-
nickPredicate,
129-
`Final Nickname`,
130-
);
121+
const thing1B = addStringNoLocale(thing1A, nickPredicate, `Nickname`);
122+
const thing1C = addStringNoLocale(thing1B, nickPredicate, `Alt Nickname`);
123+
const thing1 = addStringNoLocale(thing1C, nickPredicate, `Final Nickname`);
131124

132125
const thing2A = addStringNoLocale(
133126
createThing(),
@@ -184,11 +177,7 @@ export function CustomBodyComponent(): ReactElement {
184177
namePredicate,
185178
`example name 2`,
186179
);
187-
const thing2 = addDatetime(
188-
thing2A,
189-
datePredicate,
190-
new Date("1999-01-02"),
191-
);
180+
const thing2 = addDatetime(thing2A, datePredicate, new Date("1999-01-02"));
192181

193182
const emptyDataset = createSolidDataset();
194183
const datasetWithThing1 = setThing(emptyDataset, thing1);
@@ -249,10 +238,7 @@ export function NestedDataExample(): ReactElement {
249238
let phoneNumber = "";
250239
numberThingIris.some((numberThingIri) => {
251240
const numberThing = getThing(dataset, numberThingIri);
252-
if (
253-
numberThing &&
254-
getUrl(numberThing, typeProperty) === numberType
255-
) {
241+
if (numberThing && getUrl(numberThing, typeProperty) === numberType) {
256242
phoneNumber = getUrl(numberThing, valueProperty) ?? "";
257243
return true;
258244
}
@@ -267,10 +253,7 @@ export function NestedDataExample(): ReactElement {
267253
if (!solidDataset) {
268254
return null;
269255
}
270-
const personThing = getThing(
271-
solidDataset,
272-
`${host}/example.ttl#me`,
273-
);
256+
const personThing = getThing(solidDataset, `${host}/example.ttl#me`);
274257
const alterEgoThing = getThing(
275258
solidDataset,
276259
`${host}/example.ttl#alterEgo`,
@@ -350,11 +333,7 @@ export function SortableColumns(): ReactElement {
350333
namePredicate,
351334
`example name 2`,
352335
);
353-
const thing2 = addDatetime(
354-
thing2A,
355-
datePredicate,
356-
new Date("1999-01-02"),
357-
);
336+
const thing2 = addDatetime(thing2A, datePredicate, new Date("1999-01-02"));
358337

359338
const emptyDataset = createSolidDataset();
360339
const datasetWithThing1 = setThing(emptyDataset, thing1);
@@ -406,11 +385,7 @@ export function FilterOnFirstColumn({
406385
namePredicate,
407386
`example name 2`,
408387
);
409-
const thing2 = addDatetime(
410-
thing2A,
411-
datePredicate,
412-
new Date("1999-01-02"),
413-
);
388+
const thing2 = addDatetime(thing2A, datePredicate, new Date("1999-01-02"));
414389

415390
const emptyDataset = createSolidDataset();
416391
const datasetWithThing1 = setThing(emptyDataset, thing1);
@@ -456,16 +431,8 @@ export function SortingFunctionOnFirstColumn(): ReactElement {
456431
);
457432
const thing1 = addDatetime(thing1A, datePredicate, new Date());
458433

459-
const thing2A = addStringNoLocale(
460-
createThing(),
461-
namePredicate,
462-
"Name A",
463-
);
464-
const thing2 = addDatetime(
465-
thing2A,
466-
datePredicate,
467-
new Date("1999-01-02"),
468-
);
434+
const thing2A = addStringNoLocale(createThing(), namePredicate, "Name A");
435+
const thing2 = addDatetime(thing2A, datePredicate, new Date("1999-01-02"));
469436

470437
const emptyDataset = createSolidDataset();
471438
const datasetWithThing1 = setThing(emptyDataset, thing1);
@@ -516,11 +483,7 @@ export function NoDataComponent(): ReactElement {
516483
namePredicate,
517484
`example name 2`,
518485
);
519-
const thing2 = addDatetime(
520-
thing2A,
521-
datePredicate,
522-
new Date("1999-01-02"),
523-
);
486+
const thing2 = addDatetime(thing2A, datePredicate, new Date("1999-01-02"));
524487

525488
const emptyDataset = createSolidDataset();
526489
const datasetWithThing1 = setThing(emptyDataset, thing1);

stories/components/tableColumn.stories.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@
2121

2222
import type { ReactElement } from "react";
2323
import React from "react";
24+
import {
25+
addStringNoLocale,
26+
createThing,
27+
createSolidDataset,
28+
setThing,
29+
} from "@inrupt/solid-client";
2430
import { Table, TableColumn } from "../../src/components/table";
2531
import type { DataType } from "../../src/helpers";
26-
import { addStringNoLocale, createThing, createSolidDataset, setThing } from "@inrupt/solid-client";
2732

2833
export default {
2934
title: "Components/TableColumn",

stories/components/text.stories.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
/* eslint-disable @typescript-eslint/no-explicit-any */
2323
import type { ReactElement } from "react";
2424
import React from "react";
25+
import {
26+
addStringNoLocale,
27+
createThing,
28+
setThing,
29+
createSolidDataset,
30+
} from "@inrupt/solid-client";
2531
import { Text } from "../../src/components/text";
2632
import { DatasetProvider } from "../../src/context/datasetContext";
2733
import { ThingProvider } from "../../src/context/thingContext";
2834
import config from "../config";
29-
import { addStringNoLocale, createThing, setThing, createSolidDataset } from "@inrupt/solid-client";
3035

3136
const { host } = config();
3237

@@ -107,16 +112,9 @@ export function BasicExample({
107112
}: IText): ReactElement {
108113
const exampleNick = "example value";
109114

110-
const exampleThing = addStringNoLocale(
111-
createThing(),
112-
property,
113-
exampleNick,
114-
);
115+
const exampleThing = addStringNoLocale(createThing(), property, exampleNick);
115116

116-
const exampleDataset = setThing(
117-
createSolidDataset(),
118-
exampleThing,
119-
);
117+
const exampleDataset = setThing(createSolidDataset(), exampleThing);
120118

121119
return (
122120
<Text
@@ -155,10 +153,7 @@ export function WithLocalData({
155153
exampleNick,
156154
);
157155

158-
const exampleDataset = setThing(
159-
createSolidDataset(),
160-
exampleThing,
161-
);
156+
const exampleDataset = setThing(createSolidDataset(), exampleThing);
162157

163158
return (
164159
<Text

stories/components/value.stories.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@
2222
/* eslint-disable @typescript-eslint/no-explicit-any */
2323
import type { ReactElement } from "react";
2424
import React from "react";
25+
import {
26+
addStringNoLocale,
27+
createThing,
28+
setThing,
29+
createSolidDataset,
30+
} from "@inrupt/solid-client";
2531
import type { DataType } from "../../src/helpers";
2632
import { Value } from "../../src/components/value";
2733
import { DatasetProvider } from "../../src/context/datasetContext";
2834
import { ThingProvider } from "../../src/context/thingContext";
2935
import config from "../config";
30-
import { addStringNoLocale, createThing, setThing, createSolidDataset } from "@inrupt/solid-client";
3136

3237
const { host } = config();
3338

@@ -358,16 +363,9 @@ export function WithUnsavedData(
358363
} = props;
359364
const exampleNick = "example value";
360365

361-
const exampleThing = addStringNoLocale(
362-
createThing(),
363-
property,
364-
exampleNick,
365-
);
366+
const exampleThing = addStringNoLocale(createThing(), property, exampleNick);
366367

367-
const exampleDataset = setThing(
368-
createSolidDataset(),
369-
exampleThing,
370-
);
368+
const exampleDataset = setThing(createSolidDataset(), exampleThing);
371369

372370
return (
373371
<Value

stories/components/video.stories.tsx

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
import type { ReactElement } from "react";
2323
import React from "react";
24-
import { Video } from "../../src/components/video";
2524
import { addUrl, createThing } from "@inrupt/solid-client";
25+
import { Video } from "../../src/components/video";
2626

2727
export default {
2828
title: "Components/Video",
@@ -80,11 +80,7 @@ export function EditFalse({
8080
const exampleUrl =
8181
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
8282
const exampleProperty = `http://www.w3.org/2006/vcard/ns#hasPhoto`;
83-
const exampleThing = addUrl(
84-
createThing(),
85-
exampleProperty,
86-
exampleUrl,
87-
);
83+
const exampleThing = addUrl(createThing(), exampleProperty, exampleUrl);
8884
return (
8985
<Video
9086
thing={exampleThing}
@@ -119,11 +115,7 @@ export function EditTrue({
119115
const exampleUrl =
120116
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
121117
const exampleProperty = `http://www.w3.org/2006/vcard/ns#hasPhoto`;
122-
const exampleThing = addUrl(
123-
createThing(),
124-
exampleProperty,
125-
exampleUrl,
126-
);
118+
const exampleThing = addUrl(createThing(), exampleProperty, exampleUrl);
127119

128120
return (
129121
<Video
@@ -152,11 +144,7 @@ export function ErrorComponent(): ReactElement {
152144
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
153145

154146
const exampleProperty = `http://www.w3.org/2006/vcard/ns#hasPhoto`;
155-
const exampleThing = addUrl(
156-
createThing(),
157-
exampleProperty,
158-
exampleUrl,
159-
);
147+
const exampleThing = addUrl(createThing(), exampleProperty, exampleUrl);
160148

161149
return (
162150
<Video

0 commit comments

Comments
 (0)