Skip to content

Commit c823418

Browse files
committed
Merge remote-tracking branch 'origin/main' into omit-on-indexable-type
# Conflicts: # package-lock.json # package.json # src/compiler/checker.ts # tests/baselines/reference/omitTypeHelperModifiers01.types # tests/baselines/reference/omitTypeTestErrors01.types # tests/baselines/reference/omitTypeTests01.types
2 parents 662483e + 43cc362 commit c823418

File tree

18,588 files changed

+2589138
-1575480
lines changed

Some content is hidden

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

18,588 files changed

+2589138
-1575480
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

.devcontainer/devcontainer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
}
88
},
99
"settings": {
10-
"terminal.integrated.shell.linux": "/bin/bash"
10+
"terminal.integrated.defaultProfile.linux": "bash",
11+
"terminal.integrated.profiles.linux": {
12+
"bash": {
13+
"path": "/bin/bash",
14+
"icon": "terminal-bash",
15+
},
16+
},
1117
},
1218
"extensions": [
1319
"dbaeumer.vscode-eslint"

.dockerignore

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

.eslintignore

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

.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: 76 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2+
"root": true,
23
"parser": "@typescript-eslint/parser",
34
"parserOptions": {
45
"warnOnUnsupportedTypeScriptVersion": false,
5-
"ecmaVersion": 6,
66
"sourceType": "module"
77
},
88
"env": {
@@ -11,11 +11,26 @@
1111
"es6": true
1212
},
1313
"plugins": [
14-
"@typescript-eslint", "jsdoc", "no-null", "import"
14+
"@typescript-eslint", "no-null", "import", "eslint-plugin-local", "simple-import-sort"
15+
],
16+
"ignorePatterns": [
17+
"**/node_modules/**",
18+
"/built/**",
19+
"/tests/**",
20+
"/lib/**",
21+
"/src/lib/*.generated.d.ts",
22+
"/scripts/**/*.js",
23+
"/scripts/**/*.d.*",
24+
"/internal/**",
25+
"/coverage/**"
1526
],
1627
"rules": {
28+
"simple-import-sort/imports": "error",
29+
"simple-import-sort/exports": "error",
30+
1731
"@typescript-eslint/adjacent-overload-signatures": "error",
1832
"@typescript-eslint/array-type": "error",
33+
"@typescript-eslint/no-array-constructor": "error",
1934

2035
"brace-style": "off",
2136
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
@@ -27,13 +42,16 @@
2742
{ "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 } },
2843
{ "selector": "function", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
2944
{ "selector": "parameter", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^(_+|[A-Za-z]+_[A-Z][a-z]+)$", "match": false } },
30-
{ "selector": "method", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
31-
{ "selector": "memberLike", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
45+
{ "selector": "method", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^([0-9]+|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
46+
{ "selector": "memberLike", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^([0-9]+|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
3247
{ "selector": "enumMember", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
3348
{ "selector": "property", "format": null }
3449
],
3550

3651
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
52+
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
53+
54+
"max-statements-per-line": ["error", { "max": 1 }],
3755

3856
"no-duplicate-imports": "off",
3957
"@typescript-eslint/no-duplicate-imports": "error",
@@ -48,12 +66,14 @@
4866
"@typescript-eslint/prefer-for-of": "error",
4967
"@typescript-eslint/prefer-function-type": "error",
5068
"@typescript-eslint/prefer-namespace-keyword": "error",
69+
"@typescript-eslint/prefer-as-const": "error",
5170

5271
"quotes": "off",
5372
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
5473

5574
"semi": "off",
5675
"@typescript-eslint/semi": "error",
76+
"@typescript-eslint/no-extra-semi": "error",
5777

5878
"space-before-function-paren": "off",
5979
"@typescript-eslint/space-before-function-paren": ["error", {
@@ -66,31 +86,30 @@
6686
"@typescript-eslint/type-annotation-spacing": "error",
6787
"@typescript-eslint/unified-signatures": "error",
6888

89+
"@typescript-eslint/no-extra-non-null-assertion": "error",
90+
6991
// scripts/eslint/rules
70-
"object-literal-surrounding-space": "error",
71-
"no-type-assertion-whitespace": "error",
72-
"type-operator-spacing": "error",
73-
"only-arrow-functions": ["error", {
92+
"local/object-literal-surrounding-space": "error",
93+
"local/no-type-assertion-whitespace": "error",
94+
"local/type-operator-spacing": "error",
95+
"local/only-arrow-functions": ["error", {
7496
"allowNamedFunctions": true ,
7597
"allowDeclarations": true
7698
}],
77-
"no-double-space": "error",
78-
"boolean-trivia": "error",
79-
"no-in-operator": "error",
80-
"simple-indent": "error",
81-
"debug-assert": "error",
82-
"no-keywords": "error",
83-
"one-namespace-per-file": "error",
99+
"local/no-double-space": "error",
100+
"local/boolean-trivia": "error",
101+
"local/no-in-operator": "error",
102+
"local/simple-indent": "error",
103+
"local/debug-assert": "error",
104+
"local/no-keywords": "error",
105+
"local/jsdoc-format": "error",
84106

85107
// eslint-plugin-import
86108
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
87109

88110
// eslint-plugin-no-null
89111
"no-null/no-null": "error",
90112

91-
// eslint-plugin-jsdoc
92-
"jsdoc/check-alignment": "error",
93-
94113
// eslint
95114
"constructor-super": "error",
96115
"curly": ["error", "multi-line"],
@@ -129,6 +148,43 @@
129148
"quote-props": ["error", "consistent-as-needed"],
130149
"space-in-parens": "error",
131150
"unicode-bom": ["error", "never"],
132-
"use-isnan": "error"
133-
}
151+
"use-isnan": "error",
152+
"no-prototype-builtins": "error",
153+
"no-self-assign": "error",
154+
"no-dupe-else-if": "error"
155+
},
156+
"overrides": [
157+
// By default, the ESLint CLI only looks at .js files. But, it will also look at
158+
// any files which are referenced in an override config. Most users of typescript-eslint
159+
// get this behavior by default by extending a recommended typescript-eslint config, which
160+
// just so happens to override some core ESLint rules. We don't extend from any config, so
161+
// explicitly reference TS files here so the CLI picks them up.
162+
//
163+
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
164+
// that will work regardless of the below.
165+
//
166+
// The same applies to mjs files; ESLint appears to not scan those either.
167+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] },
168+
{
169+
"files": ["*.mjs", "*.mts"],
170+
"rules": {
171+
// These globals don't exist outside of CJS files.
172+
"no-restricted-globals": ["error",
173+
{ "name": "__filename" },
174+
{ "name": "__dirname" },
175+
{ "name": "require" },
176+
{ "name": "module" },
177+
{ "name": "exports" }
178+
]
179+
}
180+
},
181+
{
182+
// These files contain imports in a specific order that are generally unsafe to modify.
183+
"files": ["**/_namespaces/**"],
184+
"rules": {
185+
"simple-import-sort/imports": "off",
186+
"simple-import-sort/exports": "off"
187+
}
188+
}
189+
]
134190
}

.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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.js linguist-language=TypeScript
2+
**/*.json linguist-language=jsonc
23
* -text

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ about: Create a report to help us improve TypeScript
44
title: ''
55
labels: ''
66
assignees: ''
7+
78
---
9+
810
# Bug Report
911

1012
<!--

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ about: Suggest an idea
44
title: ''
55
labels: ''
66
assignees: ''
7+
78
---
9+
810
# Suggestion
911

1012
<!--

0 commit comments

Comments
 (0)