eslint-plugin-prefer-arrow-functions
eslint-plugin-prefer-arrow-functions copied to clipboard
Auto-fix plain Functions into Arrow Functions, in all cases where conversion would result in the same behaviour
## Description Input code: ```js function someFn( // comment a a, // comment b b, ) {} ``` Fixed code: ```js const someFn = (a, b) => {}; ``` ##...
## Description Before Fix: export default async function fetchFoo( After Fix: export default async (signal: AbortSignal): Promise => { This is horrible because that function is called in the code,...
## Description - Use ESLint flat config. - Upgrade ESLint to version 9. - Run eslint with this plugin enabled. - An error `context.getAncestors is not a function` is shown...
## Description (What) Bare minimum changes to have ESLint 9 support. Ideally tests should be updated to test flat config and a lot of types should be added, but this...
## Description (What) This PR implements an adjustment on the auto=fixer when transforming generic TSX components with one type argument. Fixes #27 ## Justification (Why) Otherwise, the auto-fix will generate...
## Description Constructor of class cannot be an arrow function, so, I think we need ignore it. I use Typescript 5+ and eslint 8+
## Description This plugin incorrectly fixes the generics syntax for React components with a single type parameter (``). For example: if you open a TypeScript + React project and create...
## Description Many libraries require named functions for various things, but almost all of them end up taking those functions as expressions, rather than requiring them to be declarations. For...
## Description In Angular, factories should be named functions, as you can read here angular/angular#13702 and here angular/angular#13614. Because of that, this rule interferes and throws when a factory is...
## Description Create a `.js` file in an environment with `eslint` and `eslint-plugin-prefer-arrow-functions` create an object with a function as a property: ```js const myObj = { dummyMethod(){ // ......