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.

unused code and redefined variables, and set initial value

See original GitHub issue

Subject of the issue

I would like to refactor the code below. Because I used TypeScript, and concerned about the error.

Expected behaviour

  • Redefined variables
# https://github.com/mdx-js/mdx/blob/master/packages/mdx/index.js
- compile.sync = sync

module.exports = compile
exports = compile
exports.sync = sync
  • unused code
    • remove
  • Specifying initial values for optional arguments
# https://github.com/mdx-js/mdx/blob/master/packages/tag/src/mdx-provider.js#L5
- export const withMDXComponents = Component => ({ components, ...props }) => (
+ export const withMDXComponents = Component => ({ components = undefined, ...props }) => (

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Himenoncommented, Nov 27, 2018
1reaction
silvenoncommented, Nov 14, 2018

Merged! Feel free to continue with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unused local variables should be removed - SonarSource Rules
If a local variable is declared but not used, it is dead code and should be removed. Doing so will improve maintainability because...
Read more >
GCC4.3.3: variable used in a macro marked as unused
My solution is either to put the unused variable in the MyClass::processEvent() function into an #ifndef NDEBUG block as well if there are ......
Read more >
List of warnings — luacheck 0.26.0 documentation
For each value assigned to a local variable, Luacheck computes set of expressions where it could be used. Warnings are produced for unused...
Read more >
REDEFINES Clause - IBM
OPM COBOL/400 initializes redefined items. ILE COBOL does not initialize redefined items. The initial value is determined by the default value of the ......
Read more >
Default parameters - JavaScript - MDN Web Docs
However, it's often useful to set a different default value. ... However, functions and variables declared in the function body cannot be ...
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