Skip to content

Commit 2264cb4

Browse files
authored
Fix lint error (#63)
* Fix lint error * Fix config import
1 parent b151af2 commit 2264cb4

3 files changed

Lines changed: 36 additions & 35 deletions

File tree

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/library/ErrorMessages/ErrorMessages.tsx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@ import { ErrorResponses } from "../config/GithubPermalinkContext";
22
import { exhaustiveFailure } from "../utils/exhaustiveFailure";
33

44
export function ErrorMessages(props: {
5-
data: ErrorResponses
5+
data: ErrorResponses
66
}) {
77

8-
const data = props.data;
9-
if(data.status === "404"){
10-
return <>
11-
<p className="error">
12-
Github returned an HTTP status 404. Is this a private Github repo?
13-
</p>
14-
</>
15-
}
16-
17-
if(data.status ==="rate-limit"){
18-
return <>
19-
<p className="error">
20-
You have encountered Github's unauthenticated API request rate limit. You can still visit the above link to see the code snippet.
21-
</p>
22-
</>
23-
}
24-
if(data.status === "unauthorized"){
25-
return <>
26-
<p className="error">
27-
Unauthorized. Is your Github token valid?
28-
</p>
29-
</>
30-
}
31-
32-
if(data.status ==="other-error"){
33-
return <>
34-
<p className="error">
35-
An unknown error occurred.
36-
</p>
37-
</>
38-
}
8+
const data = props.data;
9+
if (data.status === "404") {
10+
return <>
11+
<p className="error">
12+
Github returned an HTTP status 404. Is this a private Github repo?
13+
</p>
14+
</>
15+
}
3916

40-
return exhaustiveFailure(data);
17+
if (data.status === "rate-limit") {
18+
return <>
19+
<p className="error">
20+
You have encountered Github&#39;s unauthenticated API request rate limit. You can still visit the above link to see the code snippet.
21+
</p>
22+
</>
23+
}
24+
if (data.status === "unauthorized") {
25+
return <>
26+
<p className="error">
27+
Unauthorized. Is your Github token valid?
28+
</p>
29+
</>
30+
}
31+
32+
if (data.status === "other-error") {
33+
return <>
34+
<p className="error">
35+
An unknown error occurred.
36+
</p>
37+
</>
38+
}
39+
40+
return exhaustiveFailure(data);
4141
}

src/library/GithubPermalink/GithubPermlinkRsc.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Meta, StoryObj } from '@storybook/react';
22

33
import { GithubPermalinkRsc } from './GithubPermalinkRsc';
4-
import { githubPermalinkRscConfig } from '../export';
4+
import { githubPermalinkRscConfig } from '../rsc';
55
import { defaultGetPermalinkFn } from '../config/defaultFunctions';
66

77
const meta = {
@@ -24,7 +24,7 @@ export const Basic: Story = {
2424
export const LineExclusions: Story = {
2525
args: {
2626
permalink: "https://github.com/dwjohnston/react-github-permalink/blob/5b15aa07e60af4e317086f391b28cadf9aae8e1b/sample_files/sample1.go#L1-L5",
27-
excludeLines: [[2,4]]
27+
excludeLines: [[2, 4]]
2828
}
2929
}
3030
export const Erroring: Story = {

0 commit comments

Comments
 (0)