Skip to content

Commit

Permalink
Merge pull request #2 from gitcoindev/knip-ci-org-fix
Browse files Browse the repository at this point in the history
Knip ci org fix
  • Loading branch information
gitcoindev authored Jan 2, 2024
2 parents 3ca8fad + b3f8aac commit d8f7c37
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Knip

on:
pull_request_target:

permissions:
checks: write
issues: write
pull-requests: write

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 @@ -76,16 +78,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
}

0 comments on commit d8f7c37

Please sign in to comment.