Commit f255504
chore: setup knip to lint the workspace (#555)
This pr introduce a knip config for this repo. Setting up knip with an
Nx Integrated workspace requires a bit more trickery than a regular npm
workspace, so I created a library for it. The library is still in it's
early form, but I will maintain and evolve it's api here if I make any
breaking changes.
Source for the library can be found
[here](https://github.com/beaussan/nx-tools/tree/main/packages/nx-knip).
To see the generated knip config, you can run `DEBUG=true npm run knip`,
it's traversing Nx's graph of library, executors and configuration to
infer a knip config dynamically.
Running knip on this repo yeild the following output :
```
Unused files (4)
packages/cli/code-pushup.config.mock.ts
packages/plugin-lighthouse/src/index.ts
testing/test-utils/src/lib/fixtures/configs/code-pushup.config.js
testing/test-utils/src/lib/fixtures/configs/code-pushup.empty.config.js
Unused devDependencies (15)
@nodelib/fs.walk package.json
@trivago/prettier-plugin-sort-imports package.json
@types/benchmark package.json
benchmark package.json
commitlint-plugin-tense package.json
conventional-changelog-angular package.json
eslint-plugin-jsx-a11y package.json
eslint-plugin-react package.json
eslint-plugin-react-hooks package.json
fast-glob package.json
glob package.json
globby package.json
jsonc package.json
ngx-deploy-npm package.json
tsx package.json
Unlisted dependencies (16)
jsonc-eslint-parser .eslintrc.json
@commitlint/types commitlint.config.js
jsonc-eslint-parser e2e/cli-e2e/.eslintrc.json
jsonc-eslint-parser packages/cli/.eslintrc.json
jsonc-eslint-parser packages/core/.eslintrc.json
jsonc-eslint-parser packages/models/.eslintrc.json
jsonc-eslint-parser packages/nx-plugin/.eslintrc.json
jsonc-eslint-parser packages/plugin-coverage/.eslintrc.json
jsonc-eslint-parser packages/plugin-eslint/.eslintrc.json
jsonc-eslint-parser packages/plugin-lighthouse/.eslintrc.json
jsonc-eslint-parser packages/utils/.eslintrc.json
jsonc-eslint-parser testing/test-setup/.eslintrc.json
jsonc-eslint-parser testing/test-utils/.eslintrc.json
@nx/eslint/src/executors/lint/schema tools/eslint-to-code-pushup.mjs
minimatch tools/eslint-to-code-pushup.mjs
tslib tsconfig.base.json
Unused exports (24)
renderUploadAutorunHint function packages/cli/src/lib/collect/collect-command.ts:45:17
yargsPersistConfigOptionsDefinition function packages/cli/src/lib/implementation/core-config.options.ts:17:17
yargsUploadConfigOptionsDefinition function packages/cli/src/lib/implementation/core-config.options.ts:37:17
singletonUiInstance unknown packages/cli/src/lib/implementation/logging.ts:8:12
duplicateRefsInCategoryMetricsErrorMsg function packages/models/src/lib/category-config.ts:54:17
unrefinedCoreConfigSchema unknown packages/models/src/lib/core-config.ts:11:14
refineCoreConfig function packages/models/src/lib/core-config.ts:32:17
groupMetaSchema unknown packages/models/src/lib/group.ts:20:14
weightSchema unknown packages/models/src/lib/implementation/schemas.ts:132:14
descriptionSchema unknown packages/models/src/lib/implementation/schemas.ts:40:14
docsUrlSchema unknown packages/models/src/lib/implementation/schemas.ts:49:14
titleSchema unknown packages/models/src/lib/implementation/schemas.ts:55:14
pluginDataSchema unknown packages/models/src/lib/plugin-config.ts:30:14
coverageTypeSchema unknown packages/plugin-coverage/src/lib/config.ts:3:14
coverageResultSchema unknown packages/plugin-coverage/src/lib/config.ts:6:14
WORKDIR unknown packages/plugin-eslint/src/lib/runner/index.ts:9:14
NoExportError class packages/utils/src/lib/file-system.ts:78:14
messageStyles unknown packages/utils/src/lib/progress.ts:13:14
h function packages/utils/src/lib/reports/md/headline.ts:13:17
h4 function packages/utils/src/lib/reports/md/headline.ts:25:17
h5 function packages/utils/src/lib/reports/md/headline.ts:29:17
h6 function packages/utils/src/lib/reports/md/headline.ts:33:17
GroupRefInvalidError class packages/utils/src/lib/reports/scoring.ts:10:14
throwIsNotPresentError function packages/utils/src/lib/reports/utils.ts:233:17
Unused exported types (7)
CliUi type packages/cli/src/lib/implementation/logging.ts:5:13
GroupMeta type packages/models/src/lib/group.ts:26:13
LighthouseCliOptions type packages/plugin-lighthouse/src/lib/utils.ts:11:13
FontStyle type packages/utils/src/lib/reports/md/font-style.ts:8:13
Hierarchy type packages/utils/src/lib/reports/md/headline.ts:2:13
Order type packages/utils/src/lib/reports/md/list.ts:1:13
ScoredCategoryConfig type packages/utils/src/lib/reports/types.ts:9:13
Duplicate exports (2)
addToProjectGenerator, default packages/nx-plugin/src/generators/configuration/generator.ts
initGenerator, default packages/nx-plugin/src/generators/init/generator.ts
```
---------
Co-authored-by: Michael <michael.hladky@push-based.io>
Co-authored-by: Michael Hladky <10064416+BioPhoton@users.noreply.github.com>1 parent cbb5797 commit f255504
3 files changed
Lines changed: 1399 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
0 commit comments