Back to all reviewers

prefer idiomatic patterns

vadimdemedes/ink
Based on 4 comments
JavaScript

Choose language-native methods and control structures that make code more readable and maintainable. Use built-in functions instead of manual implementations, select appropriate control flow structures, and write explicit code that clearly communicates intent.

Code Style JavaScript

Reviewer Prompt

Choose language-native methods and control structures that make code more readable and maintainable. Use built-in functions instead of manual implementations, select appropriate control flow structures, and write explicit code that clearly communicates intent.

Examples of preferred patterns:

  • Use char.repeat(max) instead of manual string concatenation loops
  • Use switch statements instead of multiple if-else chains when handling discrete values
  • Use explicit return statements in cleanup functions: return () => { cleanup(); }; rather than return () => cleanup(); when you don’t want to return the cleanup function’s result
  • Use cleaner import paths that leverage package.json configuration

This approach reduces cognitive load, leverages language features effectively, and makes code intentions clearer to other developers.

4
Comments Analyzed
JavaScript
Primary Language
Code Style
Category

Source Discussions