Skip to content

Prevents auto-import in module: "none" #55328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
a661017
Prevents auto-import in non-module files
hardikkoul Aug 10, 2023
28cd1fb
Allow intersections to be used as valid types for template literal pl…
Andarist Aug 10, 2023
6b1f9bf
changing "compilerOptionsIndicateEs6Modules"
hardikkoul Aug 11, 2023
b35fa04
Fix broken formatting rules around namespaced JSX attributes (#55294)
lyonbot Aug 11, 2023
3b43d84
Enable eslint rules prefer-rest-params and prefer-spread (#55181)
jakebailey Aug 11, 2023
634d3a1
Update package-lock.json
typescript-bot Aug 12, 2023
dcd970e
Adding Unit Test
hardikkoul Aug 13, 2023
fd390e7
Update package-lock.json
typescript-bot Aug 14, 2023
3c6c557
Move tsserverlibrary.js to typescript.js, make tsserverlibrary.js a s…
jakebailey Aug 14, 2023
3855369
Fixed `hasInvalidEscape` implementation (#55373)
Andarist Aug 14, 2023
16dab6d
Preserve input key style of computed properties in declaration emit (…
Andarist Aug 14, 2023
f5e73d7
Add additional information section to the bug report template (#55360)
Andarist Aug 14, 2023
05cb53e
Organize/consolidate inlay hint tests (#55332)
MariaSolOs Aug 14, 2023
5725506
Fix unused baseline failure on main (#55379)
jakebailey Aug 14, 2023
9261ca7
Share redirects cache key calculation between multiple caches used fo…
sheetalkamat Aug 15, 2023
c5281bf
Update package-lock.json
typescript-bot Aug 15, 2023
3607ace
updating the Unit Test Case
hardikkoul Aug 15, 2023
f37d2ad
Prevent detached diagnostics from running off the end of the file (#5…
jakebailey Aug 15, 2023
defb504
Remove allowComplexConstraintInference in inferTypes (#54815)
jakebailey Aug 15, 2023
8863e2f
Discriminate contextual types using shorthand properties (#55151)
Andarist Aug 15, 2023
0099e42
fix(55374): Invalid Parameter Inlay Hint (#55384)
a-tarasyuk Aug 15, 2023
b8b0d26
Display write type for property accesses in write locations (#54777)
Andarist Aug 15, 2023
cac899d
Widen widening literal types through compound-like assignments (#52493)
Andarist Aug 15, 2023
08b2566
Add extra tests for type and value symbol merging (#55387)
Andarist Aug 16, 2023
ffec968
Don't track private symbol roots in other files during js declaration…
weswigham Aug 16, 2023
5e8c261
dprint the codebase (#54820)
jakebailey Aug 16, 2023
fa9cf2a
Add dprint commit to git-blame-ignore-revs (#55402)
jakebailey Aug 16, 2023
3b49ce9
Fixed contravariant inferences from annotated optional parameters (#5…
Andarist Aug 16, 2023
9ec52c0
Enforce CRLF in TS/JS files (#55403)
jakebailey Aug 16, 2023
1488256
Reference ATTW in module_resolution.yml (#55401)
RyanCavanaugh Aug 16, 2023
b555727
Make sure emitted d.ts files are LF, not CRLF (#55407)
jakebailey Aug 16, 2023
3790c92
Fix typo isInvalid -> isValid (#55414)
NilsIrl Aug 17, 2023
3afb1e5
Consistently use ECMAScript and CommonJS wording (#55416)
bennycode Aug 17, 2023
fe10fc7
Improve CI baseline check (#55418)
jakebailey Aug 17, 2023
a0e0104
error on duplicate symbols in object literals (#55193)
Zzzen Aug 17, 2023
3af710e
Update package-lock.json
typescript-bot Aug 19, 2023
e99508b
Make contextually-typed parameter with question token optional (#54960)
Andarist Aug 21, 2023
5439c81
Update package-lock.json
typescript-bot Aug 22, 2023
97d8c83
Fixed serialization of param names in setters from JS files (#55393)
Andarist Aug 22, 2023
507fd31
Remove lib.d.ts line info in inlay hint baselines (#55426)
MariaSolOs Aug 22, 2023
d0684f7
Update package-lock.json
typescript-bot Aug 23, 2023
6d07d5f
Improve inference between types with multiple signatures (#54448)
ahejlsberg Aug 23, 2023
fcaa900
Fix check in getDiscriminantPropertyAccess (#55464)
ahejlsberg Aug 23, 2023
768f592
perf: reduce GC pressure by hoisting script target features object (#…
Havunen Aug 23, 2023
12d9f04
Remove perf-result-post (#55470)
jakebailey Aug 23, 2023
5fe88ea
[Interactive inlay hints] Get source file from parameter node (#55476)
MariaSolOs Aug 23, 2023
3a22d3a
Remove the dependency of "del" (#55112)
jimmywarting Aug 23, 2023
76f3f47
Remove use of fs-extra (#55468)
jakebailey Aug 23, 2023
daa7e98
fix(55434): Renamed field takes on documentation from other field wit…
a-tarasyuk Aug 24, 2023
eb33c8e
Fix typo in getScriptTargetFeatures map (#55488)
jakebailey Aug 24, 2023
769f2da
Update package-lock.json
typescript-bot Aug 24, 2023
f07077c
Fixed a redundant used before defined error (#55283)
Andarist Aug 24, 2023
fecbae5
Fixed a regression in serializing setters with non-function declarati…
Andarist Aug 24, 2023
98d7e0b
Fix double error on invalid delete of readonly property (#55449)
shinichy Aug 24, 2023
91c0d7f
Avoid resolving objects in getTypeFacts when caller doesn't need that…
jakebailey Aug 24, 2023
e0a324b
Don't parse `DotDotDotToken` in JSX attribute values (#55284)
Andarist Aug 24, 2023
c3c5abb
Update package-lock.json
typescript-bot Aug 25, 2023
ec2bd4e
perf: replace String and Array indexOf method calls with includes met…
Havunen Aug 25, 2023
51e7a34
Update package-lock.json
typescript-bot Aug 26, 2023
753c463
Only infer readonly tuples for `const` type parameters when constrain…
ahejlsberg Aug 26, 2023
5b9547b
Add a fourslash completions test related to JSDoc `@template` on prot…
Andarist Aug 26, 2023
270a471
Add a test case with a generic member call returning a closed over ob…
Andarist Aug 26, 2023
27a5bdd
Add a test for finding all references of same-named imports from two …
Andarist Aug 26, 2023
11b2313
Update package-lock.json
typescript-bot Aug 28, 2023
4b15830
Add an extra test for `as const satisfies` with a mutable array (#55522)
Andarist Aug 28, 2023
4d7753a
Ensure parsing context is restored in jsdoc parser (#55537)
jakebailey Aug 28, 2023
77897bd
Removing comment
hardikkoul Aug 28, 2023
788239f
do not report use-before-declaration error in async like IIFE initial…
Zzzen Aug 28, 2023
9d0dc77
fix(55494): Invalid declaration with computed property using imported…
a-tarasyuk Aug 28, 2023
5ce34ca
Avoid trying to emit anonymous classish/expando functions as assignme…
weswigham Aug 28, 2023
b5b6048
Clean up helpers which are always present in ES2020 (#55515)
jakebailey Aug 28, 2023
fe70ec9
Parse reserved identifiers as dotted names of ambient modules (#55282)
Andarist Aug 28, 2023
9a6a4ab
Fixed a string completions regression when requested directly in argu…
Andarist Aug 28, 2023
32ebbe0
Transfer all declared symbols onto the type from the interface that e…
Andarist Aug 28, 2023
418494e
Infer from parameters annotated using JSDoc (#55400)
Andarist Aug 28, 2023
9f9a72a
Disallow object prototype property access on const enums (#55424)
Andarist Aug 29, 2023
9ab97a6
changing "compilerOptionsIndicateEs6Modules"
hardikkoul Aug 11, 2023
4dc4225
Adding Unit Test
hardikkoul Aug 13, 2023
23dd2d7
updating the Unit Test Case
hardikkoul Aug 15, 2023
2bf66ce
Removing comment
hardikkoul Aug 28, 2023
8593208
adding space
hardikkoul Aug 29, 2023
9a450cb
Merge branch 'bug55256-Hardik' of https://github.com/hardikkoul/TypeS…
hardikkoul Aug 29, 2023
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
  •  
  •  
  •  
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))];
})),
}
};
30 changes: 1 addition & 29 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@
],

// Todo: For each of these, investigate whether we want to enable them ✨
"prefer-rest-params": "off",
"prefer-spread": "off",
"@typescript-eslint/no-unused-vars": "off",

// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
Expand All @@ -130,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