-
-
Notifications
You must be signed in to change notification settings - Fork 318
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Prerequisites
- I'm using the latest version
- I've read the relevant documentation
- I've searched for existing issues
- I've checked the list of known issues
- I've read the issue reproduction guide
Reproduction url
https://github.com/remcohaszing/knip-repro-declare
Reproduction access
- I've made sure the reproduction is publicly accessible
Description of the issue
When a file declares or augments a module or global, that means the file is used. The same goes for triple-slash directives.
Example augmentation (from a module):
declare module 'knip';Example module declaration (from a script):
declare module 'some-module';Global declaration (from a module):
declare global {
const variable: string
}Global declaration (from a script):
declare const variable: stringTriple slash directive (from a script or module):
/// <reference types="knip" />I don’t think Knip has a full TypeScript context. Without that, it’s not always possible to tell a script apart from a module. So I don’t really expect Knip to be able to handle the case of variable declarations in a script.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working