- updated examples and README to match the changes in version 11.0.0
- BREAKING CHANGE: The default export (API entry point) has been changed to be compatible with esm module (should also work with cjs)
- BREAKING CHANGE: The results (API) structure has been changed:
- OLD:
const result = { "filePath1": { /* ... */ }, "filePath2": { /* ... */ }, /* ... */ unusedFiles: { /* ... */ }, };
- NEW:
const result = { unusedExports: { "filePath1": { /* ... */ }, "filePath2": { /* ... */ }, /* ... */ }, unusedFiles: [ "filePath1", "filePath2", /*"..."*/ ] };
- fix: The scope of --ignoreTestFiles has been reduced, to make it less likely to exclude non-test files
- (internal) built using Node v20.13.1
- fix: --ignorefiles was ignoring file extensions when matching - #296
- fix: --ignoreLocallyUsed had some false positives. Detail: was incorrectly excluding when parent is variable or function declaration - #300
- fix: an extra semicolon in the setting --excludePathsFromReport should not break the filtering. #297.
- the setting excludePathsFromReport now supports regex - #293
- handle import statements that contain '.ts' or '.tsx' extensions - #281
- Add --ignoreLocallyUsed flag which means that exports which are used in the same file they are defined in won't be reported as unused
- Improve handling of transitive imports like 'a -> b -> c' especially where 'export *' is used - #216
- Improve output format when the unused item involves an 'export *'.
- Fix for import from index file via a custom path - avoids false positives on index files - #266. Now tested with more cases such as import from "foo" OR import from "foo/index" with various file extensions supported.
- ts-unused-exports npm package: Updated the version in package-lock.json
- Fixed the example using ts-unused-exports as a library via TypeScript
- Added better examples of how to use as a library, via TypeScript or JavaScript. No code was changed.
- Fix for index files that end with .js or .cjs or .mjs.
-
Allow for importing of 'x.js' files as opposed to simply 'x'. This aims towards supporting es6 and higher modules as opposed to CommonJS.
-
Add option
--findCompletelyUnusedFiles
to check for completely unused files
- Add support for running from a directory not the 'project' directory that contains tsconfig.json. (Issue #248)
- Fix handling of files ending with 'index.ts': do not always report as containing unused exports. Do allow ignoring via ignoreFile regex.
- Fix: Add support for 'extends' in tsconfig.json (Issue #102, #200)
- (Internal) Using absolute paths which is less ambiguous. Delegating tsconfig.json parsing to TypeScript.
- Package metadata related to funding and financial support, no functional or implementation changes.
- Fix false positives on Windows machines when using absolute paths (baseUrl) or aliases (paths).
- Updated the chalk dependency (no change in behavior)
- (Internal) Updated the dev dependencies, involving lot of small changes adding parentheses to lambda parameters.
- Fix --allowUnusedTypes not applying to type re-exports (Issue #180)
- Fix --allowUnusedEnums not applying to enum re-exports
- BREAKING CHANGE: Makes TypeScript a peer dependency (Issue #159)
Migration path: If you already have a version of the TypeScript compiler installed in the same spot as ts-unused-exports no migration steps are necessary (it will work out of the box). Otherwise you'll have to install the TypeScript compiler there yourself (e.g. withnpm i -D typescript
). - Fixed false positive with path aliases and sub-folders (Issue #154)
- Improved support for export * as (Issue #160)
- Add option 'exitWithUnusedTypesCount' to exit with a number indicating the total count of unused types. (Issue #172)
- Add option 'allowUnusedEnums' to skip unused enums. (Issue #165). Also fixes bug where option 'allowUnusedTypes' also turned on option 'excludeDeclarationFiles'.
- if 0 issues (0 modules with unused exports) then use the default color. (Issue #164)
- Add an option to stop writing to stdout on success: --silent
- Dependency: update
node-fetch
.
- Fix: false positives if importing from a d.ts file, and tsconfig is set to use aliases (paths).
- Fix: when dynamic import has curly braces around parameter
- Fix: false positives if importing from a d.ts file, and tsconfig is set to use either absolute paths (baseUrl) or aliases (paths).
- Fix: Dynamically import with destructuring and less whitespace
- Fix: Dynamically import to a promise (Issue #139)
- Fix: Dynamically import with lambda inside div (Issue #140)
- (Internal) Add dynamic import tests involving ternary operator
- (Internal) Using TypeScript 3.8
- Handle dynamic imports within a TSX div or fragment
- Add basic support for export * as namespace.
- Fix to make the exports analyzer more robust
- Fix to support destructured exports with renaming, like 'export const { a: a2 }'
- Fix: Dynamic import with destructuring and renaming
- Fix: Do not classify other lambdas as using a dynamic import
- Fix: Include methods when searching for dynamic imports
- Add an option to allow maximum number of issues: --maxIssues
- Fix to support destructuerd exports like 'export const { a, b }'
- Handle dynamic imports that use dereferencing
- Add options to ignore imports from certain files: --ignoreFiles, --ignoreProductionFiles, --ignoreTestFiles
- BREAKING CHANGE: renamed the option --ignorePaths to be --excludePathsFromReport
- Add option --allowUnusedTypes to skip unused types or interfaces.
- Support exports destructured from array (issue #31)
- Handle exports from within a namespace. Disabled by default, unless option --searchNamespaces is given. Note: this can affect performance on large codebases.
- (Internal) Update dependency TypeScript to 3.7.3
- (Internal) Simplify some logic, using the new optional chaining operator (?.)
- (Internal) Increase code coverage and simplify code (baseUrl defaults to '.')
- Detect dynamic imports, to avoid false reports of unused exports
- Handle the alias from 'export default as', to avoid false positives.
- (Internal) Update dependencies (except for TypeScript)
- Include
.d.ts
files when searching for unused exports. This can be disabled via the --excludeDeclarationFiles option.
- use eslint-style exit code (0 = no issues, 1 = unused exports found, 2 = exception occurred)
- (Internal) add code coverage via nyc
- (Internal) code coverage and linting are included in
npm test
- (Internal) add more unit tests, increasing the code coverage
- Limit max exit code when --exitWithCount option is used (max is 127, a signed byte)
- (Internal) add badges including: code coverage, npm package version, license, dependency status.
- (Internal) Add eslint with default rules (via typescript-eslint)
- (Internal) Fix all the linting issues
- (Internal) Replaced jasmine tests with cucumber tests
- Fix handling of import from index files, like "." or "./index.ts"
- Fix bug introduced by --showLineNumber option, where analysis throws error on more complex projects.
- Updated TypeScript dependency to 3.6.4
- If the option --showLineNumber is given, then output 1 line per unused export, with the location in the file (line number, column)
- Fix the --ignorePaths option (it was incorrectly filtering the parsed files, instead of filtering the output)
- Add comment flag to ignore some exports
- Add tsconfig paths aliases support
- Remove recursive imports check (performance on big projects)
- Use tsconfig 'paths' to resolve import paths
- Print full paths in console, with color highlighting
- Add cmd line option to ignore results from some file paths
- By default, the process exit code will be 0 unless there was a critical error (bad arguments or a missing file)
- If the option --exitWithCount is given, then return the count of files that have unused exports