Skip to content

Commit

Permalink
Merge branch 'main' into noinfer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Dec 7, 2023
2 parents b5f0ee1 + 3d11251 commit 989fa50
Show file tree
Hide file tree
Showing 6,682 changed files with 621,669 additions and 187,157 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"include": ["src/**", "built/local/**"],
"exclude": ["**/node_modules/**"],
"mergeAsync": true
}
}
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/javascript-node/.devcontainer/base.Dockerfile
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.245.2/containers/javascript-node/.devcontainer/base.Dockerfile

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

RUN sudo -u node npm install -g hereby
27 changes: 16 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "14"
"VARIANT": "18"
}
},
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash",
"icon": "terminal-bash",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash",
"icon": "terminal-bash"
}
}
},
},
"extensions": [
"dbaeumer.vscode-eslint",
"dprint.dprint"
]
}
},
"extensions": [
"dbaeumer.vscode-eslint"
],
"remoteUser": "node"
}
62 changes: 62 additions & 0 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"indentWidth": 4,
"lineWidth": 1000,
"newLineKind": "auto",
"useTabs": false,
"typescript": {
"newLineKind": "crlf",
"semiColons": "always",
"quoteStyle": "preferDouble",
"quoteProps": "consistent",
"useBraces": "whenNotSingleLine",
"bracePosition": "sameLineUnlessHanging",
"singleBodyPosition": "sameLine",
"nextControlFlowPosition": "nextLine", // Stroustrup style braces.
"trailingCommas": "onlyMultiLine",
"preferHanging": false,
"operatorPosition": "maintain",

"arrowFunction.useParentheses": "preferNone",
"conditionalExpression.linePerExpression": false, // Keep our "match/case"-ish conditionals.
"functionExpression.spaceAfterFunctionKeyword": true,
"importDeclaration.forceMultiLine": true,
"constructorType.spaceAfterNewKeyword": true,
"constructSignature.spaceAfterNewKeyword": true,

// Let eslint-plugin-simple-import-sort handle this.
"module.sortImportDeclarations": "maintain",
"module.sortExportDeclarations": "maintain",
"exportDeclaration.sortNamedExports": "maintain",
"importDeclaration.sortNamedImports": "maintain"
},
"prettier": {
"associations": [
"**/*.{yaml,yml}"
],
"yml.tabWidth": 2,
"yaml.tabWidth": 2,
"yml.singleQuote": true,
"yaml.singleQuote": true
},
"json": {
// This would be good to do in known-JSONC files, but VS Code warns on trailing commas.
"trailingCommas": "never"
},
"excludes": [
"**/node_modules",
"**/*-lock.json",
"coverage/**",
"lib/**",
"built/**",
"tests/**",
"internal/**",
"**/*.generated.*",
"scripts/*.d.*"
],
// Note: if adding new languages, make sure settings.template.json is updated too.
"plugins": [
"https://plugins.dprint.dev/typescript-0.88.3.wasm",
"https://plugins.dprint.dev/json-0.19.0.wasm",
"https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe"
]
}
6 changes: 3 additions & 3 deletions .eslintplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const path = require("path");

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

module.exports = {
rules: Object.fromEntries(ruleFiles.map((p) => {
rules: Object.fromEntries(ruleFiles.map(p => {
return [p.slice(0, -ext.length), require(path.join(rulesDir, p))];
})),
}
};
185 changes: 83 additions & 102 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic"
],
"plugins": [
"@typescript-eslint", "no-null", "import", "eslint-plugin-local", "simple-import-sort"
"@typescript-eslint",
"no-null",
"eslint-plugin-local",
"simple-import-sort"
],
"ignorePatterns": [
"**/node_modules/**",
Expand All @@ -25,16 +33,42 @@
"/coverage/**"
],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",

"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/no-array-constructor": "error",
// eslint
"dot-notation": "error",
"eqeqeq": "error",
"no-caller": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-eval": "error",
"no-extra-bind": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-return-await": "error",
"no-restricted-globals": [
"error",
{ "name": "setTimeout" },
{ "name": "clearTimeout" },
{ "name": "setInterval" },
{ "name": "clearInterval" },
{ "name": "setImmediate" },
{ "name": "clearImmediate" }
],
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-undef-init": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-object-spread": "error",
"unicode-bom": ["error", "never"],

"brace-style": "off",
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
// Enabled in eslint:recommended, but not applicable here
"no-extra-boolean-cast": "off",
"no-case-declarations": "off",
"no-cond-assign": "off",
"no-control-regex": "off",
"no-inner-declarations": "off",

// @typescript-eslint/eslint-plugin
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
Expand All @@ -48,115 +82,61 @@
{ "selector": "property", "format": null }
],

