Skip to content
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
21 changes: 0 additions & 21 deletions .depcheckrc.json

This file was deleted.

29 changes: 29 additions & 0 deletions knip.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { KnipConfig } from 'knip';

const config: KnipConfig = {
entry: [
'src/**/*.{ts,mts}',
'.github/scripts/**/*.{mts,mjs,js,ts}',
'.github/actions/**/*.{mjs,js}',
'*.config.{js,cjs,mjs,ts,mts}',
],
project: [
'src/**/*.{ts,mts}',
'.github/scripts/**/*.{mts,mjs,js,ts}',
'.github/actions/**/*.{mjs,js}',
'*.{js,cjs,mjs,ts,mts}',
],
ignoreDependencies: [
// Used by Yarn through the `allow-scripts` plugin and the `lavamoat`
// field in `package.json`, which knip does not trace.
'@lavamoat/allow-scripts',
'@lavamoat/preinstall-always-fail',

// Provided by the GitHub Actions runner, which is where
// `.github/scripts/remove-rca-needed-label-sheets.ts` runs.
'@actions/core',
'@actions/github',
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type-aware lint package not ignored

Medium Severity

oxlint-tsgolint was dropped from the ignore list even though oxlint loads it through options.typeAware, not an import. Knip’s oxlint plugin does not trace that setting, so lint:dependencies can report a required lint backend as unused.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f13b8ee. Configure here.

};

export default config;
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lint": "yarn lint:tsc && yarn lint:oxlint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check",
"lint:changelog": "auto-changelog validate --prettier",
"lint:constraints": "yarn constraints",
"lint:dependencies": "depcheck && yarn dedupe",
"lint:dependencies": "knip --config knip.config.mts --dependencies && yarn dedupe",
"lint:fix": "yarn lint:oxlint --fix --prune-suppressions && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies",
"lint:misc": "oxfmt --ignore-path .gitignore",
"lint:oxlint": "oxlint",
Expand Down Expand Up @@ -56,15 +56,14 @@
"@metamask/oxlint-config-nodejs": "^0.2.0",
"@metamask/oxlint-config-typescript": "^0.2.0",
"@metamask/oxlint-config-vitest": "^0.2.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.80",
"@types/node": "^22.13.14",
"@types/semver": "^7",
"@types/unzipper": "^0",
"@vitest/coverage-v8": "^5.1.0",
"@yarnpkg/types": "^4.0.0",
"depcheck": "^1.4.3",
"eslint-plugin-n": "^18.5.0",
"knip": "^6.39.0",
"oxfmt": "^0.72.0",
"oxlint": "^1.93.0",
"oxlint-tsgolint": "^7.0.2006",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"include": [
"src",
"knip.config.mts",
"oxlint.config.mts",
"yarn.config.cjs",
".github/scripts/**/*.mts"
Expand Down
Loading
Loading