@definitelytyped/dtslint 0.0.182 → 0.0.184
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.
- package/CHANGELOG.md +22 -0
- package/README.md +68 -28
- package/dist/checks.d.ts +4 -3
- package/dist/checks.js +90 -97
- package/dist/checks.js.map +1 -1
- package/dist/index.js +24 -58
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts +1 -1
- package/dist/lint.js +12 -20
- package/dist/lint.js.map +1 -1
- package/dist/rules/npmNamingRule.js +0 -9
- package/dist/rules/npmNamingRule.js.map +1 -1
- package/dist/updateConfig.js +1 -1
- package/dist/updateConfig.js.map +1 -1
- package/dist/util.d.ts +3 -4
- package/dist/util.js +11 -21
- package/dist/util.js.map +1 -1
- package/package.json +7 -6
- package/src/checks.ts +77 -119
- package/src/index.ts +25 -71
- package/src/lint.ts +17 -31
- package/src/rules/npmNamingRule.ts +0 -9
- package/src/updateConfig.ts +1 -1
- package/src/util.ts +10 -21
- package/test/index.test.ts +100 -31
- package/test/npm-naming/code/types/dts-critic/index.d.ts +0 -5
- package/test/npm-naming/code/types/dts-critic/package.json +17 -0
- package/test/npm-naming/name/types/wenceslas/index.d.ts +1 -4
- package/test/npm-naming/name/types/wenceslas/index.d.ts.lint +2 -6
- package/test/npm-naming/name/types/wenceslas/package.json +17 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @definitelytyped/dtslint
|
|
2
2
|
|
|
3
|
+
## 0.0.184
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [22ffaadf]
|
|
8
|
+
- @definitelytyped/header-parser@0.0.180
|
|
9
|
+
- @definitelytyped/dts-critic@0.0.180
|
|
10
|
+
|
|
11
|
+
## 0.0.183
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 024c3e73: Update @definitelytyped for Definitely Typed's monorepo upgrade
|
|
16
|
+
- 9fffa8ff: Fix entrypoint scripts to ensure they don’t run when being imported by an ES module
|
|
17
|
+
- Updated dependencies [024c3e73]
|
|
18
|
+
- Updated dependencies [9fffa8ff]
|
|
19
|
+
- Updated dependencies [9fffa8ff]
|
|
20
|
+
- @definitelytyped/typescript-versions@0.0.179
|
|
21
|
+
- @definitelytyped/header-parser@0.0.179
|
|
22
|
+
- @definitelytyped/dts-critic@0.0.179
|
|
23
|
+
- @definitelytyped/utils@0.0.179
|
|
24
|
+
|
|
3
25
|
## 0.0.182
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Lint rules new to dtslint are documented in the [docs](docs) directory.
|
|
|
5
5
|
|
|
6
6
|
# Just looking for ExpectType and ExpectError?
|
|
7
7
|
|
|
8
|
-
[Use tsd
|
|
8
|
+
[Use tsd](https://github.com/SamVerschueren/tsd) or [eslint-plugin-expect-type](https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type#readme) instead.
|
|
9
9
|
|
|
10
10
|
# Setup
|
|
11
11
|
|
|
@@ -28,8 +28,8 @@ Read more on bundling types [here](http://www.typescriptlang.org/docs/handbook/d
|
|
|
28
28
|
|
|
29
29
|
#### `types/index.d.ts`
|
|
30
30
|
|
|
31
|
-
Only `index.d.ts`
|
|
32
|
-
Write your type definitions
|
|
31
|
+
Only `index.d.ts` and `package.json` need to be published to NPM. The other files will be required by Definitely Typed for testing.
|
|
32
|
+
Write your type definitions in `index.d.ts`.
|
|
33
33
|
Refer to the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html) or `dts-gen`'s templates for how to do this.
|
|
34
34
|
|
|
35
35
|
|
|
@@ -39,30 +39,76 @@ Refer to the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-
|
|
|
39
39
|
{
|
|
40
40
|
"compilerOptions": {
|
|
41
41
|
"module": "commonjs",
|
|
42
|
-
"lib": [
|
|
42
|
+
"lib": [
|
|
43
|
+
"es6",
|
|
44
|
+
],
|
|
43
45
|
"noImplicitAny": true,
|
|
44
46
|
"noImplicitThis": true,
|
|
45
|
-
"strictFunctionTypes": true,
|
|
46
47
|
"strictNullChecks": true,
|
|
48
|
+
"strictFunctionTypes": true,
|
|
47
49
|
"types": [],
|
|
48
50
|
"noEmit": true,
|
|
49
|
-
"forceConsistentCasingInFileNames": true
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
}
|
|
51
|
+
"forceConsistentCasingInFileNames": true
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"index.d.ts",
|
|
55
|
+
"PACKAGE-NAME-tests.ts",
|
|
56
|
+
]
|
|
56
57
|
}
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
You may extend `"lib"` to, for example, `["es6", "dom"]` if you need those typings.
|
|
60
61
|
You may also have to add `"target": "es6"` if using certain language features.
|
|
61
62
|
|
|
63
|
+
#### `types/package.json`
|
|
64
|
+
|
|
65
|
+
```json5
|
|
66
|
+
{
|
|
67
|
+
"private": true,
|
|
68
|
+
"name": "@types/PACKAGE-NAME",
|
|
69
|
+
"version": "1.2.9999",
|
|
70
|
+
"projects": [
|
|
71
|
+
"https://example.com/"
|
|
72
|
+
],
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@types/DEPENDENCY-1": "*",
|
|
75
|
+
"@types/DEPENDENCY-2": "*"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@types/PACKAGE-NAME": "workspace:."
|
|
79
|
+
},
|
|
80
|
+
"owners": [
|
|
81
|
+
{
|
|
82
|
+
"name": "My Self",
|
|
83
|
+
"githubUsername": "ghost"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
1. If the types are for a scoped package, you must name-mangle `@scope/package` to `@types/scope__package`.
|
|
90
|
+
2. The major and minor versions should match some published version of the npm package. The patch version must be 9999; Definitely Typed will increment published patch versions starting at 0, and the patch version of the types will not match the patch version of the npm package.
|
|
91
|
+
3. `"projects"` is a link to the source project.
|
|
92
|
+
4. There might not be any dependencies if the *types* don't rely on anything but standard types.
|
|
93
|
+
5. `"devDependencies"` must include a self-reference like `"@types/PACKAGE-NAME": "workspace:.`. Plus any dependencies used only by tests.
|
|
94
|
+
6. Non-`@types` dependencies must be added to `allowedPackageJsonDependencies.txt` in the definitions-parser package. The PR must be approved by a Typescript team member.
|
|
95
|
+
7. If you do not have a github user name, you can provide a `"url"` of your own instead.
|
|
96
|
+
|
|
97
|
+
Also:
|
|
98
|
+
|
|
99
|
+
For types that do not have a matching NPM package, add two properties:
|
|
62
100
|
|
|
63
|
-
|
|
101
|
+
1. `"nonNpm": true`
|
|
102
|
+
2. `"nonNpmDescription"`, a human-readable name for the project that is being typed.
|
|
64
103
|
|
|
65
|
-
|
|
104
|
+
#### `types/tslint.json` or `types/.eslintrc.json`
|
|
105
|
+
|
|
106
|
+
Definitely Typed is in the process of migrating from tslint to eslint.
|
|
107
|
+
If you are using the default rules, .eslintrc.json is optional; tslint.json should be
|
|
108
|
+
|
|
109
|
+
```json5
|
|
110
|
+
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
|
111
|
+
```
|
|
66
112
|
|
|
67
113
|
If present, this will override `dtslint`'s [default](https://github.com/microsoft/DefinitelyTyped-tools/blob/master/packages/dtslint/dtslint.json) settings.
|
|
68
114
|
You can specify new lint [rules](https://palantir.github.io/tslint/rules/), or disable some. An example:
|
|
@@ -77,13 +123,14 @@ You can specify new lint [rules](https://palantir.github.io/tslint/rules/), or d
|
|
|
77
123
|
}
|
|
78
124
|
```
|
|
79
125
|
|
|
126
|
+
Please don't do this without a good reason.
|
|
127
|
+
Disabling lint rules makes a Definitely Typed PR less likely to be merged, and will definitely take longer to review.
|
|
128
|
+
|
|
80
129
|
|
|
81
130
|
#### `types/test.ts`
|
|
82
131
|
|
|
83
132
|
You can have any number of test files you want, with any names. See below on what to put in them.
|
|
84
133
|
|
|
85
|
-
|
|
86
|
-
|
|
87
134
|
## Write tests
|
|
88
135
|
|
|
89
136
|
A test file should be a piece of sample code that tests using the library. Tests are type-checked, but not run.
|
|
@@ -108,15 +155,13 @@ f("one");
|
|
|
108
155
|
## Specify a TypeScript version
|
|
109
156
|
|
|
110
157
|
Normally packages will be tested according to [DefinitelyType's support window](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window).
|
|
111
|
-
To
|
|
158
|
+
To restrict testing to new versions only, specify it in package.json:
|
|
112
159
|
|
|
113
160
|
```ts
|
|
114
|
-
|
|
161
|
+
"minimumTypeScriptVersion: 5.0"
|
|
115
162
|
```
|
|
116
163
|
|
|
117
|
-
|
|
118
|
-
For bundled typings, this can go on any line (but should be near the top).
|
|
119
|
-
|
|
164
|
+
This tests only 5.0 and above, although people can still depend on the package with lower versions of Typescript if they want.
|
|
120
165
|
|
|
121
166
|
## Run tests
|
|
122
167
|
|
|
@@ -141,7 +186,6 @@ Disable all the lint rules except the one that checks for type correctness.
|
|
|
141
186
|
dtslint --expectOnly types
|
|
142
187
|
```
|
|
143
188
|
|
|
144
|
-
|
|
145
189
|
# Contributing
|
|
146
190
|
|
|
147
191
|
## Build
|
|
@@ -153,13 +197,9 @@ npm run watch
|
|
|
153
197
|
|
|
154
198
|
## Test
|
|
155
199
|
|
|
156
|
-
Use `
|
|
157
|
-
To run a single test: `node node_modules/tslint/bin/tslint --rules-dir dist/rules --test test/expect`.
|
|
158
|
-
|
|
159
|
-
## Publish
|
|
200
|
+
Use `pnpm test` to run all tests.
|
|
160
201
|
|
|
161
|
-
|
|
162
|
-
2. Push to master
|
|
202
|
+
To run a single test: `node node_modules/tslint/bin/tslint --rules-dir dist/rules --test test/expect`.
|
|
163
203
|
|
|
164
204
|
## Code of Conduct
|
|
165
205
|
|
package/dist/checks.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as header from "@definitelytyped/header-parser";
|
|
2
|
+
import { AllTypeScriptVersion } from "@definitelytyped/typescript-versions";
|
|
2
3
|
import { CompilerOptions } from "typescript";
|
|
3
|
-
export declare function checkPackageJson(dirPath: string, typesVersions: readonly
|
|
4
|
+
export declare function checkPackageJson(dirPath: string, typesVersions: readonly AllTypeScriptVersion[]): header.Header | string[];
|
|
4
5
|
/**
|
|
5
6
|
* numbers in `CompilerOptions` might be enum values mapped from strings
|
|
6
7
|
*/
|
|
@@ -11,4 +12,4 @@ export interface DefinitelyTypedInfo {
|
|
|
11
12
|
/** "../" or "../../" or "../../../". This should use '/' even on windows. */
|
|
12
13
|
readonly relativeBaseUrl: string;
|
|
13
14
|
}
|
|
14
|
-
export declare function checkTsconfig(
|
|
15
|
+
export declare function checkTsconfig(dirPath: string, options: CompilerOptionsRaw): string[];
|
package/dist/checks.js
CHANGED
|
@@ -1,111 +1,97 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.checkTsconfig = exports.checkPackageJson = void 0;
|
|
4
|
-
const
|
|
5
|
-
const assert = require("assert");
|
|
27
|
+
const header = __importStar(require("@definitelytyped/header-parser"));
|
|
6
28
|
const fs_extra_1 = require("fs-extra");
|
|
7
29
|
const path_1 = require("path");
|
|
30
|
+
const utils_1 = require("@definitelytyped/utils");
|
|
8
31
|
const util_1 = require("./util");
|
|
9
|
-
|
|
32
|
+
function checkPackageJson(dirPath, typesVersions) {
|
|
10
33
|
const pkgJsonPath = (0, path_1.join)(dirPath, "package.json");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (needsTypesVersions) {
|
|
14
|
-
throw new Error(`${dirPath}: Must have 'package.json' for "typesVersions"`);
|
|
15
|
-
}
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const pkgJson = (await (0, util_1.readJson)(pkgJsonPath));
|
|
19
|
-
if (pkgJson.private !== true) {
|
|
20
|
-
throw new Error(`${pkgJsonPath} should set \`"private": true\``);
|
|
21
|
-
}
|
|
22
|
-
if (needsTypesVersions) {
|
|
23
|
-
assert.strictEqual(pkgJson.types, "index", `"types" in '${pkgJsonPath}' should be "index".`);
|
|
24
|
-
const expected = (0, header_parser_1.makeTypesVersionsForPackageJson)(typesVersions);
|
|
25
|
-
assert.deepEqual(pkgJson.typesVersions, expected, `"typesVersions" in '${pkgJsonPath}' is not set right. Should be: ${JSON.stringify(expected, undefined, 4)}`);
|
|
26
|
-
}
|
|
27
|
-
for (const key in pkgJson) {
|
|
28
|
-
// tslint:disable-line forin
|
|
29
|
-
switch (key) {
|
|
30
|
-
case "private":
|
|
31
|
-
case "dependencies":
|
|
32
|
-
case "license":
|
|
33
|
-
case "imports":
|
|
34
|
-
case "exports":
|
|
35
|
-
case "type":
|
|
36
|
-
// "private"/"typesVersions"/"types" checked above, "dependencies" / "license" checked by types-publisher,
|
|
37
|
-
break;
|
|
38
|
-
case "typesVersions":
|
|
39
|
-
case "types":
|
|
40
|
-
if (!needsTypesVersions) {
|
|
41
|
-
throw new Error(`${pkgJsonPath} doesn't need to set "${key}" when no 'ts3.x' directories exist.`);
|
|
42
|
-
}
|
|
43
|
-
break;
|
|
44
|
-
default:
|
|
45
|
-
throw new Error(`${pkgJsonPath} should not include field ${key}`);
|
|
46
|
-
}
|
|
34
|
+
if (!(0, fs_extra_1.pathExistsSync)(pkgJsonPath)) {
|
|
35
|
+
throw new Error(`${dirPath}: Missing 'package.json'`);
|
|
47
36
|
}
|
|
37
|
+
return header.validatePackageJson((0, util_1.packageNameFromPath)(dirPath), (0, util_1.readJson)(pkgJsonPath), typesVersions);
|
|
48
38
|
}
|
|
49
39
|
exports.checkPackageJson = checkPackageJson;
|
|
50
|
-
function checkTsconfig(
|
|
40
|
+
function checkTsconfig(dirPath, options) {
|
|
51
41
|
var _a, _b;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const actual = options[key];
|
|
64
|
-
if (!deepEquals(expected, actual)) {
|
|
65
|
-
throw new Error(`Expected compilerOptions[${JSON.stringify(key)}] === ${JSON.stringify(expected)}, but got ${JSON.stringify(actual)}`);
|
|
66
|
-
}
|
|
42
|
+
const errors = [];
|
|
43
|
+
const mustHave = {
|
|
44
|
+
noEmit: true,
|
|
45
|
+
forceConsistentCasingInFileNames: true,
|
|
46
|
+
types: [],
|
|
47
|
+
};
|
|
48
|
+
for (const key of Object.getOwnPropertyNames(mustHave)) {
|
|
49
|
+
const expected = mustHave[key];
|
|
50
|
+
const actual = options[key];
|
|
51
|
+
if (!(0, utils_1.deepEquals)(expected, actual)) {
|
|
52
|
+
errors.push(`Expected compilerOptions[${JSON.stringify(key)}] === ${JSON.stringify(expected)}, but got ${JSON.stringify(actual)}`);
|
|
67
53
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
54
|
+
}
|
|
55
|
+
for (const key in options) {
|
|
56
|
+
switch (key) {
|
|
57
|
+
case "lib":
|
|
58
|
+
case "noImplicitAny":
|
|
59
|
+
case "noImplicitThis":
|
|
60
|
+
case "strict":
|
|
61
|
+
case "strictNullChecks":
|
|
62
|
+
case "noUncheckedIndexedAccess":
|
|
63
|
+
case "strictFunctionTypes":
|
|
64
|
+
case "esModuleInterop":
|
|
65
|
+
case "allowSyntheticDefaultImports":
|
|
66
|
+
case "target":
|
|
67
|
+
case "jsx":
|
|
68
|
+
case "jsxFactory":
|
|
69
|
+
case "experimentalDecorators":
|
|
70
|
+
case "noUnusedLocals":
|
|
71
|
+
case "noUnusedParameters":
|
|
72
|
+
case "exactOptionalPropertyTypes":
|
|
73
|
+
case "module":
|
|
74
|
+
case "paths":
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
if (!(key in mustHave)) {
|
|
78
|
+
errors.push(`Unexpected compiler option ${key}`);
|
|
79
|
+
}
|
|
94
80
|
}
|
|
95
81
|
}
|
|
96
82
|
if (!("lib" in options)) {
|
|
97
|
-
|
|
83
|
+
errors.push('Must specify "lib", usually to `"lib": ["es6"]` or `"lib": ["es6", "dom"]`.');
|
|
98
84
|
}
|
|
99
85
|
if (!("module" in options)) {
|
|
100
|
-
|
|
86
|
+
errors.push('Must specify "module" to `"module": "commonjs"` or `"module": "node16"`.');
|
|
101
87
|
}
|
|
102
|
-
if (((_a = options.module) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase()) !== "commonjs" &&
|
|
88
|
+
else if (((_a = options.module) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase()) !== "commonjs" &&
|
|
103
89
|
((_b = options.module) === null || _b === void 0 ? void 0 : _b.toString().toLowerCase()) !== "node16") {
|
|
104
|
-
|
|
90
|
+
errors.push(`When "module" is present, it must be set to "commonjs" or "node16".`);
|
|
105
91
|
}
|
|
106
92
|
if ("strict" in options) {
|
|
107
93
|
if (options.strict !== true) {
|
|
108
|
-
|
|
94
|
+
errors.push('When "strict" is present, it must be set to `true`.');
|
|
109
95
|
}
|
|
110
96
|
for (const key of ["noImplicitAny", "noImplicitThis", "strictNullChecks", "strictFunctionTypes"]) {
|
|
111
97
|
if (key in options) {
|
|
@@ -116,27 +102,34 @@ function checkTsconfig(options, dt) {
|
|
|
116
102
|
else {
|
|
117
103
|
for (const key of ["noImplicitAny", "noImplicitThis", "strictNullChecks", "strictFunctionTypes"]) {
|
|
118
104
|
if (!(key in options)) {
|
|
119
|
-
|
|
105
|
+
errors.push(`Expected \`"${key}": true\` or \`"${key}": false\`.`);
|
|
120
106
|
}
|
|
121
107
|
}
|
|
122
108
|
}
|
|
123
109
|
if ("exactOptionalPropertyTypes" in options) {
|
|
124
110
|
if (options.exactOptionalPropertyTypes !== true) {
|
|
125
|
-
|
|
111
|
+
errors.push('When "exactOptionalPropertyTypes" is present, it must be set to `true`.');
|
|
126
112
|
}
|
|
127
113
|
}
|
|
128
114
|
if (options.types && options.types.length) {
|
|
129
|
-
|
|
115
|
+
errors.push('Use `/// <reference types="..." />` directives in source files and ensure ' +
|
|
130
116
|
'that the "types" field in your tsconfig is an empty array.');
|
|
131
117
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
118
|
+
if (options.paths) {
|
|
119
|
+
for (const key in options.paths) {
|
|
120
|
+
if (options.paths[key].length !== 1) {
|
|
121
|
+
errors.push(`${dirPath}/tsconfig.json: "paths" must map each module specifier to only one file.`);
|
|
122
|
+
}
|
|
123
|
+
const [target] = options.paths[key];
|
|
124
|
+
if (target !== "./index.d.ts") {
|
|
125
|
+
const m = target.match(/^(?:..\/)+([^\/]+)\/(?:v\d+\.?\d*\/)?index.d.ts$/);
|
|
126
|
+
if (!m || m[1] !== key) {
|
|
127
|
+
errors.push(`${dirPath}/tsconfig.json: "paths" must map '${key}' to ${key}'s index.d.ts.`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
140
131
|
}
|
|
132
|
+
return errors;
|
|
141
133
|
}
|
|
134
|
+
exports.checkTsconfig = checkTsconfig;
|
|
142
135
|
//# sourceMappingURL=checks.js.map
|
package/dist/checks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAAyD;AAEzD,uCAA0C;AAC1C,+BAAyC;AAEzC,kDAAoD;AAEpD,iCAAuD;AACvD,SAAgB,gBAAgB,CAC9B,OAAe,EACf,aAA8C;IAE9C,MAAM,WAAW,GAAG,IAAA,WAAS,EAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACvD,IAAI,CAAC,IAAA,yBAAc,EAAC,WAAW,CAAC,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,0BAA0B,CAAC,CAAC;KACvD;IACD,OAAO,MAAM,CAAC,mBAAmB,CAAC,IAAA,0BAAmB,EAAC,OAAO,CAAC,EAAE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OAAO,EAAE;QAC3C,IAAI,OAAO,CAAC,0BAA0B,KAAK,IAAI,EAAE;YAC/C,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;SACxF;KACF;IAED,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE;QACzC,MAAM,CAAC,IAAI,CACT,4EAA4E;YAC1E,4DAA4D,CAC/D,CAAC;KACH;IACD,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE;YAC/B,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBACnC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,0EAA0E,CAAC,CAAC;aACnG;YACD,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,MAAM,KAAK,cAAc,EAAE;gBAC7B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;gBAC3E,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACtB,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,qCAAqC,GAAG,QAAQ,GAAG,gBAAgB,CAAC,CAAC;iBAC5F;aACF;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAxGD,sCAwGC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.assertPackageIsNotDeprecated = void 0;
|
|
5
|
-
const header_parser_1 = require("@definitelytyped/header-parser");
|
|
6
5
|
const typescript_versions_1 = require("@definitelytyped/typescript-versions");
|
|
7
6
|
const assert = require("assert");
|
|
8
7
|
const fs_extra_1 = require("fs-extra");
|
|
@@ -11,6 +10,7 @@ const utils_1 = require("@definitelytyped/utils");
|
|
|
11
10
|
const checks_1 = require("./checks");
|
|
12
11
|
const lint_1 = require("./lint");
|
|
13
12
|
const util_1 = require("./util");
|
|
13
|
+
const header_parser_1 = require("@definitelytyped/header-parser");
|
|
14
14
|
async function main() {
|
|
15
15
|
const args = process.argv.slice(2);
|
|
16
16
|
let dirPath = process.cwd();
|
|
@@ -113,42 +113,21 @@ function listen(dirPath, tsLocal, alwaysOnlyTestTsNext) {
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
async function runTests(dirPath, onlyTestTsNext, expectOnly, tsLocal) {
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
const typesVersions = await (0, util_1.mapDefinedAsync)(await (0, fs_extra_1.readdir)(dirPath), async (name) => {
|
|
130
|
-
if (name === "tsconfig.json" || name === "tslint.json" || name === "tsutils") {
|
|
131
|
-
return undefined;
|
|
132
|
-
}
|
|
133
|
-
const version = (0, util_1.withoutPrefix)(name, "ts");
|
|
134
|
-
if (version === undefined || !(await (0, fs_extra_1.stat)((0, path_1.join)(dirPath, name))).isDirectory()) {
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
if (!typescript_versions_1.TypeScriptVersion.isTypeScriptVersion(version)) {
|
|
138
|
-
throw new Error(`There is an entry named ${name}, but ${version} is not a valid TypeScript version.`);
|
|
139
|
-
}
|
|
140
|
-
if (!typescript_versions_1.TypeScriptVersion.isRedirectable(version)) {
|
|
141
|
-
throw new Error(`At ${dirPath}/${name}: TypeScript version directories only available starting with ts3.1.`);
|
|
142
|
-
}
|
|
143
|
-
return version;
|
|
144
|
-
});
|
|
145
|
-
if (dt) {
|
|
146
|
-
await (0, checks_1.checkPackageJson)(dirPath, typesVersions);
|
|
147
|
-
}
|
|
148
|
-
const minVersion = maxVersion(getMinimumTypeScriptVersionFromComment(indexText), typescript_versions_1.TypeScriptVersion.lowest);
|
|
116
|
+
// Assert that we're really on DefinitelyTyped.
|
|
117
|
+
const dtRoot = findDTRoot(dirPath);
|
|
118
|
+
const packageName = (0, util_1.packageNameFromPath)(dirPath);
|
|
119
|
+
assertPathIsInDefinitelyTyped(dirPath, dtRoot);
|
|
120
|
+
assertPathIsNotBanned(packageName);
|
|
121
|
+
assertPackageIsNotDeprecated(packageName, await (0, fs_extra_1.readFile)((0, path_1.join)(dtRoot, "notNeededPackages.json"), "utf-8"));
|
|
122
|
+
const typesVersions = (0, header_parser_1.getTypesVersions)(dirPath);
|
|
123
|
+
const packageJson = (0, checks_1.checkPackageJson)(dirPath, typesVersions);
|
|
124
|
+
if (Array.isArray(packageJson)) {
|
|
125
|
+
throw new Error("\n\t* " + packageJson.join("\n\t* "));
|
|
126
|
+
}
|
|
127
|
+
const minVersion = maxVersion(packageJson.minimumTypeScriptVersion, typescript_versions_1.TypeScriptVersion.lowest);
|
|
149
128
|
if (onlyTestTsNext || tsLocal) {
|
|
150
129
|
const tsVersion = tsLocal ? "local" : typescript_versions_1.TypeScriptVersion.latest;
|
|
151
|
-
await testTypesVersion(dirPath, tsVersion, tsVersion,
|
|
130
|
+
await testTypesVersion(dirPath, tsVersion, tsVersion, expectOnly, tsLocal, /*isLatest*/ true);
|
|
152
131
|
}
|
|
153
132
|
else {
|
|
154
133
|
// For example, typesVersions of [3.2, 3.5, 3.6] will have
|
|
@@ -167,18 +146,13 @@ async function runTests(dirPath, onlyTestTsNext, expectOnly, tsLocal) {
|
|
|
167
146
|
if (lows.length > 1) {
|
|
168
147
|
console.log("testing from", low, "to", hi, "in", versionPath);
|
|
169
148
|
}
|
|
170
|
-
await testTypesVersion(versionPath, low, hi,
|
|
149
|
+
await testTypesVersion(versionPath, low, hi, expectOnly, undefined, isLatest);
|
|
171
150
|
}
|
|
172
151
|
}
|
|
173
152
|
}
|
|
174
153
|
function maxVersion(v1, v2) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!v2)
|
|
178
|
-
return v1;
|
|
179
|
-
if (parseFloat(v1) >= parseFloat(v2))
|
|
180
|
-
return v1;
|
|
181
|
-
return v2;
|
|
154
|
+
// Note: For v1 to be later than v2, it must be a current Typescript version. So the type assertion is safe.
|
|
155
|
+
return parseFloat(v1) >= parseFloat(v2) ? v1 : v2;
|
|
182
156
|
}
|
|
183
157
|
function next(v) {
|
|
184
158
|
const index = typescript_versions_1.TypeScriptVersion.supported.indexOf(v);
|
|
@@ -186,9 +160,12 @@ function next(v) {
|
|
|
186
160
|
assert(index < typescript_versions_1.TypeScriptVersion.supported.length);
|
|
187
161
|
return typescript_versions_1.TypeScriptVersion.supported[index + 1];
|
|
188
162
|
}
|
|
189
|
-
async function testTypesVersion(dirPath, lowVersion, hiVersion,
|
|
190
|
-
|
|
191
|
-
(0, checks_1.checkTsconfig)(
|
|
163
|
+
async function testTypesVersion(dirPath, lowVersion, hiVersion, expectOnly, tsLocal, isLatest) {
|
|
164
|
+
(0, lint_1.checkTslintJson)(dirPath);
|
|
165
|
+
const tsconfigErrors = (0, checks_1.checkTsconfig)(dirPath, (0, util_1.getCompilerOptions)(dirPath));
|
|
166
|
+
if (tsconfigErrors.length > 0) {
|
|
167
|
+
throw new Error("\n\t* " + tsconfigErrors.join("\n\t* "));
|
|
168
|
+
}
|
|
192
169
|
const err = await (0, lint_1.lint)(dirPath, lowVersion, hiVersion, isLatest, expectOnly, tsLocal);
|
|
193
170
|
if (err) {
|
|
194
171
|
throw new Error(err);
|
|
@@ -239,18 +216,7 @@ If you want to re-add @types/${packageName}, please remove its entry from notNee
|
|
|
239
216
|
}
|
|
240
217
|
}
|
|
241
218
|
exports.assertPackageIsNotDeprecated = assertPackageIsNotDeprecated;
|
|
242
|
-
|
|
243
|
-
const match = text.match(/\/\/ (?:Minimum )?TypeScript Version: /);
|
|
244
|
-
if (!match) {
|
|
245
|
-
return undefined;
|
|
246
|
-
}
|
|
247
|
-
let line = text.slice(match.index, text.indexOf("\n", match.index));
|
|
248
|
-
if (line.endsWith("\r")) {
|
|
249
|
-
line = line.slice(0, line.length - 1);
|
|
250
|
-
}
|
|
251
|
-
return (0, header_parser_1.parseTypeScriptVersionLine)(line);
|
|
252
|
-
}
|
|
253
|
-
if (!module.parent) {
|
|
219
|
+
if (require.main === module) {
|
|
254
220
|
main().catch((err) => {
|
|
255
221
|
console.error(err.stack);
|
|
256
222
|
process.exit(1);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAEA,8EAA+F;AAC/F,iCAAkC;AAClC,uCAAgD;AAChD,+BAAqE;AAErE,kDAAsH;AACtH,qCAA2D;AAC3D,iCAA0D;AAC1D,iCAAiE;AACjE,kEAAkE;AAElE,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,IAAI,OAA2B,CAAC;IAEhC,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAE7D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,iBAAiB,EAAE;YACrB,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACxB,MAAM,IAAI,KA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