knip 5.3.0 → 5.3.1
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/index.js
CHANGED
|
@@ -185,6 +185,7 @@ export const main = async (unresolvedConfiguration) => {
|
|
|
185
185
|
isFixExports: fixer.isEnabled && fixer.isFixUnusedExports,
|
|
186
186
|
isFixTypes: fixer.isEnabled && fixer.isFixUnusedTypes,
|
|
187
187
|
ignoreExportsUsedInFile: Boolean(chief.config.ignoreExportsUsedInFile),
|
|
188
|
+
isReportClassMembers,
|
|
188
189
|
tags,
|
|
189
190
|
});
|
|
190
191
|
const { internal, external, unresolved } = imports;
|
|
@@ -3,7 +3,7 @@ import { SymbolType } from '../../../types/issues.js';
|
|
|
3
3
|
import { compact } from '../../../util/array.js';
|
|
4
4
|
import { isGetOrSetAccessorDeclaration, isPrivateMember, stripQuotes } from '../../ast-helpers.js';
|
|
5
5
|
import { exportVisitor as visit } from '../index.js';
|
|
6
|
-
export default visit(() => true, (node, { isFixExports, isFixTypes }) => {
|
|
6
|
+
export default visit(() => true, (node, { isFixExports, isFixTypes, isReportClassMembers }) => {
|
|
7
7
|
const exportKeyword = node.modifiers?.find(mod => mod.kind === ts.SyntaxKind.ExportKeyword);
|
|
8
8
|
if (exportKeyword) {
|
|
9
9
|
if (ts.isVariableStatement(node)) {
|
|
@@ -67,18 +67,20 @@ export default visit(() => true, (node, { isFixExports, isFixTypes }) => {
|
|
|
67
67
|
if (ts.isClassDeclaration(node) && node.name) {
|
|
68
68
|
const identifier = defaultKeyword ? 'default' : node.name.getText();
|
|
69
69
|
const pos = (node.name ?? node).getStart();
|
|
70
|
-
const members =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
const members = isReportClassMembers
|
|
71
|
+
? node.members
|
|
72
|
+
.filter((member) => (ts.isPropertyDeclaration(member) ||
|
|
73
|
+
ts.isMethodDeclaration(member) ||
|
|
74
|
+
isGetOrSetAccessorDeclaration(member)) &&
|
|
75
|
+
!isPrivateMember(member))
|
|
76
|
+
.map(member => ({
|
|
77
|
+
node: member,
|
|
78
|
+
identifier: member.name.getText(),
|
|
79
|
+
pos: member.name.getStart() + (ts.isComputedPropertyName(member.name) ? 1 : 0),
|
|
80
|
+
type: SymbolType.MEMBER,
|
|
81
|
+
fix: undefined,
|
|
82
|
+
}))
|
|
83
|
+
: [];
|
|
82
84
|
const fix = isFixExports
|
|
83
85
|
? [exportKeyword.getStart(), (defaultKeyword ?? exportKeyword).getEnd() + 1]
|
|
84
86
|
: undefined;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.3.
|
|
1
|
+
export declare const version = "5.3.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.3.
|
|
1
|
+
export const version = '5.3.1';
|