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

ignore end of function, or add parameter for ignore in rule newline-after-var #3682

Closed
alexander-akait opened this issue Sep 7, 2015 · 13 comments
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

@alexander-akait
Copy link

{
"newline-after-var": [
            2,
            "always"
        ]
}
function example() {
    var anonymous = function () {
        console.log('anonymous function expression');
    };
}
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Sep 7, 2015
@eslintbot
Copy link

Thanks for the issue! We get a lot of issues, so this message is automatically posted to each one to help you check that you've included all of the information we need to help you.

Reporting a bug? Please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. The source code that caused the problem
  3. The configuration you're using (for the rule or your entire config file)
  4. The actual ESLint output complete with line numbers

Requesting a new rule? Please be sure to include:

  1. The use case for the rule - what is it trying to prevent or flag?
  2. Whether the rule is trying to prevent an error or is purely stylistic
  3. Why you believe this rule is generic enough to be included

Requesting a feature? Please be sure to include:

  1. The problem you want to solve (don't mention the solution)
  2. Your take on the correct solution to problem

Including this information in your issue helps us to triage it and get you a response as quickly as possible.

Thanks!

@ilyavolodin
Copy link
Member

Could you provide details requested by the bot?

@alexander-akait
Copy link
Author

@ilyavolodin

  1. 1.3.1
'use strict';

function example() {
    var anonymous = function () {
        console.log('anonymous function expression');
    };
}

example();
  1. above
  2. ESLint: Expected blank line after variable declarations. (newline-after-var)

@nzakas
Copy link
Member

nzakas commented Sep 7, 2015

What line and column does the error message report?

@alexander-akait
Copy link
Author

@nzakas

'use strict';

function example() {
    var anonymous = function () {
        console.log('anonymous function expression');
    }; // On this line
}

example();

@ilyavolodin ilyavolodin added bug ESLint is working incorrectly rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Sep 15, 2015
@gyandeeps
Copy link
Member

This sounds more like an enhancement?
CC @eslint/eslint-team

@ilyavolodin ilyavolodin added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed bug ESLint is working incorrectly labels Oct 2, 2015
@ilyavolodin
Copy link
Member

Agree. That's an enhancement. I think it makes sense to add.

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Oct 3, 2015
@nzakas
Copy link
Member

nzakas commented Oct 3, 2015

What would the option be called?

@ilyavolodin
Copy link
Member

I'm not sure this should be an option. I think it should just be an enhancement to an existing functionality.

@IanVS
Copy link
Member

IanVS commented Oct 3, 2015

Unless there is a reason someone would want a blank line like this, and I can't imagine why anyone would, I think it would be best to avoid adding an option and just make it default behavior.

@alberto
Copy link
Member

alberto commented Oct 4, 2015

I'll give it a try

@ilyavolodin
Copy link
Member

@nzakas Are you ok with enabling this without an option?

@nzakas
Copy link
Member

nzakas commented Oct 5, 2015

Fine by me

@nzakas nzakas closed this as completed in 767c290 Oct 7, 2015
nzakas added a commit that referenced this issue Oct 7, 2015
Update: Ignore end of function in newline-after-var (fixes #3682)
@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
Development

No branches or pull requests

7 participants