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
Jump to file
Failed to load files.
Loading
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/**",
"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.
// Also, if updating typescript, update the one in package.json.
"plugins": [
"npm:@dprint/typescript@0.96.1",
"npm:@dprint/json@0.22.0",
"npm:dprint-plugin-yaml@0.6.0",
"npm:@jakebailey/dprint-plugin-gofumpt@0.0.13"
]
}
{
// 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.
// Also, if updating typescript, update the one in package.json.
"plugins": [
"npm:@dprint/typescript@0.96.1",
"npm:@dprint/json@0.22.0",
"npm:dprint-plugin-yaml@0.6.0",
"npm:@jakebailey/dprint-plugin-gofumpt@0.0.13"
]
}
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 #
Loading