@kitschpatrol/knip-config 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +16 -16
- package/dist/index.js +10 -10
- package/package.json +9 -8
- package/readme.md +15 -15
package/bin/cli.js
CHANGED
|
@@ -5138,7 +5138,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
5138
5138
|
var yargs_default = Yargs;
|
|
5139
5139
|
|
|
5140
5140
|
// ../../package.json
|
|
5141
|
-
var version = "5.
|
|
5141
|
+
var version = "5.7.0";
|
|
5142
5142
|
|
|
5143
5143
|
// ../../src/execa-utilities.ts
|
|
5144
5144
|
function isErrorExecaError(error) {
|
|
@@ -5184,7 +5184,7 @@ function stringify(passedObj, options = {}) {
|
|
|
5184
5184
|
).slice(2, -3);
|
|
5185
5185
|
const maxLength = indent === "" ? Infinity : options.maxLength === void 0 ? 80 : options.maxLength;
|
|
5186
5186
|
let { replacer } = options;
|
|
5187
|
-
return function _stringify(obj, currentIndent, reserved) {
|
|
5187
|
+
return (function _stringify(obj, currentIndent, reserved) {
|
|
5188
5188
|
if (obj && typeof obj.toJSON === "function") {
|
|
5189
5189
|
obj = obj.toJSON();
|
|
5190
5190
|
}
|
|
@@ -5250,7 +5250,7 @@ ${currentIndent}`
|
|
|
5250
5250
|
}
|
|
5251
5251
|
}
|
|
5252
5252
|
return string;
|
|
5253
|
-
}(passedObj, "", 0);
|
|
5253
|
+
})(passedObj, "", 0);
|
|
5254
5254
|
}
|
|
5255
5255
|
|
|
5256
5256
|
// ../../src/json-utilities.ts
|
|
@@ -5831,17 +5831,17 @@ var sharedKnipConfig = {
|
|
|
5831
5831
|
"prettier.config.{js,mjs,cjs,ts,mts,cts}",
|
|
5832
5832
|
"stylelint.config.{js,mjs,cjs,ts,mts,cts}"
|
|
5833
5833
|
],
|
|
5834
|
-
// Allow calling of individual
|
|
5834
|
+
// Allow calling of individual ksc binaries...
|
|
5835
5835
|
ignoreBinaries: [
|
|
5836
|
-
"
|
|
5837
|
-
"
|
|
5838
|
-
"
|
|
5839
|
-
"
|
|
5840
|
-
"
|
|
5841
|
-
"
|
|
5842
|
-
"
|
|
5843
|
-
"
|
|
5844
|
-
"
|
|
5836
|
+
"ksc-repo",
|
|
5837
|
+
"ksc-mdat",
|
|
5838
|
+
"ksc-typescript",
|
|
5839
|
+
"ksc-eslint",
|
|
5840
|
+
"ksc-stylelint",
|
|
5841
|
+
"ksc-cspell",
|
|
5842
|
+
"ksc-knip",
|
|
5843
|
+
"ksc-remark",
|
|
5844
|
+
"ksc-prettier",
|
|
5845
5845
|
// 1Password CLI, typically a global install...
|
|
5846
5846
|
"op",
|
|
5847
5847
|
// GitHub CLI, typically a global install...
|
|
@@ -5891,8 +5891,8 @@ function getKnipPackageJsonObject() {
|
|
|
5891
5891
|
var commandDefinition = {
|
|
5892
5892
|
commands: {
|
|
5893
5893
|
// In practice, Knip's auto-fix behavior is too dangerous for most projects.
|
|
5894
|
-
// Since
|
|
5895
|
-
// just disable `
|
|
5894
|
+
// Since ksc doesn't currently have per-tool configuration options, we'll
|
|
5895
|
+
// just disable `ksc-knip fix` for now.
|
|
5896
5896
|
//
|
|
5897
5897
|
// fix: {
|
|
5898
5898
|
// commands: [
|
|
@@ -5944,7 +5944,7 @@ var commandDefinition = {
|
|
|
5944
5944
|
description: "Kitschpatrol's Knip shared configuration tools.",
|
|
5945
5945
|
logColor: "cyan",
|
|
5946
5946
|
logPrefix: "[Knip]",
|
|
5947
|
-
name: "
|
|
5947
|
+
name: "ksc-knip",
|
|
5948
5948
|
order: 7
|
|
5949
5949
|
};
|
|
5950
5950
|
|
package/dist/index.js
CHANGED
|
@@ -18,17 +18,17 @@ const sharedKnipConfig = {
|
|
|
18
18
|
'prettier.config.{js,mjs,cjs,ts,mts,cts}',
|
|
19
19
|
'stylelint.config.{js,mjs,cjs,ts,mts,cts}',
|
|
20
20
|
],
|
|
21
|
-
// Allow calling of individual
|
|
21
|
+
// Allow calling of individual ksc binaries...
|
|
22
22
|
ignoreBinaries: [
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
23
|
+
'ksc-repo',
|
|
24
|
+
'ksc-mdat',
|
|
25
|
+
'ksc-typescript',
|
|
26
|
+
'ksc-eslint',
|
|
27
|
+
'ksc-stylelint',
|
|
28
|
+
'ksc-cspell',
|
|
29
|
+
'ksc-knip',
|
|
30
|
+
'ksc-remark',
|
|
31
|
+
'ksc-prettier',
|
|
32
32
|
// 1Password CLI, typically a global install...
|
|
33
33
|
'op',
|
|
34
34
|
// GitHub CLI, typically a global install...
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/knip-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"description": "Knip configuration for @kitschpatrol/shared-config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
7
7
|
"knip-config",
|
|
8
8
|
"knip",
|
|
9
9
|
"cli",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"ksc",
|
|
11
|
+
"ksc-knip"
|
|
12
12
|
],
|
|
13
13
|
"homepage": "https://github.com/kitschpatrol/shared-config/tree/main/packages/knip-config",
|
|
14
14
|
"bugs": "https://github.com/kitschpatrol/shared-config/issues",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"main": "dist/index.js",
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"bin": {
|
|
36
|
-
"kpi-knip": "bin/cli.js"
|
|
36
|
+
"kpi-knip": "bin/cli.js",
|
|
37
|
+
"ksc-knip": "bin/cli.js"
|
|
37
38
|
},
|
|
38
39
|
"files": [
|
|
39
40
|
"dist/*",
|
|
@@ -47,12 +48,12 @@
|
|
|
47
48
|
"deepmerge-ts": "^7.1.5",
|
|
48
49
|
"execa": "^9.6.0",
|
|
49
50
|
"find-workspaces": "^0.3.1",
|
|
50
|
-
"fs-extra": "^11.3.
|
|
51
|
-
"knip": "^5.
|
|
52
|
-
"prettier": "^3.
|
|
51
|
+
"fs-extra": "^11.3.1",
|
|
52
|
+
"knip": "^5.63.1",
|
|
53
|
+
"prettier": "^3.6.2"
|
|
53
54
|
},
|
|
54
55
|
"engines": {
|
|
55
|
-
"node": ">=20.
|
|
56
|
+
"node": ">=20.19.0"
|
|
56
57
|
},
|
|
57
58
|
"publishConfig": {
|
|
58
59
|
"access": "public"
|
package/readme.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## Overview
|
|
23
23
|
|
|
24
|
-
It's a shared [Knip](https://knip.dev) config, plus a command-line tool `
|
|
24
|
+
It's a shared [Knip](https://knip.dev) config, plus a command-line tool `ksc-knip` to perform Knip-related project initialization, linting, and fixing.
|
|
25
25
|
|
|
26
26
|
<!-- recommendation -->
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ It's a shared [Knip](https://knip.dev) config, plus a command-line tool `kpi-kni
|
|
|
29
29
|
>
|
|
30
30
|
> **You can use this package on its own, but it's recommended to use [`@kitschpatrol/shared-config`](https://www.npmjs.com/package/@kitschpatrol/shared-config) instead for a single-dependency and single-package approach to linting and fixing your project.**
|
|
31
31
|
>
|
|
32
|
-
> This package is included as a dependency in [`@kitschpatrol/shared-config`](https://www.npmjs.com/package/@kitschpatrol/shared-config), which also automatically invokes the command line functionality in this package via its `
|
|
32
|
+
> This package is included as a dependency in [`@kitschpatrol/shared-config`](https://www.npmjs.com/package/@kitschpatrol/shared-config), which also automatically invokes the command line functionality in this package via its `ksc` command
|
|
33
33
|
|
|
34
34
|
<!-- /recommendation -->
|
|
35
35
|
|
|
@@ -52,7 +52,7 @@ To use just this Knip config in isolation:
|
|
|
52
52
|
3. Add the starter `knip.config.ts` files to your project root, and add any customizations you'd like:
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
|
-
pnpm exec
|
|
55
|
+
pnpm exec ksc-knip init
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Usage
|
|
@@ -62,7 +62,7 @@ Integrate with your `package.json` scripts as you see fit, for example:
|
|
|
62
62
|
```json
|
|
63
63
|
{
|
|
64
64
|
"scripts": {
|
|
65
|
-
"lint": "
|
|
65
|
+
"lint": "ksc-knip lint"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
```
|
|
@@ -72,7 +72,7 @@ Integrate with your `package.json` scripts as you see fit, for example:
|
|
|
72
72
|
To create a `knip.config.ts` in your project root:
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
|
-
pnpm exec
|
|
75
|
+
pnpm exec ksc-knip init
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
(Note that this will delete the `knip` property in your `package.json`!)
|
|
@@ -82,7 +82,7 @@ _Or_
|
|
|
82
82
|
To create a `knip` property in `package.json`:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
pnpm exec
|
|
85
|
+
pnpm exec ksc-knip init --location package
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
(Note that this will delete the `knip.config.ts` file in your project root!)
|
|
@@ -91,16 +91,16 @@ pnpm exec kpi-knip init --location package
|
|
|
91
91
|
|
|
92
92
|
<!-- cli-help -->
|
|
93
93
|
|
|
94
|
-
#### Command: `
|
|
94
|
+
#### Command: `ksc-knip`
|
|
95
95
|
|
|
96
96
|
Kitschpatrol's Knip shared configuration tools.
|
|
97
97
|
|
|
98
|
-
This section lists top-level commands for `
|
|
98
|
+
This section lists top-level commands for `ksc-knip`.
|
|
99
99
|
|
|
100
100
|
Usage:
|
|
101
101
|
|
|
102
102
|
```txt
|
|
103
|
-
|
|
103
|
+
ksc-knip <command>
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
| Command | Description |
|
|
@@ -116,14 +116,14 @@ kpi-knip <command>
|
|
|
116
116
|
|
|
117
117
|
_See the sections below for more information on each subcommand._
|
|
118
118
|
|
|
119
|
-
#### Subcommand: `
|
|
119
|
+
#### Subcommand: `ksc-knip init`
|
|
120
120
|
|
|
121
121
|
Initialize by copying starter config files to your project root or to your package.json file.
|
|
122
122
|
|
|
123
123
|
Usage:
|
|
124
124
|
|
|
125
125
|
```txt
|
|
126
|
-
|
|
126
|
+
ksc-knip init
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
| Option | Description | Type | Default |
|
|
@@ -132,14 +132,14 @@ kpi-knip init
|
|
|
132
132
|
| `--help`<br>`-h` | Show help | `boolean` | |
|
|
133
133
|
| `--version`<br>`-v` | Show version number | `boolean` | |
|
|
134
134
|
|
|
135
|
-
#### Subcommand: `
|
|
135
|
+
#### Subcommand: `ksc-knip lint`
|
|
136
136
|
|
|
137
137
|
Check for unused code and dependencies. Package-scoped. In a monorepo, it will also run in all packages below the current working directory.
|
|
138
138
|
|
|
139
139
|
Usage:
|
|
140
140
|
|
|
141
141
|
```txt
|
|
142
|
-
|
|
142
|
+
ksc-knip lint
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
| Option | Description | Type |
|
|
@@ -147,14 +147,14 @@ kpi-knip lint
|
|
|
147
147
|
| `--help`<br>`-h` | Show help | `boolean` |
|
|
148
148
|
| `--version`<br>`-v` | Show version number | `boolean` |
|
|
149
149
|
|
|
150
|
-
#### Subcommand: `
|
|
150
|
+
#### Subcommand: `ksc-knip print-config`
|
|
151
151
|
|
|
152
152
|
Print the effective Knip configuration. Package-scoped. Searches up to the root of a monorepo if necessary.
|
|
153
153
|
|
|
154
154
|
Usage:
|
|
155
155
|
|
|
156
156
|
```txt
|
|
157
|
-
|
|
157
|
+
ksc-knip print-config
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
| Option | Description | Type |
|