Skip to content

Commit bba4520

Browse files
committed
Merge branch 'master' into typeof-coud-narrow-union-type
2 parents 6a164ec + 775fd9c commit bba4520

File tree

422 files changed

+12356
-5888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

422 files changed

+12356
-5888
lines changed

.eslintrc.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@
1818
"@typescript-eslint/array-type": "error",
1919

2020
"camelcase": "off",
21-
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],
21+
"@typescript-eslint/naming-convention": [
22+
"error",
23+
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
24+
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false }, "filter": { "regex": "^I(Arguments|TextWriter|O([A-Z][a-z]+[A-Za-z]*)?)$", "match": false } },
25+
{ "selector": "variable", "format": ["camelCase", "PascalCase", "UPPER_CASE"], "leadingUnderscore": "allow", "filter": { "regex": "^(_{1,2}filename|_{1,2}dirname|_+|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
26+
{ "selector": "function", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
27+
{ "selector": "parameter", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^(_+|[A-Za-z]+_[A-Z][a-z]+)$", "match": false } },
28+
{ "selector": "method", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
29+
{ "selector": "memberLike", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
30+
{ "selector": "enumMember", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
31+
{ "selector": "property", "format": null }
32+
],
2233

23-
"@typescript-eslint/class-name-casing": "error",
2434
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
25-
"@typescript-eslint/interface-name-prefix": "error",
2635
"@typescript-eslint/no-inferrable-types": "error",
2736
"@typescript-eslint/no-misused-new": "error",
2837
"@typescript-eslint/no-this-alias": "error",

.github/tsc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "tsc",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),(\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"code": 5,
13+
"message": 6
14+
}
15+
]
16+
}
17+
]
18+
}

.github/workflows/ci.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,19 @@ jobs:
3030
run: |
3131
npm uninstall typescript --no-save
3232
npm uninstall tslint --no-save
33-
- name: npm install and test
34-
run: |
35-
npm install
36-
npm update
37-
npm test
38-
33+
- run: npm install
34+
- run: npm update
35+
36+
# Re: https://github.com/actions/setup-node/pull/125
37+
- name: Register Problem Matcher for TSC
38+
run: echo "##[add-matcher].github/tsc.json"
39+
40+
- name: Tests
41+
run: npm test -- --no-lint
42+
43+
- name: Linter
44+
run: npm run lint:ci
45+
3946
- name: Validate the browser can import TypeScript
4047
run: gulp test-browser-integration
4148

Gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,12 @@ const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lin
350350
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
351351
const eslint = (folder) => async () => {
352352

353+
const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish";
353354
const args = [
354355
"node_modules/eslint/bin/eslint",
355356
"--cache",
356357
"--cache-location", `${folder}/.eslintcache`,
357-
"--format", "autolinkable-stylish",
358+
"--format", formatter,
358359
"--rulesdir", "scripts/eslint/built/rules",
359360
"--ext", ".ts",
360361
];
@@ -367,7 +368,7 @@ const eslint = (folder) => async () => {
367368

368369
log(`Linting: ${args.join(" ")}`);
369370
return exec(process.execPath, args);
370-
}
371+
};
371372

372373
const lintScripts = eslint("scripts");
373374
lintScripts.displayName = "lint-scripts";

lib/diagnosticMessages.generated.json

Lines changed: 0 additions & 1047 deletions
This file was deleted.

lib/lib.esnext.array.d.ts

Lines changed: 0 additions & 223 deletions
This file was deleted.

lib/lib.esnext.asynciterable.d.ts

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)