Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix(typescript-estree): disallow binding patterns in parameter properties#11760
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
a6aebe2f2882255c6e3dfe9ef2e9547b55f511efefa9f77a1647b65d6b175b7d824304529ae16c2ee584348e7d7ed93f1cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| classTest{constructor(private[foo]=[1]){}} |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| classTest{constructor(private{ bar}={bar:1}){}} |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| classTest{constructor(private ...baz){}} |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,20 @@ | ||
| importtype{AST_NODE_TYPES}from'../../ast-node-types'; | ||
| importtype{Accessibility}from'../../base/Accessibility'; | ||
| importtype{BaseNode}from'../../base/BaseNode'; | ||
| importtype{Identifier}from'../../expression/Identifier/spec'; | ||
| importtype{Decorator}from'../../special/Decorator/spec'; | ||
| importtype{AssignmentPattern}from'../AssignmentPattern/spec'; | ||
| typeParameterPropertyParameter= | ||
| |(AssignmentPattern&{left:Identifier}) | ||
| |Identifier; | ||
| exportinterfaceTSParameterPropertyextendsBaseNode{ | ||
| type:AST_NODE_TYPES.TSParameterProperty; | ||
| accessibility:Accessibility|undefined; | ||
| decorators:Decorator[]; | ||
| override:boolean; | ||
| parameter:ParameterPropertyParameter; | ||
| readonly:boolean; | ||
| static:boolean; | ||
| } |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -109,8 +109,7 @@ export default createRule({ | ||
| ((node.parameter.type===AST_NODE_TYPES.Identifier&&// constructor (public foo) {} | ||
| node.parameter.name===name)|| | ||
| (node.parameter.type===AST_NODE_TYPES.AssignmentPattern&&// constructor (public foo = 1) {} | ||
| (node.parameter.leftasTSESTree.Identifier).name===name)) | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -59,22 +59,11 @@ function extractNonComputedName( | ||
| */ | ||
| exportfunctionextractNameForMember(node:MemberNode):ExtractedName|null{ | ||
| if(node.type===AST_NODE_TYPES.TSParameterProperty){ | ||
| constidentifier= | ||
| node.parameter.type===AST_NODE_TYPES.Identifier | ||
| ?node.parameter | ||
| :(node.parameter.leftasTSESTree.Identifier); | ||
| returnextractNonComputedName(identifier); | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| } | ||
| if(node.computed){ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -302,14 +302,6 @@ class Test { | ||
| }, | ||
| { | ||
| code:` | ||
| class Test { | ||
| #foo = 1; | ||
| #bar() {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -113,18 +113,6 @@ class Foo { | ||
| `, | ||
| options:[{allow:['public readonly','private']}], | ||
| }, | ||
| { | ||
| code:` | ||
| class Foo { | ||