@definitelytyped/dts-critic 0.0.95-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -0
  3. package/develop.ts +446 -0
  4. package/dist/develop.d.ts +1 -0
  5. package/dist/develop.js +356 -0
  6. package/dist/develop.js.map +1 -0
  7. package/dist/dt.d.ts +1 -0
  8. package/dist/dt.js +79 -0
  9. package/dist/dt.js.map +1 -0
  10. package/dist/index.d.ts +85 -0
  11. package/dist/index.js +852 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/index.test.d.ts +1 -0
  14. package/dist/index.test.js +196 -0
  15. package/dist/index.test.js.map +1 -0
  16. package/dist/jest.config.d.ts +2 -0
  17. package/dist/jest.config.js +11 -0
  18. package/dist/jest.config.js.map +1 -0
  19. package/dt.ts +76 -0
  20. package/index.test.ts +278 -0
  21. package/index.ts +1038 -0
  22. package/jest.config.js +9 -0
  23. package/package.json +60 -0
  24. package/testsource/dts-critic.d.ts +8 -0
  25. package/testsource/dts-critic.js +1 -0
  26. package/testsource/missingDefault.d.ts +1 -0
  27. package/testsource/missingDefault.js +1 -0
  28. package/testsource/missingDtsProperty.d.ts +3 -0
  29. package/testsource/missingDtsProperty.js +4 -0
  30. package/testsource/missingDtsSignature.d.ts +7 -0
  31. package/testsource/missingDtsSignature.js +3 -0
  32. package/testsource/missingExportEquals.d.ts +1 -0
  33. package/testsource/missingExportEquals.js +5 -0
  34. package/testsource/missingJsProperty.d.ts +2 -0
  35. package/testsource/missingJsProperty.js +5 -0
  36. package/testsource/missingJsSignatureExportEquals.d.ts +6 -0
  37. package/testsource/missingJsSignatureExportEquals.js +3 -0
  38. package/testsource/missingJsSignatureNoExportEquals.d.ts +1 -0
  39. package/testsource/missingJsSignatureNoExportEquals.js +1 -0
  40. package/testsource/noErrors.d.ts +2 -0
  41. package/testsource/noErrors.js +2 -0
  42. package/testsource/parseltongue.d.ts +0 -0
  43. package/testsource/tslib.d.ts +4 -0
  44. package/testsource/typescript.d.ts +4 -0
  45. package/testsource/webpackPropertyNames.d.ts +1 -0
  46. package/testsource/webpackPropertyNames.js +12 -0
  47. package/tsconfig.json +20 -0
