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.

Rename variables that start with opt_

See original GitHub issue

This is a good first issue for people who want to start contributing to this repository.

Category

Plugins

Component

All plugins

Describe the bug

The existing code uses opt_ as a prefix for optional parameter names. This is based on old recommendations in Google’s style guide.

The style guide now says that parameter names should all be written in lowerCamelCase.

You can see all of the places where the wrong naming convention is used by running npm run lint from the root of the repository.

Steps to fix

  1. Run npm run lint from the root of the repository.
  2. Choose a file with lint errors due to camelcase issues.
  3. Replace all names: opt_someParameterName should become optSomeParameterName.
  4. Make a pull request.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lazy-geekcommented, Jun 17, 2021

@rachel-fenichel ok Also just to clarify By

Category Plugins

You mean that these changes only need to be made in Plugins folder right?

0reactions
rachel-fenichelcommented, Jun 17, 2021

If the names are conflicting, pick a new name for either the parameter or the variable name in the function–hopefully most of these are straightforward.

For lint not detecting every instance: Yes, manually using find and replace is fine as well.

Cheers, Rachel

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rename refactorings | IntelliJ IDEA Documentation - JetBrains
Use the Rename refactoring to change names of symbols, files, directories, packages, modules and all the references to them throughout code.
Read more >
rename variables in the middle of the scope - c++
I want to change a variable name in middle of its scope for readability issue. For example: while(condition){ std::vector<big_type> ...
Read more >
Renaming variables that don't have a space to have a space
Hello - I have a request to change all of the variable names for a report that I created. I will be using...
Read more >
select & rename R Functions of dplyr Package (2 Examples)
In this R tutorial you'll learn how to select and rename variables with the select() and rename() functions of the dplyr package. The...
Read more >
Renaming destructured variables in ES6 | by Valter Júnior
A property can be unpacked from an object and assigned to a variable with a different name than the object property. That's it!...
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