Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Knip CI #57

Merged
merged 7 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Knip

on:
pull_request:

permissions: write-all

jobs:
run-knip:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.10.x

- name: Install toolchain
run: yarn install

- name: Report knip results to pull request
uses: Codex-/knip-reporter@v2
with:
verbose: true
comment_id: ${{ github.workflow }}-reporter
command_script_name: knip-ci
annotations: true
ignore_results: false
4 changes: 0 additions & 4 deletions knip.json

This file was deleted.

11 changes: 11 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts"],
ignoreExportsUsedInFile: true,
ignoreDependencies: [],
};

export default config;
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"build:serverless": "ncc build src/index.ts -o ./",
"build": "tsc",
"clean": "rimraf ./dist ./node_modules",
"knip": "knip",
"knip-ci": "knip --no-exit-code --reporter json",
"preformat": "yarn lint:prettier",
"format": "yarn lint:eslint",
"lint": "yarn lint:prettier:check && yarn lint:eslint",
Expand Down Expand Up @@ -74,16 +76,16 @@
"@types/libsodium-wrappers": "^0.7.10",
"@types/lodash": "^4.14.197",
"@types/markdown-it": "^13.0.4",
"@types/node": "^14.18.37",
"@types/node": "^18.0.0",
"@types/source-map-support": "^0.5.6",
"eslint": "^8.43.0",
"jest": "^29.6.2",
"knip": "^2.33.4",
"knip": "^3.7.1",
"octokit": "^3.1.2",
"rimraf": "3.0.2",
"source-map-support": "^0.5.21",
"ts-jest": "^29.1.1",
"typescript": "^4.9.5"
"typescript": "^5.0.4"
},
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
"sourceMap": true
},
"include": ["src/"],
"exclude": ["src/coverage/"],
"exclude": ["src/coverage/", "knip.ts"],
"compileOnSave": false
}
Loading