Skip to content

Commit d4a08f8

Browse files
committed
Merge branch 'main' into microsoft-19577
2 parents 4a50f11 + 842e733 commit d4a08f8

File tree

4,841 files changed

+1013653
-546886
lines changed

Some content is hidden

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

4,841 files changed

+1013653
-546886
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
ARG VARIANT="14-buster"
55
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
66

7-
RUN sudo -u node npm install -g gulp-cli
7+
RUN sudo -u node npm install -g hereby

.dockerignore

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +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/authors.js
24-
scripts/configurePrerelease.js
25-
scripts/open-user-pr.js
26-
scripts/open-cherry-pick-pr.js
27-
scripts/processDiagnosticMessages.d.ts
28-
scripts/processDiagnosticMessages.js
29-
scripts/produceLKG.js
30-
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
31-
scripts/generateLocalizedDiagnosticMessages.js
32-
scripts/configureLanguageServiceBuild.js
33-
scripts/*.js.map
34-
scripts/typings/
20+
scripts/**/*.js
21+
scripts/**/*.js.map
3522
coverage/
3623
internal/
3724
**/.DS_Store

.eslintignore

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
/built/local/**
1+
**/node_modules/**
2+
/built/**
23
/tests/**
34
/lib/**
45
/src/lib/*.generated.d.ts
6+
# Ignore all compiled script outputs
7+
/scripts/**/*.js
8+
/scripts/**/*.d.*
9+
# But, not the ones that are hand-written.
10+
# TODO: remove once scripts are pure JS
11+
!/scripts/browserIntegrationTest.js
12+
!/scripts/createPlaygroundBuild.js
13+
!/scripts/failed-tests.js
14+
!/scripts/find-unused-diagnostic-messages.js
15+
!/scripts/lint-hooks.js
16+
!/scripts/perf-result-post.js
17+
!/scripts/post-vsts-artifact-comment.js
18+
!/scripts/regenerate-unicode-identifier-parts.js
19+
!/scripts/run-sequence.js
20+
!/scripts/update-experimental-branches.js
21+
/scripts/eslint/built/**
22+
/internal/**
23+
/coverage/**

.eslintplugin.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
4+
const rulesDir = path.join(__dirname, "scripts", "eslint", "rules");
5+
const ext = ".cjs";
6+
const ruleFiles = fs.readdirSync(rulesDir).filter((p) => p.endsWith(ext));
7+
8+
module.exports = {
9+
rules: Object.fromEntries(ruleFiles.map((p) => {
10+
return [p.slice(0, -ext.length), require(path.join(rulesDir, p))];
11+
})),
12+
}

.eslintrc.json

Lines changed: 54 additions & 18 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": {
@@ -11,11 +10,18 @@
1110
"es6": true
1211
},
1312
"plugins": [
14-
"@typescript-eslint", "jsdoc", "no-null", "import"
13+
"@typescript-eslint", "no-null", "import", "eslint-plugin-local"
1514
],
1615
"rules": {
16+
"sort-imports": ["error", {
17+
"ignoreCase": true,
18+
"ignoreDeclarationSort": true,
19+
"allowSeparatedGroups": true
20+
}],
21+
1722
"@typescript-eslint/adjacent-overload-signatures": "error",
1823
"@typescript-eslint/array-type": "error",
24+
"@typescript-eslint/no-array-constructor": "error",
1925

2026
"brace-style": "off",
2127
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
@@ -51,12 +57,14 @@
5157
"@typescript-eslint/prefer-for-of": "error",
5258
"@typescript-eslint/prefer-function-type": "error",
5359
"@typescript-eslint/prefer-namespace-keyword": "error",
60+
"@typescript-eslint/prefer-as-const": "error",
5461

5562
"quotes": "off",
5663
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
5764

5865
"semi": "off",
5966
"@typescript-eslint/semi": "error",
67+
"@typescript-eslint/no-extra-semi": "error",
6068

6169
"space-before-function-paren": "off",
6270
"@typescript-eslint/space-before-function-paren": ["error", {
@@ -69,31 +77,30 @@
6977
"@typescript-eslint/type-annotation-spacing": "error",
7078
"@typescript-eslint/unified-signatures": "error",
7179

80+
"@typescript-eslint/no-extra-non-null-assertion": "error",
81+
7282
// scripts/eslint/rules
73-
"object-literal-surrounding-space": "error",
74-
"no-type-assertion-whitespace": "error",
75-
"type-operator-spacing": "error",
76-
"only-arrow-functions": ["error", {
83+
"local/object-literal-surrounding-space": "error",
84+
"local/no-type-assertion-whitespace": "error",
85+
"local/type-operator-spacing": "error",
86+
"local/only-arrow-functions": ["error", {
7787
"allowNamedFunctions": true ,
7888
"allowDeclarations": true
7989
}],
80-
"no-double-space": "error",
81-
"boolean-trivia": "error",
82-
"no-in-operator": "error",
83-
"simple-indent": "error",
84-
"debug-assert": "error",
85-
"no-keywords": "error",
86-
"one-namespace-per-file": "error",
90+
"local/no-double-space": "error",
91+
"local/boolean-trivia": "error",
92+
"local/no-in-operator": "error",
93+
"local/simple-indent": "error",
94+
"local/debug-assert": "error",
95+
"local/no-keywords": "error",
96+
"local/jsdoc-format": "error",
8797

8898
// eslint-plugin-import
8999
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
90100

91101
// eslint-plugin-no-null
92102
"no-null/no-null": "error",
93103

94-
// eslint-plugin-jsdoc
95-
"jsdoc/check-alignment": "error",
96-
97104
// eslint
98105
"constructor-super": "error",
99106
"curly": ["error", "multi-line"],
@@ -132,6 +139,35 @@
132139
"quote-props": ["error", "consistent-as-needed"],
133140
"space-in-parens": "error",
134141
"unicode-bom": ["error", "never"],
135-
"use-isnan": "error"
136-
}
142+
"use-isnan": "error",
143+
"no-prototype-builtins": "error",
144+
"no-self-assign": "error",
145+
"no-dupe-else-if": "error"
146+
},
147+
"overrides": [
148+
// By default, the ESLint CLI only looks at .js files. But, it will also look at
149+
// any files which are referenced in an override config. Most users of typescript-eslint
150+
// get this behavior by default by extending a recommended typescript-eslint config, which
151+
// just so happens to override some core ESLint rules. We don't extend from any config, so
152+
// explicitly reference TS files here so the CLI picks them up.
153+
//
154+
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
155+
// that will work regardless of the below.
156+
//
157+
// The same applies to mjs files; ESLint appears to not scan those either.
158+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] },
159+
{
160+
"files": ["*.mjs", "*.mts"],
161+
"rules": {
162+
// These globals don't exist outside of CJS files.
163+
"no-restricted-globals": ["error",
164+
{ "name": "__filename" },
165+
{ "name": "__dirname" },
166+
{ "name": "require" },
167+
{ "name": "module" },
168+
{ "name": "exports" }
169+
]
170+
}
171+
}
172+
]
137173
}

.git-blame-ignore-revs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated module conversion step - inlineImports
2+
07758c08ab72481885e662c98d67a0e3a071b032
3+
# Generated module conversion step - stripNamespaces
4+
b6c053882696af8ddd94a600429f30584d303d7f
5+
# Generated module conversion step - explicitify
6+
9a0b85ce2a3f85f498ab2c05474b4c0b96b111c9
7+
# Generated module conversion step - unindent
8+
94724a8c2e68a4c7e267072ca79971f317c45e4a
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
name : CodeQL Configuration
22

33
paths:
4-
- './src'
4+
- src
5+
- scripts
6+
- Gulpfile.mjs
7+
paths-ignore:
8+
- src/lib
9+
10+
# These queries appear to time out after the module conversion.
11+
# https://github.com/github/codeql/issues/10937
12+
query-filters:
13+
- exclude:
14+
id: js/path-injection # TaintedPath.ql
15+
- exclude:
16+
id: js/command-line-injection # CommandInjection.ql
17+
- exclude:
18+
id: js/code-injection # CodeInjection.ql
19+
- exclude:
20+
id: js/bad-code-sanitization # ImproperCodeSanitization.ql
21+
- exclude:
22+
id: js/unsafe-dynamic-method-access # UnsafeDynamicMethodAccess.ql
23+
- exclude:
24+
id: js/clear-text-logging # CleartextLogging.ql
25+
- exclude:
26+
id: js/regex-injection # RegExpInjection.ql
27+
- exclude:
28+
id: js/unvalidated-dynamic-method-call # UnvalidatedDynamicMethodCall.ql
29+
- exclude:
30+
id: js/insecure-download # InsecureDownload.ql
31+
- exclude:
32+
id: js/prototype-polluting-assignment # PrototypePollutingAssignment.ql
33+
- exclude:
34+
id: js/request-forgery # RequestForgery.ql

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for submitting a pull request!
44
Please verify that:
55
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
66
* [ ] Code is up-to-date with the `main` branch
7-
* [ ] You've successfully run `gulp runtests` locally
7+
* [ ] You've successfully run `hereby runtests` locally
88
* [ ] There are new or updated unit tests validating the change
99
1010
Refer to CONTRIBUTING.MD for more details.

.github/tsc.json

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

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

Lines changed: 3 additions & 3 deletions
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
@@ -17,8 +17,8 @@ jobs:
1717
git config user.name "TypeScript Bot"
1818
npm install
1919
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
20-
gulp runtests-parallel --ci --fix || true
21-
gulp baseline-accept
20+
npx hereby runtests-parallel --ci --fix || true
21+
npx hereby baseline-accept
2222
git add ./src
2323
git add ./tests/baselines/reference
2424
git diff --cached

0 commit comments

Comments
 (0)