question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

function-paren-newline error when there's a multiline comment before first argument or after last

See original GitHub issue

Tell us about your environment

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

Configuration
{
    "parserOptions": {
        "ecmaVersion": 10,
        "sourceType": "module",
        "ecmaFeatures": {}
    },
    "rules": {
        "function-paren-newline": 2
    },
    "env": {}
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

function RelativeLink({
  a,
  b
} /*: {
  +a: string,
  +b: string,
} */) {
  return a + b;
}

RelativeLink('a', 'b')

https://eslint.org/demo#eyJ0ZXh0IjoiZnVuY3Rpb24gUmVsYXRpdmVMaW5rKHtcbiAgYSxcbiAgYlxufSAvKjoge1xuICArYTogc3RyaW5nLFxuICArYjogc3RyaW5nLFxufSAqLykge1xuICByZXR1cm4gYSArIGI7XG59XG5cblJlbGF0aXZlTGluaygnYScsICdiJykiLCJvcHRpb25zIjp7InBhcnNlck9wdGlvbnMiOnsiZWNtYVZlcnNpb24iOjEwLCJzb3VyY2VUeXBlIjoibW9kdWxlIiwiZWNtYUZlYXR1cmVzIjp7fX0sInJ1bGVzIjp7ImZ1bmN0aW9uLXBhcmVuLW5ld2xpbmUiOjJ9LCJlbnYiOnt9fX0=

What did you expect to happen? No errors

What actually happened? Please include the actual, raw output from ESLint.

7:5 - Unexpected newline before ')'. (function-paren-newline)

Are you willing to submit a pull request to fix this bug? No

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yeonjuancommented, Dec 18, 2019

If this is a bug, Is this case a bug too? - demo

/*eslint array-bracket-newline: ["error", "never"]*/

var a = [ 1,
2/**
*
*/]; // Error - There sould be no line ... 

var a = [ 1,
2];
0reactions
arminyahyacommented, Apr 15, 2021

I’m working on it right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

function-paren-newline - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
ESLint simple react App.js Unexpected newline after ...
It seems airbnb uses function-paren-newline: 'multiline' for that rule, which means this should pass:
Read more >
ESLint - function-paren-newline The --fix option command line can ...
"multiline-arguments" works like multiline but allows linebreaks inside function parentheses if there is only one parameter/argument.
Read more >
PEP-8: clarify if multiline argument list with a closing `)` on a ...
The rationale behind this exception (the closing brace of a multiline construct may be on a line by itself except for ): )...
Read more >
How to Write Beautiful Python Code With PEP 8 - Real Python
PEP stands for Python Enhancement Proposal, and there are several of them. ... Here is a block comment explaining the function of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found