knip 2.32.3 → 2.32.4

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.
@@ -7,19 +7,21 @@ export const ENABLERS = ['ava'];
7
7
  export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
8
8
  export const CONFIG_FILE_PATTERNS = ['ava.config.{js,cjs,mjs}', 'package.json'];
9
9
  export const ENTRY_FILE_PATTERNS = [
10
- `test.{js,cjs,mjs}`,
11
- `{src,source}/test.{js,cjs,mjs}`,
12
- `**/__tests__/**/*.{js,cjs,mjs}`,
13
- `**/*.spec.{js,cjs,mjs}`,
14
- `**/*.test.{js,cjs,mjs}`,
15
- `**/test-*.{js,cjs,mjs}`,
16
- `**/test/**/*.{js,cjs,mjs}`,
17
- `**/tests/**/*.{js,cjs,mjs}`,
10
+ `test.{js,cjs,mjs,ts}`,
11
+ `{src,source}/test.{js,cjs,mjs,ts}`,
12
+ `**/__tests__/**/*.{js,cjs,mjs,ts}`,
13
+ `**/*.spec.{js,cjs,mjs,ts}`,
14
+ `**/*.test.{js,cjs,mjs,ts}`,
15
+ `**/test-*.{js,cjs,mjs,ts}`,
16
+ `**/test/**/*.{js,cjs,mjs,ts}`,
17
+ `**/tests/**/*.{js,cjs,mjs,ts}`,
18
18
  '!**/__tests__/**/__{helper,fixture}?(s)__/**/*',
19
19
  '!**/test?(s)/**/{helper,fixture}?(s)/**/*',
20
20
  ];
21
21
  const findAvaDependencies = async (configFilePath, { cwd, manifest, isProduction }) => {
22
- const config = configFilePath.endsWith('package.json') ? manifest.ava : await load(configFilePath);
22
+ let config = configFilePath.endsWith('package.json') ? manifest.ava : await load(configFilePath);
23
+ if (typeof config === 'function')
24
+ config = config();
23
25
  const entryPatterns = (config?.files ?? ENTRY_FILE_PATTERNS).map(toEntryPattern);
24
26
  if (isProduction)
25
27
  return entryPatterns;
@@ -1,5 +1,8 @@
1
- export type PluginConfig = {
1
+ type Config = {
2
2
  files?: string[];
3
3
  require?: string[];
4
4
  nodeArguments?: string[];
5
+ extensions?: string[];
5
6
  };
7
+ export type AvaConfig = Config | (() => Config);
8
+ export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.32.3";
1
+ export declare const version = "2.32.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.32.3';
1
+ export const version = '2.32.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.32.3",
3
+ "version": "2.32.4",
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",