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.

no-underscore-dangle to check function params

See original GitHub issue

What rule do you want to change? no-underscore-dangle

Does this change cause the rule to produce more or fewer warnings? More warnings

How will the change be implemented? (New option, new default behavior, etc.)? The updated rule will check if param Identifiers of FunctionDeclarations and ArrowFunctionExpressions have dangling underscores.

I suggest that underscore dangle in these situations is disallowed by default and can be configured using the same pattern as "allowAfterThis" and "allowAfterSuper".

Please provide some example code that this change will affect:

const test = (_arg) => { };
function myfunc(_arg) { };

What does the rule currently do for this code? No error thrown.

What will the rule do after it’s changed? Throw an error because the function params have dangling underscores.

Are you willing to submit a pull request to implement this change? Yes

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kaicataldocommented, Dec 19, 2019

I’ll champion this. We still need support from two other team members before we can mark this as accepted.

0reactions
anikethsahacommented, Jul 23, 2020

Marking this as accepted as there are 3 +1 from team members.

I think allowFunctionParams might be a good approach and name which will be true by default as mentioned above

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-underscore-dangle - 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 >
How to solve no-underscore-dangle error without making the ...
memoizedProps[0] but is giving esLint error no-underscore-dangle and I would like to solve it without disabling the error config.
Read more >
no-underscore-dangle.js - searchcode
searchcode is a free source code search engine. Code snippets and open source (free software) repositories are indexed and searchable.
Read more >
How to use the fastest-validator function in fastest-validator
To help you get started, we've selected a few fastest-validator examples, based on popular ways it is used in public projects. Secure your...
Read more >
Disallow Use of undefined Variable (no-undefined) - ESLint
(All uninitialized variables automatically get the value of undefined in JavaScript.) Checking if a value is undefined should be done with typeof ....
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