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

@types packages causing false positives #210

Closed
sgen opened this issue May 10, 2017 · 4 comments
Closed

@types packages causing false positives #210

sgen opened this issue May 10, 2017 · 4 comments

Comments

@sgen
Copy link

sgen commented May 10, 2017

As of TypeScript 2.0 type definitions of pre-existing packages are available via @types/pkg.

depcheck should be able to recognize this.

Simply noting the packages that being with @types/ and checking them against a list of used packages with the corresponding package name should do it.

Output of depcheck --json:

{
  "dependencies":[

  ],
  "devDependencies":[
    "@types/jasmine",
    "@types/jquery",
    "jasmine",
    "karma-chrome-launcher",
    "karma-jasmine",
    "karma-typescript"
  ],
  "missing":{

  },
  "using":{
    "gulp":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js",
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/package.json"
    ],
    "gulp-tslint":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js"
    ],
    "gulp-typescript":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js"
    ],
    "karma":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js"
    ],
    "del":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js"
    ],
    "tslint":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js"
    ],
    "typescript":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/gulpfile.js"
    ],
    "jquery":[
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/lib/nav.js",
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/src/nav.test.ts",
      "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/src/nav.ts"
    ]
  },
  "invalidFiles":{
    "/home/sgen/Documents/typescript/github.com/KunoSolutions/kn-nav/lib/nav.d.ts":"Error: Debug Failure. False expression: Output generation failed\n    at Object.assert (/usr/lib/node_modules/typescript/lib/typescript.js:3259:23)\n    at transpileModule (/usr/lib/node_modules/typescript/lib/typescript.js:76181:18)\n    at Object.transpile (/usr/lib/node_modules/typescript/lib/typescript.js:76189:22)\n    at parseTypescript (/usr/lib/node_modules/depcheck/dist/parser/typescript.js:24:27)\n    at /usr/lib/node_modules/depcheck/dist/check.js:129:17\n    at tryToString (fs.js:449:3)\n    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436:12)"
  },
  "invalidDirs":{

  }
}
@rumpl
Copy link
Member

rumpl commented May 10, 2017

Hey @sgen thanks for the issue, would you want to make a PR for this?

@sgen
Copy link
Author

sgen commented May 10, 2017

I might, very busy atm so I can make no promises.

@rjmunro
Copy link

rjmunro commented Nov 9, 2017

This seems to be a duplicate of #163.

@mnkhouri
Copy link
Member

Closing as duplicate of #163 -- we'll get this in for the 1.0 release

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

No branches or pull requests

4 participants