Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/intersections-as-…
Browse files Browse the repository at this point in the history
…valid-types-for-template-literal-placeholders

# Conflicts:
#	tests/baselines/reference/templateLiteralTypesPatterns.errors.txt
  • Loading branch information
Andarist committed Jul 28, 2023
2 parents 2877ff5 + 21bb216 commit 3458d37
Show file tree
Hide file tree
Showing 41,975 changed files with 235,014 additions and 106,602 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"reporter": ["lcovonly", "cobertura"],
"src": "src",
"include": ["src/**", "built/local/**"],
"exclude": ["**/node_modules/**"],
"mergeAsync": true
}
194 changes: 100 additions & 94 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
"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 +30,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,110 +79,85 @@
{ "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 ✨
"no-useless-escape": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"@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",
// eslint-plugin-simple-import-sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",

// Formatting rules; remove once a formatter enforces these.
"curly": ["error", "multi-line"],
"dot-notation": "error",
"eqeqeq": "error",
"linebreak-style": ["error", "windows"],
"max-statements-per-line": ["error", { "max": 1 }],
"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"
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"@typescript-eslint/no-extra-semi": "error",
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
"@typescript-eslint/semi": "error",
"@typescript-eslint/space-before-function-paren": [
"error",
{
"asyncArrow": "always",
"anonymous": "always",
"named": "never"
}
],
"local/object-literal-surrounding-space": "error",
"local/no-type-assertion-whitespace": "error",
"local/type-operator-spacing": "error",
"local/no-double-space": "error",
"local/simple-indent": "error"
},
"overrides": [
// By default, the ESLint CLI only looks at .js files. But, it will also look at
Expand Down
8 changes: 3 additions & 5 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,16 @@ Please keep and fill in the line that best applies:
### ⏯ Playground Link

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

### 💻 Code

<!-- Please post the relevant code sample here as well-->
<!-- Please post the relevant code sample here as well. This code and the Playground code should be the same, do not use separate examples -->
```ts
// We can quickly address your report if:
// - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
Expand Down
102 changes: 102 additions & 0 deletions .github/ISSUE_TEMPLATE/module_resolution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Module Resolution
description: Report a problem with module resolution
title: "Module Resolution:"
labels: []
body:
- type: markdown
attributes:
value: |
Module resolution can be very difficult to configure correctly!
Be sure you've read the docs and asked for help in other places before filling out this form.
Most module resolution bug reports are actually misconfigurations, so we require a thorough pre-investigation before we can look into any potential issues.
Let's make sure you're ready to file a module resolution bug.
- type: markdown
attributes:
value: |
A module resolution bug requires five things:
1. A module that's trying to import some target module
2. That target module
3. The configuration of the importing module
4. The configuration of the target module
5. A difference in runtime behavior
You will also be required to post a cloneable repository.
This repo must involve running `tsc`, not a third-party tool (e.g. vue-tsc, ngc, expo, ...)
- type: input
id: repo-url
attributes:
label: Demo Repo
description: Post a cloneable repo that reproduces the issue. We will run `npm`, `yarn`, or `pnpm` here, but will not invoke more complex build scripts or other build tools.
placeholder: https://github.com/ghost/myrepro
validations:
required: true

- type: dropdown
id: defect-kind
attributes:
label: Which of the following problems are you reporting?
options:
- The module specifier resolves at runtime, but not at build time
- The module specifier resolves at build time, but shouldn't because it doesn't at runtime
- The module specifier resolves, but to the wrong file
- The module specifier resolves to the right file, but something about the types are wrong
- Something else more complicated which I'll explain in more detail
validations:
required: true

- type: textarea
id: code-proof
attributes:
label: Demonstrate the defect described above with a code sample.
description: This should be at most four lines of code, and come from your demo repo.
placeholder: import * as foo from "./bar"; // Should not resolve
validations:
required: true

- type: textarea
id: config
attributes:
label: Run `tsc --showConfig` and paste its output here
description: Repros that depend on running within external tools (yarn, pnpm, esbuild, etc.) are not TypeScript defects and will not be investigated.
placeholder: "> tsc --showConfig"
validations:
required: true

- type: textarea
id: traceResolution
attributes:
label: Run `tsc --traceResolution` and paste its output here
description: Run `tsc --traceResolution` and paste the output here.
placeholder: "> tsc --traceResolution"
validations:
required: true

- type: textarea
id: import-package-json
attributes:
label: Paste the `package.json` of the *importing* module, if it exists
placeholder: "my_project/package.json"
validations:
required: true

- type: textarea
id: export-package-json
attributes:
label: Paste the `package.json` of the *target* module, if it exists
placeholder: "node_modules/somepkg/package.json"
validations:
required: true

- type: textarea
id: comments
attributes:
label: Any other comments can go here
placeholder: "Have a nice day!"
validations:
required: true
Loading

0 comments on commit 3458d37

Please sign in to comment.