Skip to content
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

no-return-assign could use an except-parens option to match no-cond-assign #2809

Closed
moll opened this issue Jun 20, 2015 · 5 comments · May be fixed by iamstoick/javascript#11
Closed

no-return-assign could use an except-parens option to match no-cond-assign #2809

moll opened this issue Jun 20, 2015 · 5 comments · May be fixed by iamstoick/javascript#11
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@moll
Copy link

moll commented Jun 20, 2015

Hey,

The no-return-assign could use an except-parens option to match no-cond-assign for those cases where returning and assign is convenient.

Thanks!

@ilyavolodin ilyavolodin added the triage An ESLint team member will look at this issue soon label Jun 20, 2015
@nzakas
Copy link
Member

nzakas commented Jun 22, 2015

Thanks for the note. Unfortunately, there's not enough information in this description. Can you please provide:

  1. Some sample code you want to lint
  2. The configuration of no-return-assign you're using
  3. What ESLint currently outputs
  4. What you want to happen instead

@moll
Copy link
Author

moll commented Jun 22, 2015

http://eslint.org/docs/rules/no-cond-assign.html has:

except-parens (default): Disallow assignments unless they are enclosed in parentheses.

I'm proposing no-return-assign do the same.

The following patterns would then not be considered warnings:

function doSomething() {
    return (foo = bar + 2)
}

function doSomething() {
    return (foo += 2)
}

@nzakas
Copy link
Member

nzakas commented Jun 22, 2015

Seems rational to me.

@ilyavolodin ilyavolodin added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion enhancement This change enhances an existing feature of ESLint and removed triage An ESLint team member will look at this issue soon labels Jun 22, 2015
@mathieumg
Copy link
Contributor

I know this is already accepted, just wanted to show further support for this.

@mysticatea
Copy link
Member

I will try to make this.

@nzakas nzakas closed this as completed in 05dceae Jun 25, 2015
nzakas added a commit that referenced this issue Jun 25, 2015
Update: Add `except-parens` option to `no-return-assign` rule (fixes #2809)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
5 participants