Skip to content

Commit 9e3adb4

Browse files
committed
Merge branch 'main' into instanceof-Symbol.hasInstance
2 parents 511c955 + 0464e91 commit 9e3adb4

File tree

1,759 files changed

+100251
-48086
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,759 files changed

+100251
-48086
lines changed

.c8rc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"include": ["src/**", "built/local/**"],
55
"exclude": ["**/node_modules/**"],
66
"mergeAsync": true
7-
}
7+
}

.devcontainer/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/javascript-node/.devcontainer/base.Dockerfile
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.245.2/containers/javascript-node/.devcontainer/base.Dockerfile
22

3-
# [Choice] Node.js version: 14, 12, 10
4-
ARG VARIANT="14-buster"
3+
# [Choice] Node.js version: 18, 16, 14
4+
ARG VARIANT="18-buster"
55
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
66

77
RUN sudo -u node npm install -g hereby

.devcontainer/devcontainer.json

+16-11
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
"build": {
44
"dockerfile": "Dockerfile",
55
"args": {
6-
"VARIANT": "14"
6+
"VARIANT": "18"
77
}
88
},
9-
"settings": {
10-
"terminal.integrated.defaultProfile.linux": "bash",
11-
"terminal.integrated.profiles.linux": {
12-
"bash": {
13-
"path": "/bin/bash",
14-
"icon": "terminal-bash",
9+
"customizations": {
10+
"vscode": {
11+
"settings": {
12+
"terminal.integrated.defaultProfile.linux": "bash",
13+
"terminal.integrated.profiles.linux": {
14+
"bash": {
15+
"path": "/bin/bash",
16+
"icon": "terminal-bash"
17+
}
18+
}
1519
},
16-
},
20+
"extensions": [
21+
"dbaeumer.vscode-eslint",
22+
"dprint.dprint"
23+
]
24+
}
1725
},
18-
"extensions": [
19-
"dbaeumer.vscode-eslint"
20-
],
2126
"remoteUser": "node"
2227
}

.dprint.jsonc

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"indentWidth": 4,
3+
"lineWidth": 1000,
4+
"newLineKind": "auto",
5+
"useTabs": false,
6+
"typescript": {
7+
"newLineKind": "crlf",
8+
"semiColons": "always",
9+
"quoteStyle": "preferDouble",
10+
"quoteProps": "consistent",
11+
"useBraces": "whenNotSingleLine",
12+
"bracePosition": "sameLineUnlessHanging",
13+
"singleBodyPosition": "sameLine",
14+
"nextControlFlowPosition": "nextLine", // Stroustrup style braces.
15+
"trailingCommas": "onlyMultiLine",
16+
"preferHanging": false,
17+
"operatorPosition": "maintain",
18+
19+
"arrowFunction.useParentheses": "preferNone",
20+
"conditionalExpression.linePerExpression": false, // Keep our "match/case"-ish conditionals.
21+
"functionExpression.spaceAfterFunctionKeyword": true,
22+
"importDeclaration.forceMultiLine": true,
23+
"constructorType.spaceAfterNewKeyword": true,
24+
"constructSignature.spaceAfterNewKeyword": true,
25+
26+
// Let eslint-plugin-simple-import-sort handle this.
27+
"module.sortImportDeclarations": "maintain",
28+
"module.sortExportDeclarations": "maintain",
29+
"exportDeclaration.sortNamedExports": "maintain",
30+
"importDeclaration.sortNamedImports": "maintain"
31+
},
32+
"prettier": {
33+
"associations": [
34+
"**/*.{yaml,yml}"
35+
],
36+
"yml.tabWidth": 2,
37+
"yaml.tabWidth": 2,
38+
"yml.singleQuote": true,
39+
"yaml.singleQuote": true
40+
},
41+
"excludes": [
42+
"**/node_modules",
43+
"**/*-lock.json",
44+
"coverage/**",
45+
"lib/**",
46+
"built/**",
47+
"tests/**",
48+
"internal/**",
49+
"**/*.generated.*",
50+
"scripts/*.d.*"
51+
],
52+
// Note: if adding new languages, make sure settings.template.json is updated too.
53+
"plugins": [
54+
"https://plugins.dprint.dev/typescript-0.87.1.wasm",
55+
"https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe",
56+
"https://plugins.dprint.dev/json-0.17.4.wasm"
57+
]
58+
}

