Skip to content

Commit

Permalink
Merge branch 'main' into babel-let-const
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Aug 29, 2023
2 parents 5628ee7 + c5f92d4 commit 52ab98d
Show file tree
Hide file tree
Showing 933 changed files with 42,675 additions and 38,258 deletions.
56 changes: 56 additions & 0 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"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
},
"excludes": [
"**/node_modules",
"**/*-lock.json",
"coverage/**",
"lib/**",
"built/**",
"tests/**",
"internal/**",
"**/*.generated.*",
"scripts/*.d.*"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.86.1.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))];
})),
}
};
28 changes: 1 addition & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,33 +128,7 @@

// 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"],
"linebreak-style": ["error", "windows"],
"max-statements-per-line": ["error", { "max": 1 }],
"new-parens": "error",
"no-trailing-spaces": "error",
"quote-props": ["error", "consistent-as-needed"],
"space-in-parens": "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"
"simple-import-sort/exports": "error"
},
"overrides": [
// By default, the ESLint CLI only looks at .js files. But, it will also look at
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
18 changes: 11 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: "Bug report"
description: "Create a report to help us improve TypeScript"
name: 'Bug report'
description: 'Create a report to help us improve TypeScript'
body:
- type: markdown
attributes:
value: Please fill in each section completely. Thank you!
- type: textarea
id: search_terms
attributes:
label: "🔎 Search Terms"
label: '🔎 Search Terms'
description: |
What search terms did you use when trying to find an existing bug report?
Expand All @@ -22,7 +22,7 @@ body:
- type: textarea
id: version_info
attributes:
label: "🕗 Version & Regression Information"
label: '🕗 Version & Regression Information'
description: |
When did you start seeing this bug occur?
Expand All @@ -33,7 +33,7 @@ body:
If possible, please try testing the nightly version of TS to see if it's already been fixed. For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
Note: The TypeScript Playground can be used to try older versions of TypeScript.
Expand All @@ -56,7 +56,7 @@ body:
As a last resort, you can link to a repo, but these will be slower for us to investigate.
placeholder: "Playground link with relevant code: https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA"
placeholder: 'Playground link with relevant code: https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA'
validations:
required: false
- type: textarea
Expand Down Expand Up @@ -87,7 +87,7 @@ body:
id: actual_behavior
attributes:
label: 🙁 Actual behavior
description: "What happened, and why it was wrong."
description: 'What happened, and why it was wrong.'
validations:
required: true
- type: textarea
Expand All @@ -97,3 +97,7 @@ body:
description: What you expected to happen instead, and why
validations:
required: true
- type: textarea
id: additional_info
attributes:
label: Additional information about the issue
26 changes: 11 additions & 15 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
---
---
blank_issues_enabled: false
contact_links:
-
about: "Please ask and answer usage questions on Stack Overflow."
contact_links:
- about: 'Please ask and answer usage questions on Stack Overflow.'
name: Question
url: "https://stackoverflow.com/questions/tagged/typescript"
-
about: "Alternatively, you can use the TypeScript Community Discord."
url: 'https://stackoverflow.com/questions/tagged/typescript'
- about: 'Alternatively, you can use the TypeScript Community Discord.'
name: Chat
url: "https://discord.gg/typescript"
-
about: "Please check the FAQ before filing new issues"
name: "TypeScript FAQ"
url: "https://github.com/microsoft/TypeScript/wiki/FAQ"
-
about: "Please raise issues about the site on its own repo."
url: 'https://discord.gg/typescript'
- about: 'Please check the FAQ before filing new issues'
name: 'TypeScript FAQ'
url: 'https://github.com/microsoft/TypeScript/wiki/FAQ'
- about: 'Please raise issues about the site on its own repo.'
name: Website
url: "https://github.com/microsoft/TypeScript-Website/issues/new"
url: 'https://github.com/microsoft/TypeScript-Website/issues/new'
46 changes: 23 additions & 23 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: "Feature request"
description: "Suggest an idea"
name: 'Feature request'
description: 'Suggest an idea'
body:
- type: markdown
attributes:
value: "Please fill in each section completely. Thank you!"
value: 'Please fill in each section completely. Thank you!'
- type: textarea
id: search_terms
attributes:
label: "🔍 Search Terms"
label: '🔍 Search Terms'
description: |
💡 Did you know? TypeScript has over 2,000 open suggestions!
💡 Did you know? TypeScript has over 2,000 open suggestions!
🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests
The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests
placeholder: |
List of keywords you searched for before creating this issue.
Write them down here so that others can find this suggestion more easily and help provide feedback.
Expand All @@ -24,44 +24,44 @@ body:
- type: checkboxes
id: viability_checklist
attributes:
label: "✅ Viability Checklist"
label: '✅ Viability Checklist'
description: |
Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
We always recommend reviewing the TypeScript design goals before investing time writing
a proposal for ideas outside the scope of the project.
My suggestion meets the following guidelines.
options:
- label: This wouldn't be a breaking change in existing TypeScript/JavaScript code
required: true
- label: This wouldn't change the runtime behavior of existing JavaScript code
required: true
- label: This could be implemented without emitting different JS based on the types of the expressions
required: true
- label: This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
required: true
- label: "This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals"
required: true
- label: This wouldn't be a breaking change in existing TypeScript/JavaScript code
required: true
- label: This wouldn't change the runtime behavior of existing JavaScript code
required: true
- label: This could be implemented without emitting different JS based on the types of the expressions
required: true
- label: This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
required: true
- label: 'This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals'
required: true
- type: textarea
id: suggestion_summary
attributes:
label: "⭐ Suggestion"
label: '⭐ Suggestion'
description: "A summary of what you'd like to see added or changed"
validations:
required: true
- type: textarea
id: motivating_example
attributes:
label: "📃 Motivating Example"
label: '📃 Motivating Example'
description: |
If you were announcing this feature in a blog post, what's a short
explanation that shows a developer why this feature improves the language?
If you were announcing this feature in a blog post, what's a short
explanation that shows a developer why this feature improves the language?
validations:
required: true
- type: textarea
id: use_cases
attributes:
label: "💻 Use Cases"
label: '💻 Use Cases'
value: |
1. What do you want to use this for?
2. What shortcomings exist with current approaches?
Expand Down
26 changes: 13 additions & 13 deletions .github/ISSUE_TEMPLATE/lib_change.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Library change"
description: "Fix or improve issues with built-in type definitions like `lib.dom.d.ts`, `lib.es6.d.ts`, etc."
name: 'Library change'
description: 'Fix or improve issues with built-in type definitions like `lib.dom.d.ts`, `lib.es6.d.ts`, etc.'
body:
- type: markdown
attributes:
Expand All @@ -18,45 +18,45 @@ body:
- type: markdown
attributes:
value: |
If you're missing common new methods like `Array.includes`, you may have a misconfigured project.
Try setting `lib: "es2020"` and checking whether the type you want is present.
You can diagnose further by running `tsc` with `--listFilesOnly` or `--showConfig`.
If you're missing common new methods like `Array.includes`, you may have a misconfigured project.
Try setting `lib: "es2020"` and checking whether the type you want is present.
You can diagnose further by running `tsc` with `--listFilesOnly` or `--showConfig`.
Conversely, if you are seeing built-in methods you expect to *not* see, check your 'lib' setting or review your dependencies for lib/reference directives that might be polluting
your global scope. This is common when using the 'node' type library. See https://github.com/microsoft/TypeScript/issues/40184
Conversely, if you are seeing built-in methods you expect to *not* see, check your 'lib' setting or review your dependencies for lib/reference directives that might be polluting
your global scope. This is common when using the 'node' type library. See https://github.com/microsoft/TypeScript/issues/40184
- type: input
id: compilation_target
attributes:
label: "⚙ Compilation target"
label: '⚙ Compilation target'
description: "What's your compilation target (e.g.: `ES2015`)?"
validations:
required: true
- type: input
id: current_lib
attributes:
label: "⚙ Library"
label: '⚙ Library'
description: "What's the current library you're using?"
validations:
required: true
- type: textarea
id: incorrect_definition
attributes:
label: "Missing / Incorrect Definition"
description: "What property, method, function, etc. is missing or incorrect?"
label: 'Missing / Incorrect Definition'
description: 'What property, method, function, etc. is missing or incorrect?'
validations:
required: true
- type: textarea
id: sample_code
attributes:
label: "Sample Code"
label: 'Sample Code'
description: "What's some code using this that should work, but doesn't?"
render: TypeScript
validations:
required: true
- type: textarea
id: documentation_link
attributes:
label: "Documentation Link"
label: 'Documentation Link'
description: |
Link to relevant documentation (e.g. MDN, W3C, ECMAScript Spec) to consult for this property.
Note that lib.dom.d.ts intentionally does not include browser-specific extensions or early experimental features.
Loading

0 comments on commit 52ab98d

Please sign in to comment.