package/jest.config.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ rootDir: "dist",
3
+ moduleFileExtensions: [
4
+ "js",
5
+ "jsx",
6
+ "json",
7
+ "node"
8
+ ],
9
+ };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@definitelytyped/dts-critic",
3
+ "version": "0.0.95-next.1",
4
+ "author": "Nathan Shively-Sanders",
5
+ "description": "Checks a new .d.ts against the Javascript source and tells you what problems it has",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "dependencies": {
10
+ "@definitelytyped/header-parser": "latest",
11
+ "command-exists": "^1.2.8",
12
+ "rimraf": "^3.0.2",
13
+ "semver": "^6.2.0",
14
+ "tmp": "^0.2.1",
15
+ "yargs": "^15.3.1"
16
+ },
17
+ "peerDependencies": {
18
+ "typescript": "*"
19
+ },
20
+ "devDependencies": {
21
+ "@types/command-exists": "^1.2.0",
22
+ "@types/jest": "^24.0.0",
23
+ "@types/node": "~10.17.0",
24
+ "@types/rimraf": "^3.0.0",
25
+ "@types/semver": "^6.0.1",
26
+ "@types/strip-json-comments": "0.0.30",
27
+ "@types/tmp": "^0.2.0",
28
+ "@types/yargs": "^12.0.8",
29
+ "strip-json-comments": "^2.0.1",
30
+ "typescript": "*"
31
+ },
32
+ "main": "dist/index.js",
33
+ "types": "dist/index.d.ts",
34
+ "scripts": {
35
+ "test": "npm run build && jest",
36
+ "build": "tsc",
37
+ "dt": "node dist/dt.js",
38
+ "prepublishOnly": "npm run build && npm run test"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/microsoft/DefinitelyTyped-tools.git"
43
+ },
44
+ "keywords": [
45
+ "definitely",
46
+ "typed",
47
+ "refresh",
48
+ "npm",
49
+ "tag"
50
+ ],
51
+ "license": "MIT",
52
+ "bugs": {
53
+ "url": "https://github.com/microsoft/DefinitelyTyped-tools/issues"
54
+ },
55
+ "homepage": "https://github.com/microsoft/DefinitelyTyped-tools#readme",
56
+ "engines": {
57
+ "node": ">=10.17.0"
58
+ },
59
+ "gitHead": "dc40b825ec231899cb63a5b007da08c463f2ee7d"
60
+ }
@@ -0,0 +1,8 @@
1
+ // Type definitions for package dts-critic 2.0
2
+ // Project: https://github.com/microsoft/TypeScript
3
+ // Definitions by: TypeScript Bot <https://github.com/typescript-bot>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+
6
+ declare function _default(): void;
7
+
8
+ export = _default;
@@ -0,0 +1 @@
1
+ module.exports = function() {};
@@ -0,0 +1 @@
1
+ export default function(): void;
@@ -0,0 +1 @@
1
+ module.exports = function() {};
@@ -0,0 +1,3 @@
1
+ export const a: () => void;
2
+ export const b: number;
3
+ export const foo: string;
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ a: () => {},
3
+ b: 0,
4
+ };
@@ -0,0 +1,7 @@
1
+ interface Exports {
2
+ (): void;
3
+ foo: () => {};
4
+ }
5
+
6
+ declare const exp: Exports;
7
+ export = exp;
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ foo: () => {},
3
+ };
@@ -0,0 +1 @@
1
+ export function foo(a: number): number;
@@ -0,0 +1,5 @@
1
+ function foo(a) {
2
+ return a;
3
+ }
4
+
5
+ module.exports = foo;
@@ -0,0 +1,2 @@
1
+ export const a: () => void;
2
+ export const b: number;
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ a: () => {},
3
+ b: 0,
4
+ foo: "missing",
5
+ };
@@ -0,0 +1,6 @@
1
+ interface Foo {
2
+ bar: () => void;
3
+ }
4
+ declare const foo: Foo;
5
+
6
+ export = foo;
@@ -0,0 +1,3 @@
1
+ module.exports = class Foo {
2
+ bar() {}
3
+ };
@@ -0,0 +1 @@
1
+ export default function(): void;
@@ -0,0 +1 @@
1
+ module.exports = () => {};
@@ -0,0 +1,2 @@
1
+ export const a: number;
2
+ export const b: string;
@@ -0,0 +1,2 @@
1
+ exports.a = 42;
2
+ exports.b = "forty-two";
File without changes
@@ -0,0 +1,4 @@
1
+ // Type definitions for non-npm package tslib
2
+ // Project: https://github.com/microsoft/TypeScript
3
+ // Definitions by: TypeScript Bot <https://github.com/typescript-bot>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -0,0 +1,4 @@
1
+ // Type definitions for typescript 1200000.5
2
+ // Project: https://github.com/microsoft/TypeScript
3
+ // Definitions by: TypeScript Bot <https://github.com/typescript-bot>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -0,0 +1 @@
1
+ export var normal: string;
@@ -0,0 +1,12 @@
1
+ var $export = {};
2
+ // type bitmap
3
+ $export.F = 1; // forced
4
+ $export.G = 2; // global
5
+ $export.S = 4; // static
6
+ $export.P = 8; // proto
7
+ $export.B = 16; // bind
8
+ $export.W = 32; // wrap
9
+ $export.U = 64; // safe
10
+ $export.R = 128; // real proto method for `library`
11
+ $export.normal = "hi";
12
+ module.exports = $export;
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "checkJs": true,
5
+ "target": "es2019",
6
+ "module": "commonjs",
7
+ "resolveJsonModule": true,
8
+ "strict": true,
9
+ "sourceMap": true,
10
+ "outDir": "dist",
11
+ "declaration": true,
12
+ "esModuleInterop": true,
13
+ "noImplicitReturns": true,
14
+ },
15
+ "exclude": [
16
+ "dist/*",
17
+ "sources/*",
18
+ "testsource/*",
19
+ ]
20
+ }