.eslintplugin.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ const path = require("path");
33

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

88
module.exports = {
9-
rules: Object.fromEntries(ruleFiles.map((p) => {
9+
rules: Object.fromEntries(ruleFiles.map(p => {
1010
return [p.slice(0, -ext.length), require(path.join(rulesDir, p))];
1111
})),
12-
}
12+
};

.eslintrc.json

+73-76
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
"plugin:@typescript-eslint/stylistic"
1717
],
1818
"plugins": [
19-
"@typescript-eslint", "no-null", "eslint-plugin-local", "simple-import-sort"
19+
"@typescript-eslint",
20+
"no-null",
21+
"eslint-plugin-local",
22+
"simple-import-sort"
2023
],
2124
"ignorePatterns": [
2225
"**/node_modules/**",
@@ -30,10 +33,42 @@
3033
"/coverage/**"
3134
],
3235
"rules": {
33-
"max-statements-per-line": ["error", { "max": 1 }],
34-
"simple-import-sort/imports": "error",
35-
"simple-import-sort/exports": "error",
36+
// eslint
37+
"dot-notation": "error",
38+
"eqeqeq": "error",
39+
"no-caller": "error",
40+
"no-constant-condition": ["error", { "checkLoops": false }],
41+
"no-eval": "error",
42+
"no-extra-bind": "error",
43+
"no-new-func": "error",
44+
"no-new-wrappers": "error",
45+
"no-return-await": "error",
46+
"no-restricted-globals": [
47+
"error",
48+
{ "name": "setTimeout" },
49+
{ "name": "clearTimeout" },
50+
{ "name": "setInterval" },
51+
{ "name": "clearInterval" },
52+
{ "name": "setImmediate" },
53+
{ "name": "clearImmediate" }
54+
],
55+
"no-template-curly-in-string": "error",
56+
"no-throw-literal": "error",
57+
"no-undef-init": "error",
58+
"no-var": "error",
59+
"object-shorthand": "error",
60+
"prefer-const": "error",
61+
"prefer-object-spread": "error",
62+
"unicode-bom": ["error", "never"],
3663

64+
// Enabled in eslint:recommended, but not applicable here
65+
"no-extra-boolean-cast": "off",
66+
"no-case-declarations": "off",
67+
"no-cond-assign": "off",
68+
"no-control-regex": "off",
69+
"no-inner-declarations": "off",
70+
71+
// @typescript-eslint/eslint-plugin
3772
"@typescript-eslint/naming-convention": [
3873
"error",
3974
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -47,100 +82,61 @@
4782
{ "selector": "property", "format": null }
4883
],
4984

50-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
51-
"@typescript-eslint/no-extra-semi": "error",
52-
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
53-
"@typescript-eslint/semi": "error",
54-
"@typescript-eslint/space-before-function-paren": ["error", {
55-
"asyncArrow": "always",
56-
"anonymous": "always",
57-
"named": "never"
58-
}],
59-
60-
// Todo: For each of these, investigate whether we want to enable them ✨
61-
"@typescript-eslint/ban-types": "off",
62-
"no-case-declarations": "off",
63-
"no-cond-assign": "off",
64-
"no-constant-condition": "off",
65-
"no-control-regex": "off",
66-
"no-debugger": "off",
67-
"no-extra-boolean-cast": "off",
68-
"no-inner-declarations": "off",
69-
"no-useless-escape": "off",
70-
"prefer-rest-params": "off",
71-
"prefer-spread": "off",
72-
"@typescript-eslint/no-empty-function": "off",
73-
"@typescript-eslint/no-empty-interface": "off",
74-
"@typescript-eslint/no-explicit-any": "off",
75-
"@typescript-eslint/no-unused-vars": "off",
76-
77-
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
78-
"@typescript-eslint/prefer-optional-chain": "off",
79-
8085
// Rules enabled in typescript-eslint configs that are not applicable here
8186
"@typescript-eslint/ban-ts-comment": "off",
8287
"@typescript-eslint/class-literal-property-style": "off",
8388
"@typescript-eslint/consistent-indexed-object-style": "off",
8489
"@typescript-eslint/no-duplicate-enum-values": "off",
90+
"@typescript-eslint/no-empty-function": "off",
8591
"@typescript-eslint/no-namespace": "off",
8692
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
8793
"@typescript-eslint/no-var-requires": "off",
94+
"@typescript-eslint/no-empty-interface": "off",
95+
"@typescript-eslint/no-explicit-any": "off",
96+
"@typescript-eslint/ban-types": [
97+
"error",
98+
{
99+
"extendDefaults": true,
100+
"types": {
101+
// This is theoretically good, but ts-eslint appears to mistake our declaration of Symbol for the global Symbol type.
102+
// See: https://github.com/typescript-eslint/typescript-eslint/issues/7306
103+
"Symbol": false,
104+
"{}": false // {} is a totally useful and valid type.
105+
}
106+
}
107+
],
108+
109+
// Todo: For each of these, investigate whether we want to enable them ✨
110+
"@typescript-eslint/no-unused-vars": "off",
111+
112+
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
113+
"@typescript-eslint/prefer-optional-chain": "off",
88114

89115
// scripts/eslint/rules
90-
"local/object-literal-surrounding-space": "error",
91-
"local/no-type-assertion-whitespace": "error",
92-
"local/type-operator-spacing": "error",
93-
"local/only-arrow-functions": ["error", {
94-
"allowNamedFunctions": true ,
95-
"allowDeclarations": true
96-
}],
97-
"local/no-double-space": "error",
116+
"local/only-arrow-functions": [
117+
"error",
118+
{
119+
"allowNamedFunctions": true,
120+
"allowDeclarations": true
121+
}
122+
],
98123
"local/argument-trivia": "error",
99124
"local/no-in-operator": "error",
100-
"local/simple-indent": "error",
101125
"local/debug-assert": "error",
102126
"local/no-keywords": "error",
103127
"local/jsdoc-format": "error",
104128

105129
// eslint-plugin-no-null
106130
"no-null/no-null": "error",
107131

108-
// eslint
109-
"curly": ["error", "multi-line"],
110-
"dot-notation": "error",
111-
"eqeqeq": "error",
112-
"linebreak-style": ["error", "windows"],
113-
"new-parens": "error",
114-
"no-caller": "error",
115-
"no-eval": "error",
116-
"no-extra-bind": "error",
117-
"no-new-func": "error",
118-
"no-new-wrappers": "error",
119-
"no-return-await": "error",
120-
"no-restricted-globals": ["error",
121-
{ "name": "setTimeout" },
122-
{ "name": "clearTimeout" },
123-
{ "name": "setInterval" },
124-
{ "name": "clearInterval" },
125-
{ "name": "setImmediate" },
126-
{ "name": "clearImmediate" }
127-
],
128-
"no-template-curly-in-string": "error",
129-
"no-throw-literal": "error",
130-
"no-trailing-spaces": "error",
131-
"no-undef-init": "error",
132-
"no-var": "error",
133-
"object-shorthand": "error",
134-
"prefer-const": "error",
135-
"prefer-object-spread": "error",
136-
"quote-props": ["error", "consistent-as-needed"],
137-
"space-in-parens": "error",
138-
"unicode-bom": ["error", "never"]
132+
// eslint-plugin-simple-import-sort
133+
"simple-import-sort/imports": "error",
134+
"simple-import-sort/exports": "error"
139135
},
140136
"overrides": [
141137
// By default, the ESLint CLI only looks at .js files. But, it will also look at
142138
// any files which are referenced in an override config. Most users of typescript-eslint
143-
// get this behavior by default by extending a recommended typescript-eslint config, which
139+
// get this behavior by default by extending a recommended typescript-eslint config, which
144140
// just so happens to override some core ESLint rules. We don't extend from any config, so
145141
// explicitly reference TS files here so the CLI picks them up.
146142
//
@@ -153,7 +149,8 @@
153149
"files": ["*.mjs", "*.mts"],
154150
"rules": {
155151
// These globals don't exist outside of CJS files.
156-
"no-restricted-globals": ["error",
152+
"no-restricted-globals": [
153+
"error",
157154
{ "name": "__filename" },
158155
{ "name": "__dirname" },
159156
{ "name": "require" },

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ b6c053882696af8ddd94a600429f30584d303d7f
66
9a0b85ce2a3f85f498ab2c05474b4c0b96b111c9
77
# Generated module conversion step - unindent
88
94724a8c2e68a4c7e267072ca79971f317c45e4a
9+
# dprint
10+
5e8c261b6ab746213f19ee3501eb8c48a6215dd7

0 commit comments

Comments
 (0)