Skip to content

Commit b24dbe6

Browse files
committed
Merge remote-tracking branch 'origin' into instanceof-narrowing
2 parents b6026c2 + 5e4cd05 commit b24dbe6

File tree

2,088 files changed

+261563
-141955
lines changed

Some content is hidden

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

2,088 files changed

+261563
-141955
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ scripts/buildProtocol.js
2222
scripts/ior.js
2323
scripts/authors.js
2424
scripts/configurePrerelease.js
25+
scripts/configureTSCBuild.js
2526
scripts/open-user-pr.js
2627
scripts/open-cherry-pick-pr.js
2728
scripts/processDiagnosticMessages.d.ts
@@ -45,4 +46,4 @@ TEST-results.xml
4546
package-lock.json
4647
tests
4748
.vscode
48-
.git
49+
.git

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/built/local/**
2+
/tests/**
3+
/lib/**
4+
/src/lib/*.generated.d.ts

.eslintrc.json

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"warnOnUnsupportedTypeScriptVersion": false,
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"env": {
9+
"browser": false,
10+
"node": true,
11+
"es6": true
12+
},
13+
"plugins": [
14+
"@typescript-eslint", "jsdoc", "no-null", "import"
15+
],
16+
"rules": {
17+
"@typescript-eslint/adjacent-overload-signatures": "error",
18+
"@typescript-eslint/array-type": "error",
19+
20+
"camelcase": "off",
21+
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],
22+
23+
"@typescript-eslint/class-name-casing": "error",
24+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
25+
"@typescript-eslint/interface-name-prefix": "error",
26+
"@typescript-eslint/no-inferrable-types": "error",
27+
"@typescript-eslint/no-misused-new": "error",
28+
"@typescript-eslint/no-this-alias": "error",
29+
"@typescript-eslint/prefer-for-of": "error",
30+
"@typescript-eslint/prefer-function-type": "error",
31+
"@typescript-eslint/prefer-namespace-keyword": "error",
32+
33+
"quotes": "off",
34+
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
35+
36+
"semi": "off",
37+
"@typescript-eslint/semi": "error",
38+
39+
"@typescript-eslint/triple-slash-reference": "error",
40+
"@typescript-eslint/type-annotation-spacing": "error",
41+
"@typescript-eslint/unified-signatures": "error",
42+
43+
// scripts/eslint/rules
44+
"object-literal-surrounding-space": "error",
45+
"no-type-assertion-whitespace": "error",
46+
"type-operator-spacing": "error",
47+
"only-arrow-functions": ["error", {
48+
"allowNamedFunctions": true ,
49+
"allowDeclarations": true
50+
}],
51+
"no-double-space": "error",
52+
"boolean-trivia": "error",
53+
"no-in-operator": "error",
54+
"simple-indent": "error",
55+
"debug-assert": "error",
56+
"no-keywords": "error",
57+
58+
// eslint-plugin-import
59+
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
60+
61+
// eslint-plugin-no-null
62+
"no-null/no-null": "error",
63+
64+
// eslint-plugin-jsdoc
65+
"jsdoc/check-alignment": "error",
66+
67+
// eslint
68+
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
69+
"constructor-super": "error",
70+
"curly": ["error", "multi-line"],
71+
"dot-notation": "error",
72+
"eqeqeq": "error",
73+
"linebreak-style": ["error", "windows"],
74+
"new-parens": "error",
75+
"no-caller": "error",
76+
"no-duplicate-case": "error",
77+
"no-duplicate-imports": "error",
78+
"no-empty": "error",
79+
"no-eval": "error",
80+
"no-extra-bind": "error",
81+
"no-fallthrough": "error",
82+
"no-new-func": "error",
83+
"no-new-wrappers": "error",
84+
"no-return-await": "error",
85+
"no-restricted-globals": ["error",
86+
{ "name": "setTimeout" },
87+
{ "name": "clearTimeout" },
88+
{ "name": "setInterval" },
89+
{ "name": "clearInterval" },
90+
{ "name": "setImmediate" },
91+
{ "name": "clearImmediate" }
92+
],
93+
"no-sparse-arrays": "error",
94+
"no-template-curly-in-string": "error",
95+
"no-throw-literal": "error",
96+
"no-trailing-spaces": "error",
97+
"no-undef-init": "error",
98+
"no-unsafe-finally": "error",
99+
"no-unused-expressions": ["error", { "allowTernary": true }],
100+
"no-unused-labels": "error",
101+
"no-var": "error",
102+
"object-shorthand": "error",
103+
"prefer-const": "error",
104+
"prefer-object-spread": "error",
105+
"quote-props": ["error", "consistent-as-needed"],
106+
"space-in-parens": "error",
107+
"unicode-bom": ["error", "never"],
108+
"use-isnan": "error"
109+
}
110+
}

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ Please help us by doing the following steps before logging an issue:
1515
Please fill in the *entire* template below.
1616
-->
1717

18-
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
19-
**TypeScript Version:** 3.4.0-dev.201xxxxx
18+
<!--
19+
Please try to reproduce the issue with the latest published version. It may have already been fixed.
20+
For npm: `typescript@next`
21+
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
22+
-->
23+
**TypeScript Version:** 3.7.x-dev.201xxxxx
2024

2125
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
2226
**Search Terms:**

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ about: Suggest an idea for this project
66

77
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨
88
9-
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.
9+
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.
10+
11+
Please help us by doing the following steps before logging an issue:
12+
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
13+
* Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ
1014
1115
-->
1216

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release-*
8+
pull_request:
9+
branches:
10+
- master
11+
- release-*
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [8.x, 10.x, 12.x]
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
with:
24+
fetch-depth: 5
25+
- name: Use node version ${{ matrix.node-version }}
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
- name: Remove existing TypeScript
30+
run: |
31+
npm uninstall typescript --no-save
32+
npm uninstall tslint --no-save
33+
- name: npm install and test
34+
run: |
35+
npm install
36+
npm update
37+
npm test

.gitignore

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ tests/cases/**/*.js
3737
!tests/cases/docker/*.js/
3838
tests/cases/**/*.js.map
3939
*.config
40+
scripts/eslint/built/
4041
scripts/debug.bat
4142
scripts/run.bat
4243
scripts/word2md.js
4344
scripts/buildProtocol.js
4445
scripts/ior.js
4546
scripts/authors.js
4647
scripts/configurePrerelease.js
48+
scripts/configureLanguageServiceBuild.js
49+
scripts/createLanguageServiceBuild.js
4750
scripts/open-user-pr.js
4851
scripts/open-cherry-pick-pr.js
4952
scripts/processDiagnosticMessages.d.ts
@@ -58,8 +61,11 @@ internal/
5861
**/.DS_Store
5962
.settings
6063
**/.vs
61-
**/.vscode
64+
**/.vscode/*
6265
!**/.vscode/tasks.json
66+
!**/.vscode/settings.template.json
67+
!**/.vscode/launch.template.json
68+
!**/.vscode/extensions.json
6369
!tests/cases/projects/projectOption/**/node_modules
6470
!tests/cases/projects/NodeModulesSearch/**/*
6571
!tests/baselines/reference/project/nodeModules*/**/*
@@ -78,4 +84,15 @@ tests/cases/user/*/**/*.d.ts
7884
tests/baselines/reference/dt
7985
.failed-tests
8086
TEST-results.xml
81-
package-lock.json
87+
package-lock.json
88+
tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
89+
tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
90+
tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
91+
tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
92+
tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
93+
tests/cases/user/create-react-app/create-react-app
94+
tests/cases/user/webpack/webpack
95+
tests/cases/user/puppeteer/puppeteer
96+
tests/cases/user/axios-src/axios-src
97+
tests/cases/user/prettier/prettier
98+
.eslintcache

