Skip to content

Commit d1570db

Browse files
committed
chore: add knip and clean up unused packages
Also update lint.yml.
1 parent a0ef4b8 commit d1570db

File tree

9 files changed

+229
-285
lines changed

9 files changed

+229
-285
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ jobs:
1919
- name: Install NPM packages
2020
run: yarn install --frozen-lockfile
2121

22-
- name: Run linters
23-
uses: wearerequired/lint-action@v2
24-
with:
25-
eslint: true
26-
eslint_args: --max-warnings 0
27-
eslint_extensions: js,ts,tsx
28-
prettier: true
29-
continue_on_error: false
22+
- name: Check code style
23+
run: yarn lint --max-warnings 0
24+
25+
- name: Check formatting
26+
run: yarn prettier . --check
27+
28+
- name: Check clutter
29+
run: yarn knip
30+
31+
- name: Check that TypeScript compiles
32+
run: yarn tsc

knip.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"project": ["**/*.{js,ts}"],
3+
"entry": ["src/index.ts", "src/generate-api-docs.ts"],
4+
"ignore": ["apidocs/*"],
5+
"ignoreDependencies": ["@types/co-body"],
6+
"ignoreBinaries": ["openssl"]
7+
}

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,32 @@
77
"start": "yarn build && node dist/index.js",
88
"build": "rm -rf dist && tsc --project tsconfig.production.json && yarn copy-hbs",
99
"copy-hbs": "cp src/templates/*.hbs dist/templates && cp src/templates/*.css dist/templates",
10-
"format": "prettier 'src/**/*.ts' '**/*.{md,yml,yaml,json}' --write",
10+
"format": "prettier . --write",
1111
"lint": "eslint . --ext .ts",
1212
"test": "NODE_ENV=vitest vitest",
1313
"generate-key": "openssl ecparam -name prime256v1 -genkey -noout -out ecdsa-p256-private.pem",
14-
"generate-api-docs": "tsc && node dist/generate-api-docs.js"
14+
"generate-api-docs": "tsc && node dist/generate-api-docs.js",
15+
"knip": "knip"
1516
},
1617
"license": "MIT",
1718
"devDependencies": {
1819
"@solid/community-server": "^7.0.2",
19-
"@types/chai": "^4.3.5",
2020
"@types/maildev": "^0.0.7",
21-
"@types/sinon": "^10.0.15",
2221
"@typescript-eslint/eslint-plugin": "^6.0.0",
2322
"@typescript-eslint/parser": "^6.19.0",
24-
"chai": "^4.3.7",
2523
"cheerio": "^1.0.0-rc.12",
2624
"cross-fetch": "^4.0.0",
2725
"eslint": "^8.13.0",
2826
"eslint-config-prettier": "^8.5.0",
2927
"eslint-import-resolver-typescript": "^3.6.1",
3028
"eslint-plugin-import": "^2.29.1",
3129
"eslint-plugin-prettier": "^5.0.0",
30+
"knip": "^5.43.6",
3231
"maildev": "^2.1.0",
3332
"msw": "^2.0.14",
3433
"prettier": "^3.0.0",
3534
"puppeteer": "^22.2.0",
36-
"sinon": "^15.2.0",
3735
"swagger-autogen": "^2.23.6",
38-
"ts-node": "^10.9.1",
3936
"vitest": "^3.0.4"
4037
},
4138
"dependencies": {

src/templates/layout.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
<a href='mailto:{{supportEmail}}'>{{supportEmail}}</a></p>
1616
</footer>
1717
</body>
18-
</html>
18+
</html>

src/templates/message.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
class='action-button'
1616
>Reply on
1717
{{appName}}</a>
18-
</p>
18+
</p>

src/templates/verification.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
{{appName}}
2121
was initialized by Solid identity
2222
{{actor}}. If you've received this message unexpectedly and you believe it to
23-
be an error, please ignore it, or contact us for support.</p>
23+
be an error, please ignore it, or contact us for support.</p>

src/test/helpers/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as cheerio from 'cheerio'
22
import { createAccount } from 'css-authn/dist/7.x.js'
3+
import { randomUUID } from 'node:crypto'
34
import * as puppeteer from 'puppeteer'
4-
import { v4 as uuidv4 } from 'uuid'
55
import { expect, vi } from 'vitest'
66
import * as config from '../../config/index.js'
77
import * as mailerService from '../../services/mailerService.js'
@@ -14,9 +14,9 @@ export const createRandomAccount = ({
1414
solidServer: string
1515
}) => {
1616
return createAccount({
17-
username: uuidv4(),
18-
password: uuidv4(),
19-
email: uuidv4() + '@example.com',
17+
username: randomUUID(),
18+
password: randomUUID(),
19+
email: randomUUID() + '@example.com',
2020
provider: solidServer,
2121
})
2222
}

src/types.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)