"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],

"max-statements-per-line": ["error", { "max": 1 }],

"no-duplicate-imports": "off",
"@typescript-eslint/no-duplicate-imports": "error",

"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-this-alias": "error",

"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],

"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-as-const": "error",

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

"semi": "off",
"@typescript-eslint/semi": "error",
"@typescript-eslint/no-extra-semi": "error",

"space-before-function-paren": "off",
"@typescript-eslint/space-before-function-paren": ["error", {
"asyncArrow": "always",
"anonymous": "always",
"named": "never"
}],
// Rules enabled in typescript-eslint configs that are not applicable here
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/class-literal-property-style": "off",
"@typescript-eslint/consistent-indexed-object-style": "off",
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
// This is theoretically good, but ts-eslint appears to mistake our declaration of Symbol for the global Symbol type.
// See: https://github.com/typescript-eslint/typescript-eslint/issues/7306
"Symbol": false,
"{}": false // {} is a totally useful and valid type.
}
}
],

"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
// Todo: For each of these, investigate whether we want to enable them ✨
"@typescript-eslint/no-unused-vars": "off",

"@typescript-eslint/no-extra-non-null-assertion": "error",
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
"@typescript-eslint/prefer-optional-chain": "off",

// scripts/eslint/rules
"local/object-literal-surrounding-space": "error",
"local/no-type-assertion-whitespace": "error",
"local/type-operator-spacing": "error",
"local/only-arrow-functions": ["error", {
"allowNamedFunctions": true ,
"allowDeclarations": true
}],
"local/no-double-space": "error",
"local/only-arrow-functions": [
"error",
{
"allowNamedFunctions": true,
"allowDeclarations": true
}
],
"local/argument-trivia": "error",
"local/no-in-operator": "error",
"local/simple-indent": "error",
"local/debug-assert": "error",
"local/no-keywords": "error",
"local/jsdoc-format": "error",

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

// eslint-plugin-no-null
"no-null/no-null": "error",

// eslint
"constructor-super": "error",
"curly": ["error", "multi-line"],
"dot-notation": "error",
"eqeqeq": "error",
"linebreak-style": ["error", "windows"],
"new-parens": "error",
"no-caller": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-fallthrough": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-return-await": "error",
"no-restricted-globals": ["error",
{ "name": "setTimeout" },
{ "name": "clearTimeout" },
{ "name": "setInterval" },
{ "name": "clearInterval" },
{ "name": "setImmediate" },
{ "name": "clearImmediate" }
],
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-object-spread": "error",
"quote-props": ["error", "consistent-as-needed"],
"space-in-parens": "error",
"unicode-bom": ["error", "never"],
"use-isnan": "error",
"no-prototype-builtins": "error",
"no-self-assign": "error",
"no-dupe-else-if": "error"
// eslint-plugin-simple-import-sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
},
"overrides": [
// By default, the ESLint CLI only looks at .js files. But, it will also look at
// any files which are referenced in an override config. Most users of typescript-eslint
// get this behavior by default by extending a recommended typescript-eslint config, which
// get this behavior by default by extending a recommended typescript-eslint config, which
// just so happens to override some core ESLint rules. We don't extend from any config, so
// explicitly reference TS files here so the CLI picks them up.
//
Expand All @@ -169,7 +149,8 @@
"files": ["*.mjs", "*.mts"],
"rules": {
// These globals don't exist outside of CJS files.
"no-restricted-globals": ["error",
"no-restricted-globals": [
"error",
{ "name": "__filename" },
{ "name": "__dirname" },
{ "name": "require" },
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ b6c053882696af8ddd94a600429f30584d303d7f
9a0b85ce2a3f85f498ab2c05474b4c0b96b111c9
# Generated module conversion step - unindent
94724a8c2e68a4c7e267072ca79971f317c45e4a
# dprint
5e8c261b6ab746213f19ee3501eb8c48a6215dd7
Loading

0 comments on commit 989fa50

Please sign in to comment.