Skip to content

Commit a647657

Browse files
committed
Merge branch 'main' into more-dym-plainjs-errors-on-classes
2 parents 1b72301 + 9b4aa36 commit a647657

File tree

49,776 files changed

+2238809
-1701135
lines changed

Some content is hidden

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

49,776 files changed

+2238809
-1701135
lines changed

.c8rc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"reporter": ["lcovonly", "cobertura"],
3+
"src": "src",
4+
"include": ["src/**", "built/local/**"],
5+
"exclude": ["**/node_modules/**"],
6+
"mergeAsync": true
7+
}

.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: 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: 142 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,71 @@
11
{
2+
"root": true,
23
"parser": "@typescript-eslint/parser",
34
"parserOptions": {
45
"warnOnUnsupportedTypeScriptVersion": false,
5-
"ecmaVersion": 6,
66
"sourceType": "module"
77
},
88
"env": {
99
"browser": false,
1010
"node": true,
1111
"es6": true
1212
},
13+
"extends": [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:@typescript-eslint/stylistic"
17+
],
1318
"plugins": [
14-
"@typescript-eslint", "jsdoc", "no-null", "import"
19+
"@typescript-eslint", "no-null", "eslint-plugin-local", "simple-import-sort"
20+
],
21+
"ignorePatterns": [
22+
"**/node_modules/**",
23+
"/built/**",
24+
"/tests/**",
25+
"/lib/**",
26+
"/src/lib/*.generated.d.ts",
27+
"/scripts/**/*.js",
28+
"/scripts/**/*.d.*",
29+
"/internal/**",
30+
"/coverage/**"
1531
],
1632
"rules": {
17-
"@typescript-eslint/adjacent-overload-signatures": "error",
18-
"@typescript-eslint/array-type": "error",
33+
// eslint
34+
"dot-notation": "error",
35+
"eqeqeq": "error",
36+
"no-caller": "error",
37+
"no-constant-condition": ["error", { "checkLoops": false }],
38+
"no-eval": "error",
39+
"no-extra-bind": "error",
40+
"no-new-func": "error",
41+
"no-new-wrappers": "error",
42+
"no-return-await": "error",
43+
"no-restricted-globals": [
44+
"error",
45+
{ "name": "setTimeout" },
46+
{ "name": "clearTimeout" },
47+
{ "name": "setInterval" },
48+
{ "name": "clearInterval" },
49+
{ "name": "setImmediate" },
50+
{ "name": "clearImmediate" }
51+
],
52+
"no-template-curly-in-string": "error",
53+
"no-throw-literal": "error",
54+
"no-undef-init": "error",
55+
"no-var": "error",
56+
"object-shorthand": "error",
57+
"prefer-const": "error",
58+
"prefer-object-spread": "error",
59+
"unicode-bom": ["error", "never"],
1960

20-
"brace-style": "off",
21-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
61+
// Enabled in eslint:recommended, but not applicable here
62+
"no-extra-boolean-cast": "off",
63+
"no-case-declarations": "off",
64+
"no-cond-assign": "off",
65+
"no-control-regex": "off",
66+
"no-inner-declarations": "off",
2267

68+
// @typescript-eslint/eslint-plugin
2369
"@typescript-eslint/naming-convention": [
2470
"error",
2571
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -33,105 +79,107 @@
3379
{ "selector": "property", "format": null }
3480
],
3581

36-
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
37-
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
38-
39-
"max-statements-per-line": ["error", { "max": 1 }],
40-
41-
"no-duplicate-imports": "off",
42-
"@typescript-eslint/no-duplicate-imports": "error",
43-
44-
"@typescript-eslint/no-inferrable-types": "error",
45-
"@typescript-eslint/no-misused-new": "error",
46-
"@typescript-eslint/no-this-alias": "error",
47-
48-
"no-unused-expressions": "off",
49-
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
50-
51-
"@typescript-eslint/prefer-for-of": "error",
52-
"@typescript-eslint/prefer-function-type": "error",
53-
"@typescript-eslint/prefer-namespace-keyword": "error",
54-
55-
"quotes": "off",
56-
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
57-
58-
"semi": "off",
59-
"@typescript-eslint/semi": "error",
60-
61-
"space-before-function-paren": "off",
62-
"@typescript-eslint/space-before-function-paren": ["error", {
63-
"asyncArrow": "always",
64-
"anonymous": "always",
65-
"named": "never"
66-
}],
67-
68-
"@typescript-eslint/triple-slash-reference": "error",
69-
"@typescript-eslint/type-annotation-spacing": "error",
70-
"@typescript-eslint/unified-signatures": "error",
82+
// Rules enabled in typescript-eslint configs that are not applicable here
83+
"@typescript-eslint/ban-ts-comment": "off",
84+
"@typescript-eslint/class-literal-property-style": "off",
85+
"@typescript-eslint/consistent-indexed-object-style": "off",
86+
"@typescript-eslint/no-duplicate-enum-values": "off",
87+
"@typescript-eslint/no-namespace": "off",
88+
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
89+
"@typescript-eslint/no-var-requires": "off",
90+
"@typescript-eslint/no-empty-interface": "off",
91+
"@typescript-eslint/no-explicit-any": "off",
92+
93+
// Todo: For each of these, investigate whether we want to enable them ✨
94+
"@typescript-eslint/ban-types": "off",
95+
"no-useless-escape": "off",
96+
"prefer-rest-params": "off",
97+
"prefer-spread": "off",
98+
"@typescript-eslint/no-empty-function": "off",
99+
"@typescript-eslint/no-unused-vars": "off",
100+
101+
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
102+
"@typescript-eslint/prefer-optional-chain": "off",
71103

72104
// 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", {
77-
"allowNamedFunctions": true ,
78-
"allowDeclarations": true
79-
}],
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",
87-
88-
// eslint-plugin-import
89-
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
105+
"local/only-arrow-functions": [
106+
"error",
107+
{
108+
"allowNamedFunctions": true ,
109+
"allowDeclarations": true
110+
}
111+
],
112+
"local/argument-trivia": "error",
113+
"local/no-in-operator": "error",
114+
"local/debug-assert": "error",
115+
"local/no-keywords": "error",
116+
"local/jsdoc-format": "error",
90117

