knip 2.27.0 → 2.27.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/plugins/typescript/index.js +1 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
2
1
|
import { compact } from '../../util/array.js';
|
|
3
2
|
import { dirname, isInternal, toAbsolute } from '../../util/path.js';
|
|
4
3
|
import { timerify } from '../../util/Performance.js';
|
|
@@ -22,7 +21,6 @@ const resolveExtensibleConfig = async (configFilePath) => {
|
|
|
22
21
|
}
|
|
23
22
|
return config;
|
|
24
23
|
};
|
|
25
|
-
const jsxWithReact = [ts.JsxEmit.React, ts.JsxEmit.ReactJSX, ts.JsxEmit.ReactJSXDev, ts.JsxEmit.ReactNative];
|
|
26
24
|
export const findTypeScriptDependencies = async (configFilePath) => {
|
|
27
25
|
const compilerOptions = await loadTSConfig(configFilePath);
|
|
28
26
|
const config = await resolveExtensibleConfig(configFilePath);
|
|
@@ -34,11 +32,7 @@ export const findTypeScriptDependencies = async (configFilePath) => {
|
|
|
34
32
|
? compilerOptions.plugins.map(plugin => (typeof plugin === 'object' && 'name' in plugin ? plugin.name : ''))
|
|
35
33
|
: [];
|
|
36
34
|
const importHelpers = compilerOptions?.importHelpers ? ['tslib'] : [];
|
|
37
|
-
const jsx = compilerOptions?.jsxImportSource
|
|
38
|
-
? [compilerOptions.jsxImportSource]
|
|
39
|
-
: compilerOptions?.jsx && jsxWithReact.includes(compilerOptions.jsx)
|
|
40
|
-
? ['react']
|
|
41
|
-
: [];
|
|
35
|
+
const jsx = compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : [];
|
|
42
36
|
return compact([...extend, ...types, ...plugins, ...importHelpers, ...jsx]);
|
|
43
37
|
};
|
|
44
38
|
export const findDependencies = timerify(findTypeScriptDependencies);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.27.
|
|
1
|
+
export declare const version = "2.27.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.27.
|
|
1
|
+
export const version = '2.27.1';
|
package/package.json
CHANGED