Skip to content

Commit da6d9d5

Browse files
authored
🆙 eslint (#441)
1 parent 61f6342 commit da6d9d5

File tree

14 files changed

+1454
-804
lines changed

14 files changed

+1454
-804
lines changed

.eslintignore

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

.eslintrc

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

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import config from "@bradgarropy/eslint-config"
2+
export default config

package-lock.json

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

package.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bradgarropy.com",
3-
"version": "8.1.0",
3+
"version": "8.2.0",
44
"description": "🏠 my home on the web",
55
"type": "module",
66
"keywords": [
@@ -81,9 +81,7 @@
8181
"unified": "^11.0.4"
8282
},
8383
"devDependencies": {
84-
"@bradgarropy/eslint-config": "^1.1.0",
85-
"@bradgarropy/eslint-config-react": "^1.0.0",
86-
"@bradgarropy/eslint-config-typescript": "^1.1.0",
84+
"@bradgarropy/eslint-config": "^3.0.1",
8785
"@bradgarropy/plop-generator-react-component": "^1.1.1",
8886
"@bradgarropy/plop-generator-react-context": "^1.1.1",
8987
"@bradgarropy/plop-generator-react-hook": "^1.1.1",
@@ -100,17 +98,9 @@
10098
"@types/node": "^20.10.4",
10199
"@types/react": "^19.0.1",
102100
"@types/react-dom": "^19.0.2",
103-
"@typescript-eslint/eslint-plugin": "^8.18.0",
104-
"@typescript-eslint/parser": "^8.18.0",
105101
"@vitejs/plugin-react": "^4.2.1",
106102
"@vitest/coverage-v8": "^1.1.0",
107103
"all-contributors-cli": "^6.24.0",
108-
"eslint": "^8.37.0",
109-
"eslint-config-prettier": "^9.0.0",
110-
"eslint-plugin-jsx-a11y": "^6.7.1",
111-
"eslint-plugin-react": "^7.32.2",
112-
"eslint-plugin-react-hooks": "^4.3.0",
113-
"eslint-plugin-simple-import-sort": "^12.0.0",
114104
"jest": "^29.7.0",
115105
"jsdom": "^24.0.0",
116106
"plop": "^4.0.1",
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {render} from "@testing-library/react"
2-
import {test} from "vitest"
2+
import {expect, test} from "vitest"
33

44
import GoogleAnalytics from "~/components/GoogleAnalytics"
55

66
test("renders script tags", async () => {
7-
render(<GoogleAnalytics measurementId="test" />)
7+
const {baseElement} = render(<GoogleAnalytics measurementId="test" />)
8+
expect(baseElement.children).toHaveLength(1)
89
})

src/components/Logo/Logo.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {render} from "@testing-library/react"
2-
import {test} from "vitest"
2+
import {expect, test} from "vitest"
33

44
import Logo from "~/components/Logo"
55

66
test("shows logo", () => {
7-
render(<Logo />)
7+
const {container} = render(<Logo />)
8+
expect(container.getElementsByTagName("svg")).toHaveLength(1)
89
})

src/hooks/useMarkdown/useMarkdown.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ test("renders images", () => {
4040

4141
const {result} = renderHook(() =>
4242
useMarkdown(
43-
// eslint-disable-next-line quotes
4443
'<img src="https://bradgarropy.com/profile.jpg" alt="profile" width="100" height="100"/>',
4544
),
4645
)

src/transformers/twitch/twitch.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,5 @@ test("transforms twitch clips", () => {
6262
)
6363

6464
const emptyHtml = twitchTransformer.getHTML("https://twitch.tv")
65-
66-
// eslint-disable-next-line quotes
6765
expect(emptyHtml).toEqual('<div class="twitch"></div>')
6866
})

src/transformers/twitch/twitch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const getHTML = (string: string): string => {
1717
} else if (isClip(string)) {
1818
src = `https://clips.twitch.tv/embed?clip=${id}`
1919
} else {
20-
// eslint-disable-next-line quotes
2120
const html = '<div class="twitch"></div>'
2221
return html
2322
}

src/transformers/twitter/twitter.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ test("transforms twitter links", async () => {
2222
)
2323

2424
expect(html).toEqual(
25-
// eslint-disable-next-line quotes
2625
expect.stringContaining('<div class="grid justify-center">'),
2726
)
2827

2928
expect(html).toEqual(
30-
// eslint-disable-next-line quotes
3129
expect.stringContaining('<blockquote class="twitter-tweet">'),
3230
)
3331

3432
expect(html).toEqual(
3533
expect.stringContaining(
36-
// eslint-disable-next-line quotes
3734
'<script async src="https://platform.twitter.com/widgets.js" charset="utf-8">',
3835
),
3936
)

src/utils/feed.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ test("caches json feed", async () => {
6363
expect(feedCache.get("feed")).toBeUndefined()
6464

6565
const feed = await generateFeed("json")
66-
67-
// eslint-disable-next-line quotes
6866
expect(feed).toContain('"title": "bradgarropy.com"')
6967
expect(feed).not.toBeUndefined()
7068

src/utils/markdown.server.test.ts

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ describe("transforms markdown", () => {
3030
)
3131

3232
expect(html).toEqual(
33-
// eslint-disable-next-line quotes
3433
'<a href="https://bradgarropy.com/profile.jpg"><img src="https://bradgarropy.com/profile.jpg" alt="brad garropy"></a>',
3534
)
3635
})
@@ -43,7 +42,6 @@ describe("transforms markdown", () => {
4342
)
4443

4544
expect(html).toEqual(
46-
// eslint-disable-next-line quotes
4745
'<a href="http://res.cloudinary.com/profile.jpg"><img src="http://res.cloudinary.com/profile.jpg" alt="brad garropy" width="100" height="100"></a>',
4846
)
4947

@@ -52,7 +50,6 @@ describe("transforms markdown", () => {
5250
)
5351

5452
expect(html).toEqual(
55-
// eslint-disable-next-line quotes
5653
'<a href="https://res.cloudinary.com/profile.jpg"><img src="https://res.cloudinary.com/profile.jpg" alt="brad garropy" width="100" height="100"></a>',
5754
)
5855
})
@@ -63,7 +60,6 @@ describe("transforms markdown", () => {
6360
)
6461

6562
expect(html).toEqual(
66-
// eslint-disable-next-line quotes
6763
'<a href="https://bradgarropy.com/profile.jpg"><img src="https://bradgarropy.com/profile.jpg" alt="brad garropy"></a>',
6864
)
6965
})
@@ -74,7 +70,6 @@ describe("transforms markdown", () => {
7470
)
7571

7672
expect(html).toEqual(
77-
// eslint-disable-next-line quotes
7873
'<a href="https://res.cloudinary.com/bradgarropy/image/upload/bradgarropy.com/profile.jpg"><img src="https://res.cloudinary.com/bradgarropy/image/upload/f_auto,q_auto,w_660,c_limit/bradgarropy.com/profile.jpg" alt="brad garropy" width="100" height="100"></a>',
7974
)
8075
})
@@ -85,7 +80,6 @@ describe("transforms markdown", () => {
8580
)
8681

8782
expect(html).toEqual(
88-
// eslint-disable-next-line quotes
8983
'<a href="https://bradgarropy.com/profile.jpg"><img src="https://bradgarropy.com/profile.jpg" alt="brad garropy"></a>',
9084
)
9185
})
@@ -99,7 +93,6 @@ describe("transforms markdown", () => {
9993

10094
expect(html).toEqual(
10195
expect.stringContaining(
102-
// eslint-disable-next-line quotes
10396
'src="https://codesandbox.io/embed/exciting-pascal-j5hwu"',
10497
),
10598
)
@@ -108,14 +101,10 @@ describe("transforms markdown", () => {
108101
test("embeds twitch", async () => {
109102
const html = await transformMarkdown("https://twitch.tv/bradgarropy")
110103

111-
expect(html).toEqual(
112-
// eslint-disable-next-line quotes
113-
expect.stringContaining("<iframe"),
114-
)
104+
expect(html).toEqual(expect.stringContaining("<iframe"))
115105

116106
expect(html).toEqual(
117107
expect.stringContaining(
118-
// eslint-disable-next-line quotes
119108
'src="https://player.twitch.tv?channel=bradgarropy&#x26;parent=bradgarropy.com"',
120109
),
121110
)
@@ -127,18 +116,15 @@ describe("transforms markdown", () => {
127116
)
128117

129118
expect(html).toEqual(
130-
// eslint-disable-next-line quotes
131119
expect.stringContaining('<div class="grid justify-center">'),
132120
)
133121

134122
expect(html).toEqual(
135-
// eslint-disable-next-line quotes
136123
expect.stringContaining('<blockquote class="twitter-tweet">'),
137124
)
138125

139126
expect(html).toEqual(
140127
expect.stringContaining(
141-
// eslint-disable-next-line quotes
142128
'<script async src="https://platform.twitter.com/widgets.js" charset="utf-8">',
143129
),
144130
)
@@ -149,12 +135,10 @@ describe("transforms markdown", () => {
149135

150136
expect(html).toEqual(expect.stringContaining("<iframe"))
151137

152-
// eslint-disable-next-line quotes
153138
expect(html).toEqual(expect.stringContaining('title="9zcU6oUOHVc"'))
154139

155140
expect(html).toEqual(
156141
expect.stringContaining(
157-
// eslint-disable-next-line quotes
158142
'src="https://www.youtube-nocookie.com/embed/9zcU6oUOHVc"',
159143
),
160144
)
@@ -166,31 +150,15 @@ describe("transforms markdown", () => {
166150
)
167151

168152
expect(html).toEqual(
169-
expect.stringContaining(
170-
// eslint-disable-next-line quotes
171-
'<a href="https://example.com"',
172-
),
153+
expect.stringContaining('<a href="https://example.com"'),
173154
)
174155

175-
expect(html).toEqual(
176-
expect.stringContaining(
177-
// eslint-disable-next-line quotes
178-
"external link</a>",
179-
),
180-
)
156+
expect(html).toEqual(expect.stringContaining("external link</a>"))
181157

182158
expect(html).toEqual(
183-
expect.stringContaining(
184-
// eslint-disable-next-line quotes
185-
'rel="noopener noreferrer"',
186-
),
159+
expect.stringContaining('rel="noopener noreferrer"'),
187160
)
188161

189-
expect(html).toEqual(
190-
expect.stringContaining(
191-
// eslint-disable-next-line quotes
192-
'target="_blank"',
193-
),
194-
)
162+
expect(html).toEqual(expect.stringContaining('target="_blank"'))
195163
})
196164
})

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('tailwindcss').Config} */
22

3-
const typography = require("@tailwindcss/typography")
3+
import typography from "@tailwindcss/typography"
44

55
const config = {
66
content: [

0 commit comments

Comments
 (0)