Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
146 changes: 75 additions & 71 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -1,71 +1,75 @@
{
// If updating this, also update the config in dtsBundler.mjs.
"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": "whenMultiple",
"constructorType.spaceAfterNewKeyword": true,
"constructSignature.spaceAfterNewKeyword": true,

"module.sortImportDeclarations": "caseInsensitive",
"module.sortExportDeclarations": "caseInsensitive",
"exportDeclaration.sortNamedExports": "caseInsensitive",
"importDeclaration.sortNamedImports": "caseInsensitive"
},
"yaml": {
"indentWidth": 2,
"quotes": "preferSingle"
},
"json": {
// This would be good to do in known-JSONC files, but VS Code warns on trailing commas.
"trailingCommas": "never"
},
"gofumpt": {
"langVersion": "go1.26",
"modulePath": "github.com/microsoft/TypeScript/tsc"
},
"excludes": [
"**/.git",
"**/node_modules",
"**/*-lock.json",
"**/testdata",
"packages/vscode-typescript/l10n/**",
"tsc/internal/bundled/libs/**",
"tools/scripts/lsp/*.json",
"tools/scripts/lsp/metaModelSchema.mts",
// Needs to be LF to have a working shebang.
"packages/typescript/bin/tsc",
"tsc/internal/bundled/source/**",
"tsc/internal/diagnostics/diagnosticMessages.generated.json",
"tsc/internal/diagnostics/loc/*.generated.json",
"packages/typescript/dist/**",
"packages/typescript/tsconfig.tsbuildinfo",
"packages/vscode-typescript/dist/**",
"packages/vscode-typescript-nightly/dist/**",
"packages/typescript/vendor/**"
],
// Note: if adding new languages, make sure settings.template.json is updated too.
"plugins": [
"npm:@dprint/typescript",
"npm:@dprint/json",
"npm:dprint-plugin-yaml",
"npm:@jakebailey/dprint-plugin-gofumpt"
]
}
{
// If updating this, also update the config in dtsBundler.mjs.
"indentWidth": 4,
"lineWidth": 1000,
"newLineKind": "lf",
"useTabs": false,
"typescript": {
"newLineKind": "lf",
"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": "whenMultiple",
"constructorType.spaceAfterNewKeyword": true,
"constructSignature.spaceAfterNewKeyword": true,

"module.sortImportDeclarations": "caseInsensitive",
"module.sortExportDeclarations": "caseInsensitive",
"exportDeclaration.sortNamedExports": "caseInsensitive",
"importDeclaration.sortNamedImports": "caseInsensitive"
},
"yaml": {
"indentWidth": 2,
"quotes": "preferSingle"
},
"json": {
// This would be good to do in known-JSONC files, but VS Code warns on trailing commas.
"trailingCommas": "never"
},
"gofumpt": {
"langVersion": "go1.26",
"modulePath": "github.com/microsoft/TypeScript/tsc"
},
"excludes": [
"**/.git",
"**/node_modules",
"**/*-lock.json",
"**/testdata",
"packages/vscode-typescript/l10n/**",
"tsc/internal/bundled/libs/lib.dom.d.ts",
"tsc/internal/bundled/libs/lib.dom.asynciterable.d.ts",
"tsc/internal/bundled/libs/lib.dom.iterable.d.ts",
"tsc/internal/bundled/libs/lib.webworker.d.ts",
"tsc/internal/bundled/libs/lib.webworker.asynciterable.d.ts",
"tsc/internal/bundled/libs/lib.webworker.iterable.d.ts",
"tools/scripts/lsp/*.json",
"tools/scripts/lsp/metaModelSchema.mts",
// Needs to be LF to have a working shebang.
"packages/typescript/bin/tsc",
"tsc/internal/diagnostics/diagnosticMessages.generated.json",
"tsc/internal/diagnostics/loc/*.generated.json",
"packages/typescript/dist/**",
"packages/typescript/tsconfig.tsbuildinfo",
"packages/vscode-typescript/dist/**",
"packages/vscode-typescript-nightly/dist/**",
"packages/typescript/vendor/**"
],
// Note: if adding new languages, make sure settings.template.json is updated too.
"plugins": [
"npm:@dprint/typescript",
"npm:@dprint/json",
"npm:dprint-plugin-yaml",
"npm:@jakebailey/dprint-plugin-gofumpt"
]
}
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[tsc/testdata/**]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

[tools/loc/**/*.lcl]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
9 changes: 7 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
*.js linguist-language=TypeScript
**/*.json linguist-language=jsonc
* -text
*.go text eol=lf

* text=auto eol=lf

# Preserve line-ending-sensitive fixtures exactly.
tsc/testdata/** -text

tools/loc/**/*.lcl -text
38 changes: 19 additions & 19 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
Thank you for submitting a pull request!
Please verify that:
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
* [ ] Code is up-to-date with the `main` branch
* [ ] You've successfully run `npx hereby test`
* [ ] You've successfully run `npx hereby lint`
* [ ] You've successfully run `npx hereby check:format`
* [ ] There are new or updated tests validating the change
Refer to CONTRIBUTING.md for more details:
https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md
Please don't send a PR solely to fix a typo unless it materially improves
understanding. Each PR represents review and maintenance work.
-->
Fixes #
<!--
Thank you for submitting a pull request!

