Skip to content

Commit 2149ae6

Browse files
Merge main branch: Array line number changes
2 parents 48fe04f + e14a229 commit 2149ae6

File tree

1,110 files changed

+70617
-47167
lines changed

Some content is hidden

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

1,110 files changed

+70617
-47167
lines changed

.dockerignore

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,8 @@ build.json
1717
*.config
1818
scripts/debug.bat
1919
scripts/run.bat
20-
scripts/word2md.js
21-
scripts/buildProtocol.js
22-
scripts/ior.js
23-
scripts/configurePrerelease.js
24-
scripts/open-user-pr.js
25-
scripts/open-cherry-pick-pr.js
26-
scripts/processDiagnosticMessages.d.ts
27-
scripts/processDiagnosticMessages.js
28-
scripts/produceLKG.js
29-
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
30-
scripts/generateLocalizedDiagnosticMessages.js
31-
scripts/configureLanguageServiceBuild.js
32-
scripts/*.js.map
33-
scripts/typings/
20+
scripts/**/*.js
21+
scripts/**/*.js.map
3422
coverage/
3523
internal/
3624
**/.DS_Store

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
/lib/**
55
/src/lib/*.generated.d.ts
66
# Ignore all compiled script outputs
7-
/scripts/*.js
7+
/scripts/**/*.js
8+
/scripts/**/*.d.*
89
# But, not the ones that are hand-written.
910
# TODO: remove once scripts are pure JS
1011
!/scripts/browserIntegrationTest.js

.eslintplugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require("fs");
22
const path = require("path");
33

44
const rulesDir = path.join(__dirname, "scripts", "eslint", "rules");
5-
const ext = ".js";
5+
const ext = ".cjs";
66
const ruleFiles = fs.readdirSync(rulesDir).filter((p) => p.endsWith(ext));
77

88
module.exports = {

.eslintrc.json

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"parser": "@typescript-eslint/parser",
33
"parserOptions": {
44
"warnOnUnsupportedTypeScriptVersion": false,
5-
"ecmaVersion": 6,
65
"sourceType": "module"
76
},
87
"env": {
@@ -13,20 +12,10 @@
1312
"plugins": [
1413
"@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local"
1514
],
16-
"overrides": [
17-
// By default, the ESLint CLI only looks at .js files. But, it will also look at
18-
// any files which are referenced in an override config. Most users of typescript-eslint
19-
// get this behavior by default by extending a recommended typescript-eslint config, which
20-
// just so happens to override some core ESLint rules. We don't extend from any config, so
21-
// explicitly reference TS files here so the CLI picks them up.
22-
//
23-
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
24-
// that will work regardless of the below.
25-
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
26-
],
2715
"rules": {
2816
"@typescript-eslint/adjacent-overload-signatures": "error",
2917
"@typescript-eslint/array-type": "error",
18+
"@typescript-eslint/no-array-constructor": "error",
3019

3120
"brace-style": "off",
3221
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
@@ -62,12 +51,14 @@
6251
"@typescript-eslint/prefer-for-of": "error",
6352
"@typescript-eslint/prefer-function-type": "error",
6453
"@typescript-eslint/prefer-namespace-keyword": "error",
54+
"@typescript-eslint/prefer-as-const": "error",
6555

6656
"quotes": "off",
6757
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
6858

6959
"semi": "off",
7060
"@typescript-eslint/semi": "error",
61+
"@typescript-eslint/no-extra-semi": "error",
7162

7263
"space-before-function-paren": "off",
7364
"@typescript-eslint/space-before-function-paren": ["error", {
@@ -80,6 +71,8 @@
8071
"@typescript-eslint/type-annotation-spacing": "error",
8172
"@typescript-eslint/unified-signatures": "error",
8273

74+
"@typescript-eslint/no-extra-non-null-assertion": "error",
75+
8376
// scripts/eslint/rules
8477
"local/object-literal-surrounding-space": "error",
8578
"local/no-type-assertion-whitespace": "error",
@@ -143,6 +136,35 @@
143136
"quote-props": ["error", "consistent-as-needed"],
144137
"space-in-parens": "error",
145138
"unicode-bom": ["error", "never"],
146-
"use-isnan": "error"
147-
}
139+
"use-isnan": "error",
140+
"no-prototype-builtins": "error",
141+
"no-self-assign": "error",
142+
"no-dupe-else-if": "error"
143+
},
144+
"overrides": [
145+
// By default, the ESLint CLI only looks at .js files. But, it will also look at
146+
// any files which are referenced in an override config. Most users of typescript-eslint
147+
// get this behavior by default by extending a recommended typescript-eslint config, which
148+
// just so happens to override some core ESLint rules. We don't extend from any config, so
149+
// explicitly reference TS files here so the CLI picks them up.
150+
//
151+
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
152+
// that will work regardless of the below.
153+
//
154+
// The same applies to mjs files; ESLint appears to not scan those either.
155+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] },
156+
{
157+
"files": ["*.mjs", "*.mts"],
158+
"rules": {
159+
// These globals don't exist outside of CJS files.
160+
"no-restricted-globals": ["error",
161+
{ "name": "__filename" },
162+
{ "name": "__dirname" },
163+
{ "name": "require" },
164+
{ "name": "module" },
165+
{ "name": "exports" }
166+
]
167+
}
168+
}
169+
]
148170
}