91118
// eslint-plugin-no-null
92119
"no-null/no-null": "error",
93120

94-
// eslint-plugin-jsdoc
95-
"jsdoc/check-alignment": "error",
121+
// eslint-plugin-simple-import-sort
122+
"simple-import-sort/imports": "error",
123+
"simple-import-sort/exports": "error",
96124

97-
// eslint
98-
"constructor-super": "error",
125+
// Formatting rules; remove once a formatter enforces these.
99126
"curly": ["error", "multi-line"],
100-
"dot-notation": "error",
101-
"eqeqeq": "error",
102127
"linebreak-style": ["error", "windows"],
128+
"max-statements-per-line": ["error", { "max": 1 }],
103129
"new-parens": "error",
104-
"no-caller": "error",
105-
"no-duplicate-case": "error",
106-
"no-empty": "error",
107-
"no-eval": "error",
108-
"no-extra-bind": "error",
109-
"no-fallthrough": "error",
110-
"no-new-func": "error",
111-
"no-new-wrappers": "error",
112-
"no-return-await": "error",
113-
"no-restricted-globals": ["error",
114-
{ "name": "setTimeout" },
115-
{ "name": "clearTimeout" },
116-
{ "name": "setInterval" },
117-
{ "name": "clearInterval" },
118-
{ "name": "setImmediate" },
119-
{ "name": "clearImmediate" }
120-
],
121-
"no-sparse-arrays": "error",
122-
"no-template-curly-in-string": "error",
123-
"no-throw-literal": "error",
124130
"no-trailing-spaces": "error",
125-
"no-undef-init": "error",
126-
"no-unsafe-finally": "error",
127-
"no-unused-labels": "error",
128-
"no-var": "error",
129-
"object-shorthand": "error",
130-
"prefer-const": "error",
131-
"prefer-object-spread": "error",
132131
"quote-props": ["error", "consistent-as-needed"],
133132
"space-in-parens": "error",
134-
"unicode-bom": ["error", "never"],
135-
"use-isnan": "error"
136-
}
133+
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
134+
"@typescript-eslint/no-extra-semi": "error",
135+
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
136+
"@typescript-eslint/semi": "error",
137+
"@typescript-eslint/space-before-function-paren": [
138+
"error",
139+
{
140+
"asyncArrow": "always",
141+
"anonymous": "always",
142+
"named": "never"
143+
}
144+
],
145+
"local/object-literal-surrounding-space": "error",
146+
"local/no-type-assertion-whitespace": "error",
147+
"local/type-operator-spacing": "error",
148+
"local/no-double-space": "error",
149+
"local/simple-indent": "error"
150+
},
151+
"overrides": [
152+
// By default, the ESLint CLI only looks at .js files. But, it will also look at
153+
// any files which are referenced in an override config. Most users of typescript-eslint
154+
// get this behavior by default by extending a recommended typescript-eslint config, which
155+
// just so happens to override some core ESLint rules. We don't extend from any config, so
156+
// explicitly reference TS files here so the CLI picks them up.
157+
//
158+
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
159+
// that will work regardless of the below.
160+
//
161+
// The same applies to mjs files; ESLint appears to not scan those either.
162+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] },
163+
{
164+
"files": ["*.mjs", "*.mts"],
165+
"rules": {
166+
// These globals don't exist outside of CJS files.
167+
"no-restricted-globals": ["error",
168+
{ "name": "__filename" },
169+
{ "name": "__dirname" },
170+
{ "name": "require" },
171+
{ "name": "module" },
172+
{ "name": "exports" }
173+
]
174+
}
175+
},
176+
{
177+
// These files contain imports in a specific order that are generally unsafe to modify.
178+
"files": ["**/_namespaces/**"],
179+
"rules": {
180+
"simple-import-sort/imports": "off",
181+
"simple-import-sort/exports": "off"
182+
}
183+
}
184+
]
137185
}

.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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,16 @@ Please keep and fill in the line that best applies:
4343
### ⏯ Playground Link
4444

4545
<!--
46-
A link to a TypeScript Playground "Share" link which shows this behavior
47-
48-
The TypeScript Workbench can be used for more complex setups, try
49-
https://www.typescriptlang.org/dev/bug-workbench/
46+
A link to a TypeScript Playground "Share" link which shows this behavior.
47+
This should have the same code as the code snippet below, and use whichever settings are relevant to your report.
5048
5149
As a last resort, you can link to a repo, but these will be slower for us to investigate.
5250
-->
5351
[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA)
5452

5553
### 💻 Code
5654

57-
<!-- Please post the relevant code sample here as well-->
55+
<!-- Please post the relevant code sample here as well. This code and the Playground code should be the same, do not use separate examples -->
5856
```ts
5957
// We can quickly address your report if:
6058
// - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!

0 commit comments

Comments
 (0)