ESLint plugin providing rules to enforce readable and proper arrow function definitions.
ESLint Plugin Proper Arrows is an ESLint plugin that provides a collection of rules to enforce stricter and more readable arrow function definitions in JavaScript. It solves the problem of arrow functions being used in ways that harm code readability and maintainability, such as anonymous inline functions, unclear return values, and misuse of lexical `this`.
JavaScript developers and teams who use ESLint and want to enforce consistent, readable arrow function patterns across their codebase, particularly in larger or long-term projects.
Developers choose this plugin because it fills gaps in ESLint's built-in rules by specifically targeting arrow function readability issues with highly configurable, opinionated rules that promote proper usage over syntactic convenience.
ESLint rules to ensure proper arrow function definitions
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Each of the five rules offers fine-tuned options, like the 'params' rule's modes for unused parameters and minimum name lengths, allowing teams to customize enforcement precisely.
The 'name' rule requires arrow functions to be assigned for inferred names, directly improving stack trace readability and addressing a gap in ESLint's built-in func-names rule.
Rules like 'this' enforce that arrow functions are used intentionally for lexical this behavior, promoting a deliberate approach over syntactic convenience.
It tackles multiple arrow function aspects—parameters, naming, placement, returns, and this usage—filling gaps left by ESLint's built-in rules, as noted in the README comparisons.
With five distinct rules each having multiple modes and options, setting up requires significant effort and team consensus, which can be overwhelming for new adopters.
Strict defaults, such as forbidding arrow functions in object properties or exports, conflict with common JavaScript patterns and may necessitate frequent overrides.
The README lacks presets or guidance for popular frameworks like React or Vue, leaving teams to manually adapt rules to their ecosystem, which can lead to integration friction.