Please verify that:
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
* [ ] Code is up-to-date with the `main` branch
* [ ] You've successfully run `npx hereby test`
* [ ] You've successfully run `npx hereby lint`
* [ ] You've successfully run `npx hereby check:format`
* [ ] There are new or updated tests validating the change

Refer to CONTRIBUTING.md for more details:
https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md

Please don't send a PR solely to fix a typo unless it materially improves
understanding. Each PR represents review and maintenance work.
-->

Fixes #
56 changes: 28 additions & 28 deletions .github/skills/mcfly/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
---
name: mcfly
description: Only invoke when explicitly instructed to
---
You need to "re-stack" your commits to match the following format:
* Testcase(s), including at least one that demonstrate the problem - this could be a test that directly fails, baselines that show the problem, or even both
* A commit, or series of commits, that fixes the failing test case
* If needed, a follow-up commit with modified baselines
Since you can't force-push, start with a commit that undoes all your prior changes and gets you back to `main`.
Then add your test case(s) in a single commit.
When you add testcases that create or modify baselines, commit the (pre-fix) baselines at the same time as the testcases themselves.
A test case isn't necessarily a new file; it could be a modification to an existing test or a change in the test configuration.
Ensure that at least one test in the full run fails - you might be operating on a bad PR that didn't actually introduce a failing scenario!
If zero tests failed, abort and post a message explaining what you observed.
Remember that baseline tests do not "fail" in the traditional sense; they are used to verify that the output matches the expected baseline.
Ensure that your test demonstrates the problem that the PR is intended to fix.
Then, add your fix.
You can break this apart into multiple commits if it's more logical to review that way; use your judgment.
Ensure that this makes the test pass.
Again, be mindful of how baselines work - a failed baseline test just means a diff; review that diff for correctness vis a vis the goal of the PR.
Do not accept baseline diffs yet!
Finally, if there are baseline diffs, commit those in a separate commit.
---
name: mcfly
description: Only invoke when explicitly instructed to
---

You need to "re-stack" your commits to match the following format:
* Testcase(s), including at least one that demonstrate the problem - this could be a test that directly fails, baselines that show the problem, or even both
* A commit, or series of commits, that fixes the failing test case
* If needed, a follow-up commit with modified baselines

Since you can't force-push, start with a commit that undoes all your prior changes and gets you back to `main`.

Then add your test case(s) in a single commit.
When you add testcases that create or modify baselines, commit the (pre-fix) baselines at the same time as the testcases themselves.
A test case isn't necessarily a new file; it could be a modification to an existing test or a change in the test configuration.
Ensure that at least one test in the full run fails - you might be operating on a bad PR that didn't actually introduce a failing scenario!
If zero tests failed, abort and post a message explaining what you observed.
Remember that baseline tests do not "fail" in the traditional sense; they are used to verify that the output matches the expected baseline.
Ensure that your test demonstrates the problem that the PR is intended to fix.

Then, add your fix.
You can break this apart into multiple commits if it's more logical to review that way; use your judgment.
Ensure that this makes the test pass.
Again, be mindful of how baselines work - a failed baseline test just means a diff; review that diff for correctness vis a vis the goal of the PR.
Do not accept baseline diffs yet!

Finally, if there are baseline diffs, commit those in a separate commit.

Ensure that the final diff you have matches the original diff you started with, as this process should not introduce any unintended changes.
Loading
Loading