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
  •  
  •  
  •  
144 changes: 74 additions & 70 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -1,70 +1,74 @@
{
// 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/**",
"tsc/internal/lsp/lsproto/_generate/*.json",
"tsc/internal/lsp/lsproto/_generate/metaModelSchema.mts",
// Needs to be LF to have a working shebang.
"packages/typescript/bin/tsc",
"tsc/internal/bundled/source/**",
"tsc/internal/locale/lcl/**",
"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",
"tsc/internal/lsp/lsproto/_generate/*.json",
"tsc/internal/lsp/lsproto/_generate/metaModelSchema.mts",
// Needs to be LF to have a working shebang.
"packages/typescript/bin/tsc",
"tsc/internal/locale/lcl/**",
"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

[tsc/internal/locale/lcl/**]
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
10 changes: 8 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
*.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

# TODO: Remove this exception when this directory is converted or removed.
tsc/internal/locale/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 #
54 changes: 27 additions & 27 deletions .github/skills/restack/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
---
name: restack
description: Only invoke when explicitly instructed to
---
You need to "re-stack" your commits to match the following format:
* A failing test case
* A commit, or series of commits, that fixes the failing test case
* (Optional) a follow-up commit that checks in any 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.
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.
You should examine the PR description to determine what the desired passing baseline should look like.
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: restack
description: Only invoke when explicitly instructed to
---

You need to "re-stack" your commits to match the following format:
* A failing test case
* A commit, or series of commits, that fixes the failing test case
* (Optional) a follow-up commit that checks in any 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.
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.
You should examine the PR description to determine what the desired passing baseline should look like.

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; this process should not introduce any unintended changes.
Loading
Loading