Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negatives when using --searchNamespaces #276

Open
vikasnair opened this issue Apr 11, 2023 · 1 comment
Open

False negatives when using --searchNamespaces #276

vikasnair opened this issue Apr 11, 2023 · 1 comment

Comments

@vikasnair
Copy link

vikasnair commented Apr 11, 2023

Unable to detect unused symbols exported from within a namespace.

Command:

npx ts-unused-exports ./tsconfig.json --findCompletelyUnusedFiles --searchNamespaces

Config:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Tested code (anonymized):

// Example file located at /src/components/auth/styles.ts

export const Foo = 'Foo'; // unused symbol, DOES throw error

namespace StyledAuthForm {
  export const Bar = 'Bar' // unused symbol, DOES NOT throw error
}

Related:
#91 #86

@mrseanryan
Copy link
Collaborator

thank you for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants