Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_js_analyze): add module and classes support for noRedundantUseStrict #3955

Merged
merged 10 commits into from
Dec 12, 2022
Merged

feat(rome_js_analyze): add module and classes support for noRedundantUseStrict #3955

merged 10 commits into from
Dec 12, 2022

Conversation

mzbac
Copy link
Contributor

@mzbac mzbac commented Dec 5, 2022

Summary

Adding module and class support for noRedundantUseStrict rule to address #3901

Test Plan

All tests added as part of PR.
cargo test passed

@mzbac mzbac requested review from leops, xunilrj, ematipico and a team as code owners December 5, 2022 13:10
@netlify
Copy link

netlify bot commented Dec 5, 2022

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4191d56
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6395b432ad34170008cb737d
😎 Deploy Preview https://deploy-preview-3955--docs-rometools.netlify.app/playground
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

}
}
if let Some(module_or_class) = JsModuleOrClass::cast_ref(&n) {
outer_most = Some(module_or_class.into());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm undecided if we should break if we find a class because it doesn't matter if any outer node has a use strict directive .

Copy link
Contributor Author

@mzbac mzbac Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understand this correctly. Are you saying that the 'use strict' is scoped within the class, so the outer node would have its own 'use strict' directive?

@MichaReiser MichaReiser added A-Linter Area: linter L-JavaScript Langauge: JavaScript labels Dec 9, 2022
@MichaReiser MichaReiser added this to the Next milestone Dec 9, 2022
@MichaReiser MichaReiser merged commit 63409a8 into rome:main Dec 12, 2022
@mzbac mzbac deleted the noRedundantUseStrict-with-class-and-module branch December 16, 2022 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter L-JavaScript Langauge: JavaScript
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants