This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Make IIFE wrap inside to avoid conflict with no-extra-parens#62
Merged
marlowpayne merged 1 commit intomasterfrom Aug 5, 2015
Merged
Make IIFE wrap inside to avoid conflict with no-extra-parens#62marlowpayne merged 1 commit intomasterfrom
marlowpayne merged 1 commit intomasterfrom
Conversation
Contributor
|
@marlowpayne I'm a little confused, we don't seem to be getting a lint error for the outside wrapping of the IIFE: Am I misunderstanding what you're saying? |
Author
|
Ah sorry @donnielrt I grabbed those code samples from the Eslint site, not realizing that my cause for the PR is a bit more specific. Try the IIFE in a |
Author
|
It's been a while since anyone's looked at this. Mind taking a quick look, @Helen-Mobify ? |
Author
|
@Helen-Mobify thanks for taking a look. On this branch you should be able to reach a non-error state for "inside" wrapping IIFEs. Are you able to get a non-error state with this?: |
|
@marlowpayne The screenshot I included are the errors I got for that piece of code. |
|
👍 Tested! The working code is to have the wrapping inside. |
marlowpayne
pushed a commit
that referenced
this pull request
Aug 5, 2015
Make IIFE wrap inside to avoid conflict with no-extra-parens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Status: Ready for Review
Reviewers: @donnielrt @Helen-Mobify
Changes
wrap-iiferule defaults to "outside" wrapping requiredHowever, this will conflict with our rule for
no-extra-parens, and since the rule is set to "outside" we cannot avoid a linting error since wrapping via inside to avoidno-extra-parensi.e.will violate the default "outside" rule.
This PR changes our rule to "inside" wrapping so that we may reach a no lint error state.
TL;DR: With the "outside" IIFE wrapping rule, you'll always be in an error state. Changing the IIFE rule to "inside" will let us reach a conflict-free state with no lint errors.
Todos:
Links:
Eslint wrap-iife rule
How to Test
npm install -g git+ssh://git@github.com:mobify/mobify-code-style.git#wrap-iife-conflict