unused code and redefined variables, and set initial value
See original GitHub issueSubject of the issue
I would like to refactor the code below. Because I used TypeScript, and concerned about the error.
- Redefined variables
- unused code
- https://github.com/mdx-js/mdx/blob/master/packages/mdx/test/index.test.js#L3
- https://github.com/mdx-js/mdx/blob/master/packages/tag/test/mdx-tag.test.js#L1
- https://github.com/mdx-js/mdx/blob/master/packages/tag/test/mdx-provider.test.js#L1
- https://github.com/mdx-js/mdx/blob/master/packages/runtime/test/index.test.js#L3
- Specifying initial values for optional arguments
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:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this issue resolved in https://github.com/mdx-js/mdx/pull/338
Merged! Feel free to continue with this.