.gitmodules

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +0,0 @@
1-
[submodule "tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter"]
2-
path = tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
3-
url = https://github.com/Microsoft/TypeScript-React-Starter
4-
ignore = all
5-
[submodule "tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter"]
6-
path = tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
7-
url = https://github.com/Microsoft/TypeScript-Node-Starter.git
8-
ignore = all
9-
[submodule "tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter"]
10-
path = tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
11-
url = https://github.com/Microsoft/TypeScript-React-Native-Starter.git
12-
ignore = all
13-
[submodule "tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter"]
14-
path = tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
15-
url = https://github.com/Microsoft/TypeScript-Vue-Starter.git
16-
ignore = all
17-
[submodule "tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter"]
18-
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
19-
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
20-
ignore = all
21-
[submodule "tests/cases/user/create-react-app/create-react-app"]
22-
path = tests/cases/user/create-react-app/create-react-app
23-
url = https://github.com/facebook/create-react-app.git
24-
ignore = all
25-
[submodule "tests/cases/user/webpack/webpack"]
26-
path = tests/cases/user/webpack/webpack
27-
url = https://github.com/webpack/webpack.git
28-
ignore = all
29-
[submodule "tests/cases/user/puppeteer/puppeteer"]
30-
path = tests/cases/user/puppeteer/puppeteer
31-
url = https://github.com/GoogleChrome/puppeteer.git
32-
ignore = all
33-
[submodule "tests/cases/user/axios-src/axios-src"]
34-
path = tests/cases/user/axios-src/axios-src
35-
url = https://github.com/axios/axios.git
36-
ignore = all
37-
[submodule "tests/cases/user/prettier/prettier"]
38-
path = tests/cases/user/prettier/prettier
39-
url = https://github.com/prettier/prettier.git
40-
ignore = all

.npmignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ netci.groovy
99
scripts
1010
src
1111
tests
12-
tslint.json
1312
Jakefile.js
13+
.eslintrc
14+
.eslintignore
1415
.editorconfig
1516
.failed-tests
1617
.git
@@ -30,4 +31,8 @@ yarn.lock
3031
CONTRIBUTING.md
3132
TEST-results.xml
3233
.dockerignore
33-
Dockerfile
34+
Dockerfile
35+
.DS_Store
36+
.eslintrc.json
37+
.yarnrc
38+
tmp

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ branches:
1818

1919
install:
2020
- npm uninstall typescript --no-save
21-
- npm uninstall tslint --no-save
2221
- npm install
2322

2423
cache:

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint"
4+
],
5+
6+
"unwantedRecommendations": [
7+
"ms-vscode.vscode-typescript-tslint-plugin"
8+
]
9+
}

.vscode/launch.template.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
3+
Copy this file into '.vscode/launch.json' or merge its
4+
contents into your existing configurations.
5+
6+
If you want to remove the errors in comments for all JSON
7+
files, add this to your settings in ~/.vscode/User/settings.json
8+
9+
"files.associations": {
10+
"*.json": "jsonc"
11+
},
12+
13+
*/
14+
15+
{
16+
// Use IntelliSense to learn about possible attributes.
17+
// Hover to view descriptions of existing attributes.
18+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
19+
"version": "0.2.0",
20+
"configurations": [
21+
{
22+
"type": "node",
23+
"protocol": "inspector",
24+
"request": "launch",
25+
"name": "Mocha Tests (currently opened test)",
26+
"runtimeArgs": ["--nolazy"],
27+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
28+
"args": [
29+
"-u",
30+
"bdd",
31+
"--no-timeouts",
32+
"--colors",
33+
"built/local/run.js",
34+
"-f",
35+
// You can change this to be the name of a specific test file (without the file extension)
36+
// to consistently launch the same test
37+
"${fileBasenameNoExtension}",
38+
"--skip-percent",
39+
"0"
40+
],
41+
"env": {
42+
"NODE_ENV": "testing"
43+
},
44+
"sourceMaps": true,
45+
"smartStep": true,
46+
"preLaunchTask": "tests",
47+
"console": "integratedTerminal",
48+
"outFiles": [
49+
"${workspaceRoot}/built/local/run.js"
50+
]
51+
},
52+
{
53+
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
54+
"type": "node",
55+
"request": "attach",
56+
"name": "Attach to VS Code TS Server via Port",
57+
"processId": "${command:PickProcess}"
58+
}
59+
]
60+
}

0 commit comments

Comments
 (0)