knip 5.7.2 → 5.8.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/dist/plugins/next/index.js +1 -1
- package/dist/typescript/visitors/exports/exportsAccessExpression.d.ts +3 -0
- package/dist/typescript/visitors/exports/exportsAccessExpression.js +20 -0
- package/dist/typescript/visitors/exports/index.js +8 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -32
|
@@ -7,7 +7,7 @@ const productionEntryFilePatternsWithoutSrc = [
|
|
|
7
7
|
'{instrumentation,middleware}.{js,ts}',
|
|
8
8
|
'app/global-error.{js,jsx,ts,tsx}',
|
|
9
9
|
'app/**/{error,layout,loading,not-found,page,template,default}.{js,jsx,ts,tsx}',
|
|
10
|
-
'app/**/
|
|
10
|
+
'app/**/route.{js,ts}',
|
|
11
11
|
'app/{manifest,sitemap,robots}.{js,ts}',
|
|
12
12
|
'app/**/{icon,apple-icon}.{js,jsx,ts,tsx}',
|
|
13
13
|
'app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}',
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
declare const _default: (sourceFile: ts.SourceFile) => (node: ts.Node, options: import("#p/typescript/getImportsAndExports.ts").GetImportsAndExportsOptions) => import("../../../types/exports.js").ExportNode | import("../../../types/exports.js").ExportNode[] | undefined;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { SymbolType } from '../../../types/issues.js';
|
|
3
|
+
import { isJS } from '../helpers.js';
|
|
4
|
+
import { exportVisitor as visit } from '../index.js';
|
|
5
|
+
export default visit(isJS, (node, { isFixExports }) => {
|
|
6
|
+
if (ts.isBinaryExpression(node) && ts.isPropertyAccessExpression(node.left)) {
|
|
7
|
+
if (ts.isIdentifier(node.left.expression) && node.left.expression.escapedText === 'exports') {
|
|
8
|
+
const identifier = node.left.name.getText();
|
|
9
|
+
const pos = node.left.name.pos;
|
|
10
|
+
const fix = isFixExports ? [node.getStart(), node.getEnd()] : undefined;
|
|
11
|
+
return {
|
|
12
|
+
node: node.left.name,
|
|
13
|
+
identifier,
|
|
14
|
+
type: SymbolType.UNKNOWN,
|
|
15
|
+
pos,
|
|
16
|
+
fix,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -2,6 +2,13 @@ import ts from 'typescript';
|
|
|
2
2
|
import exportAssignment from './exportAssignment.js';
|
|
3
3
|
import exportDeclaration from './exportDeclaration.js';
|
|
4
4
|
import exportKeyword from './exportKeyword.js';
|
|
5
|
+
import exportsAccessExpression from './exportsAccessExpression.js';
|
|
5
6
|
import moduleExportsAccessExpression from './moduleExportsAccessExpression.js';
|
|
6
|
-
const visitors = [
|
|
7
|
+
const visitors = [
|
|
8
|
+
exportAssignment,
|
|
9
|
+
exportDeclaration,
|
|
10
|
+
exportKeyword,
|
|
11
|
+
exportsAccessExpression,
|
|
12
|
+
moduleExportsAccessExpression,
|
|
13
|
+
];
|
|
7
14
|
export default (sourceFile) => visitors.map(v => v(sourceFile));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.8.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.8.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://knip.dev",
|
|
6
6
|
"repository": {
|
|
@@ -72,32 +72,32 @@
|
|
|
72
72
|
"micromatch": "4.0.5",
|
|
73
73
|
"minimist": "1.2.8",
|
|
74
74
|
"picocolors": "1.0.0",
|
|
75
|
-
"picomatch": "4.0.1",
|
|
75
|
+
"picomatch": "^4.0.1",
|
|
76
76
|
"pretty-ms": "9.0.0",
|
|
77
77
|
"resolve": "1.22.8",
|
|
78
78
|
"smol-toml": "1.1.4",
|
|
79
79
|
"strip-json-comments": "5.0.1",
|
|
80
80
|
"summary": "2.1.0",
|
|
81
|
-
"zod": "3.22.4",
|
|
82
|
-
"zod-validation-error": "3.0.3"
|
|
81
|
+
"zod": "^3.22.4",
|
|
82
|
+
"zod-validation-error": "^3.0.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@types/node": ">=18",
|
|
86
86
|
"typescript": ">=5.0.4"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@jest/types": "29.6.3",
|
|
89
|
+
"@jest/types": "^29.6.3",
|
|
90
90
|
"@knip/eslint-config": "0.0.0",
|
|
91
91
|
"@release-it/bumper": "^6.0.1",
|
|
92
92
|
"@swc/cli": "^0.3.10",
|
|
93
93
|
"@swc/core": "^1.4.6",
|
|
94
|
-
"@types/bun": "1.0.8",
|
|
94
|
+
"@types/bun": "^1.0.8",
|
|
95
95
|
"@types/js-yaml": "^4.0.9",
|
|
96
96
|
"@types/micromatch": "^4.0.6",
|
|
97
97
|
"@types/minimist": "^1.2.5",
|
|
98
98
|
"@types/npmcli__map-workspaces": "^3.0.4",
|
|
99
99
|
"@types/npmcli__package-json": "^4.0.4",
|
|
100
|
-
"@types/resolve": "1.20.6",
|
|
100
|
+
"@types/resolve": "^1.20.6",
|
|
101
101
|
"@types/webpack": "^5.28.5",
|
|
102
102
|
"c8": "9.1.0",
|
|
103
103
|
"eslint": "^8.57.0",
|
|
@@ -112,31 +112,6 @@
|
|
|
112
112
|
"node": ">=18.6.0"
|
|
113
113
|
},
|
|
114
114
|
"engineStrict": true,
|
|
115
|
-
"release-it": {
|
|
116
|
-
"hooks": {
|
|
117
|
-
"before:init": [
|
|
118
|
-
"npm run lint",
|
|
119
|
-
"npm run build",
|
|
120
|
-
"npm run knip",
|
|
121
|
-
"npm run knip:production",
|
|
122
|
-
"npm test"
|
|
123
|
-
],
|
|
124
|
-
"after:bump": [
|
|
125
|
-
"git add ../../package-lock.json"
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
"github": {
|
|
129
|
-
"release": true,
|
|
130
|
-
"comments": {
|
|
131
|
-
"submit": true
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"plugins": {
|
|
135
|
-
"@release-it/bumper": {
|
|
136
|
-
"out": "{dist,src}/version.*"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
115
|
"keywords": [
|
|
141
116
|
"analysis",
|
|
142
117
|
"analyze",
|