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

Conversation

mzbac
Copy link
Contributor

@mzbac mzbac commented Nov 29, 2022

Summary

There used to be a parse check of the "use strict" directive and an error would be thrown when encountering redundant "use strict" directives; however, it should be a linter error rather than a parser warning.

So this PR is for addressing that: -> #2678

Test Plan

Tests are added as part of the implementation.

@mzbac mzbac requested review from a team, ematipico, leops and xunilrj as code owners November 29, 2022 08:46
@netlify
Copy link

netlify bot commented Nov 29, 2022

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ee71b86
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6387cf2faa93f4000882de2c
😎 Deploy Preview https://deploy-preview-3895--docs-rometools.netlify.app
📱 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.

@Conaclos
Copy link
Contributor

Conaclos commented Nov 29, 2022

The PR title should certainly start with feat(rome_js_analyze).

@mzbac mzbac changed the title feat(semantic_analyzers): implement NoRedundantUseStrict rule feat(rome_js_analyze): implement NoRedundantUseStrict rule Nov 29, 2022
@MichaReiser MichaReiser changed the title feat(rome_js_analyze): implement NoRedundantUseStrict rule feat(rome_js_analyze): implement noRedundantUseStrict rule Nov 30, 2022
@MichaReiser MichaReiser changed the title feat(rome_js_analyze): implement noRedundantUseStrict rule feat(rome_js_analyze): noRedundantUseStrict rule Nov 30, 2022
Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

There are a few simplifications that we can make and I don't think the rule handles the case where a function has two use strict directives correctly yet.

We can merge this PR after these things have been changed and add support for classes and modules, where strict mode is enabled by default, separately.

mzbac and others added 6 commits December 1, 2022 08:36
@ematipico ematipico merged commit c595ab0 into rome:main Nov 30, 2022
@mzbac mzbac deleted the no-redundant-use-strict branch December 16, 2022 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载