knip 2.3.2 → 2.4.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.
@@ -6,6 +6,7 @@ const withoutPositional = parsed => [parsed.require].flat();
6
6
  const argFilters = {
7
7
  'babel-node': withPositional,
8
8
  esbuild: withPositional,
9
+ execa: withPositional,
9
10
  nodemon: withPositional,
10
11
  'ts-node': withPositional,
11
12
  zx: withPositional,
@@ -0,0 +1,3 @@
1
+ import ts from 'typescript';
2
+ declare const _default: (sourceFile: ts.SourceFile) => ((node: ts.Node, options: import("../../getImportsAndExports.js").GetImportsAndExportsOptions) => string | string[] | undefined) | undefined;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import ts from 'typescript';
2
+ import { stripQuotes } from '../../ast-helpers.js';
3
+ import { scriptVisitor as visit } from '../index.js';
4
+ export default visit(sourceFile => sourceFile.statements.some(statementImportsExeca$), node => {
5
+ if (ts.isTaggedTemplateExpression(node) && node.tag.getText() === '$') {
6
+ return stripQuotes(node.template.getText());
7
+ }
8
+ });
9
+ function statementImportsExeca$(node) {
10
+ return (ts.isImportDeclaration(node) &&
11
+ ts.isStringLiteral(node.moduleSpecifier) &&
12
+ node.moduleSpecifier.text === 'execa' &&
13
+ !!node.importClause?.namedBindings &&
14
+ ts.isNamedImports(node.importClause.namedBindings) &&
15
+ node.importClause.namedBindings.elements.some(element => element.name.text === '$'));
16
+ }
@@ -1,3 +1,4 @@
1
+ import execa from './execa.js';
1
2
  import zx from './zx.js';
2
- const visitors = [zx];
3
+ const visitors = [execa, zx];
3
4
  export default (sourceFile) => visitors.map(v => v(sourceFile)).filter(v => v);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.3.2";
1
+ export declare const version = "2.4.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.3.2';
1
+ export const version = '2.4.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://github.com/webpro/knip",
6
6
  "repository": "github:webpro/knip",
@@ -55,7 +55,7 @@
55
55
  "pretty-ms": "^8.0.0",
56
56
  "strip-json-comments": "^5.0.0",
57
57
  "summary": "^2.1.0",
58
- "typescript": "5.0.2",
58
+ "typescript": "^5.0.2",
59
59
  "zod": "^3.20.6"
60
60
  },
61
61
  "devDependencies": {
@@ -77,7 +77,7 @@
77
77
  "eslint-plugin-import": "2.27.5",
78
78
  "globstar": "1.0.0",
79
79
  "prettier": "2.8.7",
80
- "release-it": "15.9.3",
80
+ "release-it": "15.10.0",
81
81
  "remark-cli": "11.0.0",
82
82
  "remark-preset-webpro": "0.0.2",
83
83
  "tsx": "3.12.6",
@@ -99,7 +99,10 @@
99
99
  ]
100
100
  },
101
101
  "github": {
102
- "release": true
102
+ "release": true,
103
+ "comments": {
104
+ "submit": true
105
+ }
103
106
  },
104
107
  "plugins": {
105
108
  "@release-it/bumper": {