.github/tsc.json

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

.github/workflows/accept-baselines-fix-lints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313

1414
- name: Configure Git, Run Tests, Update Baselines, Apply Fixes

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,20 @@ jobs:
6767

6868
- name: Validate the browser can import TypeScript
6969
run: gulp test-browser-integration
70+
71+
misc:
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- uses: actions/checkout@v3
76+
- uses: actions/setup-node@v3
77+
with:
78+
node-version: "*"
79+
check-latest: true
80+
- run: npm ci
81+
82+
- name: Build scripts
83+
run: gulp scripts
84+
85+
- name: ESLint tests
86+
run: gulp run-eslint-rules-tests

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919
with:
2020
# We must fetch at least the immediate parents so that if this is
2121
# a pull request then we can checkout the head.
2222
fetch-depth: 2
2323

2424
# Initializes the CodeQL tools for scanning.
2525
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@v1
26+
uses: github/codeql-action/init@v2
2727
with:
2828
config-file: ./.github/codeql/codeql-configuration.yml
2929
# Override language selection by uncommenting this and choosing your languages
@@ -33,7 +33,7 @@ jobs:
3333
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
3434
# If this step fails, then you should remove it and run the build manually (see below)
3535
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v1
36+
uses: github/codeql-action/autobuild@v2
3737

3838
# ℹ️ Command-line programs to run using the OS shell.
3939
# 📚 https://git.io/JvXDl
@@ -47,4 +47,4 @@ jobs:
4747
# make release
4848

4949
- name: Perform CodeQL Analysis
50-
uses: github/codeql-action/analyze@v1
50+
uses: github/codeql-action/analyze@v2

.github/workflows/ensure-related-repos-run-crons.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
git config --global user.email "[email protected]"
2323
git config --global user.name "TypeScript Bot"
2424
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626
with:
2727
repository: 'microsoft/TypeScript-Website'
2828
path: 'ts-site'
@@ -34,7 +34,7 @@ jobs:
3434
git config --unset-all http.https://github.com/.extraheader
3535
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Website.git
3636
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838
with:
3939
repository: 'microsoft/TypeScript-Make-Monaco-Builds'
4040
path: 'monaco-builds'

.github/workflows/new-release-branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- uses: actions/setup-node@v3
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 5
1616
- run: |

.github/workflows/nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: github.repository == 'microsoft/TypeScript'
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- uses: actions/setup-node@v3
1919
with:
2020
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.

.github/workflows/release-branch-artifact.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- uses: actions/setup-node@v3
1515
- name: npm install and test
1616
run: |
@@ -27,7 +27,7 @@ jobs:
2727
npm pack ./
2828
mv typescript-*.tgz typescript.tgz
2929
- name: Upload built tarfile
30-
uses: actions/upload-artifact@v1
30+
uses: actions/upload-artifact@v3
3131
with:
3232
name: tgz
3333
path: typescript.tgz

.github/workflows/rich-navigation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: windows-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 5
2121

.github/workflows/set-version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- uses: actions/setup-node@v3
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
ref: ${{ github.event.client_payload.branch_name }}
1616
# notably, this is essentially the same script as `new-release-branch.yaml` (with fewer inputs), but it assumes the branch already exists

.github/workflows/sync-branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- uses: actions/setup-node@v3
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
2121
fetch-depth: 0

.github/workflows/sync-wiki.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: Get repo name
1010
run: R=${GITHUB_REPOSITORY%?wiki}; echo "BASENAME=${R##*/}" >> $GITHUB_ENV
1111
- name: Checkout ${{ env.BASENAME }}-wiki
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
with:
1414
repository: "${{ GITHUB.repository_owner }}/${{ env.BASENAME }}-wiki"
1515
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}

.github/workflows/update-lkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313

1414
- name: Configure Git and Update LKG

.github/workflows/update-package-lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: github.repository == 'microsoft/TypeScript'
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
with:
1818
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
1919
- uses: actions/setup-node@v3

.gitignore

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,8 @@ tests/cases/**/*.js.map
4040
scripts/eslint/built/
4141
scripts/debug.bat
4242
scripts/run.bat
43-
scripts/word2md.js
44-
scripts/buildProtocol.js
45-
scripts/ior.js
46-
scripts/configurePrerelease.js
47-
scripts/configureLanguageServiceBuild.js
48-
scripts/open-user-pr.js
49-
scripts/open-cherry-pick-pr.js
50-
scripts/processDiagnosticMessages.d.ts
51-
scripts/processDiagnosticMessages.js
52-
scripts/produceLKG.js
53-
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
54-
scripts/generateLocalizedDiagnosticMessages.js
55-
scripts/request-pr-review.js
56-
scripts/errorCheck.js
57-
scripts/*.js.map
58-
scripts/typings/
43+
scripts/**/*.js
44+
scripts/**/*.js.map
5945
coverage/
6046
internal/
6147
**/.DS_Store

0 commit comments

Comments
 (0)