Loading...
Loading...
Compare original and translation side by side
// Unused
import { foo, bar } from 'module'; // bar is never used
// Recommended
import { foo } from 'module';// Unused
import { foo, bar } from 'module'; // bar is never used
// Recommended
import { foo } from 'module';// Unused
const result = calculate();
const unused = 42; // Never referenced
// Dead assignment
let value = 10;
value = 20; // First assignment is dead// Unused
const result = calculate();
const unused = 42; // Never referenced
// Dead assignment
let value = 10;
value = 20; // First assignment is deadfunction example() {
return true;
console.log('Never executes'); // Dead code
}
if (false) {
// Dead code block
}function example() {
return true;
console.log('Never executes'); // Dead code
}
if (false) {
// Dead code block
}// Private function never called
function helperFunction() {
// ...
}
// Exported but not used anywhere
export function unusedExport() {
// ...
}// Private function never called
function helperFunction() {
// ...
}
// Exported but not used anywhere
export function unusedExport() {
// ...
}@dead-code-detector
@dead-code-detector src/
@dead-code-detector --include-tests
@dead-code-detector --aggressive
@dead-code-detector --safe-only@dead-code-detector
@dead-code-detector src/
@dead-code-detector --include-tests
@dead-code-detector --aggressive
@dead-code-detector --safe-onlyundefinedundefinedimport { oldFunction } from './legacy'import { validateProps } from './validation'import { oldFunction } from './legacy'import { validateProps } from './validation'const DEBUG_MODE = falseconst DEBUG_MODE = falsefunction formatOldDate()function formatOldDate()export function legacyRequest()export function legacyRequest()function loadPlugin()function loadPlugin()momentlodash.debounceaxiosmomentlodash.debounceaxiostypescriptjesttypescriptjestundefinedundefined// Might look unused but called dynamically
const handlers = {
onClick: handleClick,
onHover: handleHover
};
// Called via string
window['initApp']();// Might look unused but called dynamically
const handlers = {
onClick: handleClick,
onHover: handleHover
};
// Called via string
window['initApp']();// Used only in tests, might appear unused in main code
export function testHelper() {}// Used only in tests, might appear unused in main code
export function testHelper() {}// Exported for external consumers
export function publicApi() {
// Not used internally but part of public interface
}// Exported for external consumers
export function publicApi() {
// Not used internally but part of public interface
}