-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
feat(semantic): report parameter related errors for setter/getter #2316
feat(semantic): report parameter related errors for setter/getter #2316
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
CodSpeed Performance ReportMerging #2316 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a javascript error with a missing case from
oxc/crates/oxc_parser/src/js/class.rs
Lines 364 to 380 in a762d17
if kind == MethodDefinitionKind::Get && value.params.parameters_count() != 0 { | |
self.error(diagnostics::GetterParameters(value.params.span)); | |
} | |
if kind == MethodDefinitionKind::Set && value.params.parameters_count() != 1 { | |
self.error(diagnostics::SetterParameters(value.params.span)); | |
} | |
if kind == MethodDefinitionKind::Constructor { | |
if let Some(this_param) = &value.this_param { | |
// class Foo { constructor(this: number) {} } | |
self.error(diagnostics::TSConstructorThisParameter(this_param.span)); | |
} | |
if r#static { | |
self.error(diagnostics::StaticConstructor(key.span())); | |
} |
I think it's easier to move these checks over to checker/javascript.js instead of keeping them in the parser?
Yes, I will move the implementation to |
393e5eb
to
0c66b07
Compare
0c66b07
to
f5e2a24
Compare
f5e2a24
to
e2bcd8d
Compare
No description provided.