{"id":15118284,"url":"https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions","last_synced_at":"2025-09-28T00:32:21.938Z","repository":{"id":46112083,"uuid":"200524563","full_name":"JamieMason/eslint-plugin-prefer-arrow-functions","owner":"JamieMason","description":"Auto-fix plain Functions into Arrow Functions, in all cases where conversion would result in the same behaviour","archived":false,"fork":false,"pushed_at":"2024-08-14T10:36:27.000Z","size":402,"stargazers_count":52,"open_issues_count":12,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T01:37:28.571Z","etag":null,"topics":["arrow-functions","codemod","eslint","eslint-plugin","eslint-rule","javascript","lint","linter","linting","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-prefer-arrow-functions","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamieMason.png","metadata":{"files":{"readme":".github/README_CONTENT.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"JamieMason"}},"created_at":"2019-08-04T17:53:29.000Z","updated_at":"2024-10-27T23:50:38.000Z","dependencies_parsed_at":"2024-06-18T15:34:12.327Z","dependency_job_id":"abd2566b-4af3-4e8d-90e6-0129f762d1e0","html_url":"https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions","commit_stats":{"total_commits":92,"total_committers":13,"mean_commits":7.076923076923077,"dds":"0.48913043478260865","last_synced_commit":"a34f8f9f53ce9a3c09603c80968cefdb9ae9b060"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Feslint-plugin-prefer-arrow-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Feslint-plugin-prefer-arrow-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Feslint-plugin-prefer-arrow-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Feslint-plugin-prefer-arrow-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamieMason","download_url":"https://codeload.github.com/JamieMason/eslint-plugin-prefer-arrow-functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234475315,"owners_count":18839358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arrow-functions","codemod","eslint","eslint-plugin","eslint-rule","javascript","lint","linter","linting","nodejs"],"created_at":"2024-09-26T01:46:12.366Z","updated_at":"2025-09-28T00:32:16.654Z","avatar_url":"https://github.com/JamieMason.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JamieMason"],"categories":["TypeScript"],"sub_categories":[],"readme":"## ☁️ Installation\n\n```\nnpm install --save-dev eslint eslint-plugin-prefer-arrow-functions\n```\n\n## 🏓 Playground\n\nTry it yourself at\n[ASTExplorer.net](https://astexplorer.net/#/gist/7c36fe8c604945df27df210cf79dcc3c/12f01bed4dcf08f32a85f72db0851440b7e45cdd)\nby pasting code snippets in the top left panel, the results will appear in the\nbottom right panel.\n\n## ⚖️ Configuration\n\nAdd the plugin to the `plugins` section and the rule to the `rules` section in\nyour .eslintrc. The default values for options are listed in this example.\n\n```json\n{\n  \"plugins\": [\"prefer-arrow-functions\"],\n  \"rules\": {\n    \"prefer-arrow-functions/prefer-arrow-functions\": [\n      \"warn\",\n      {\n        \"classPropertiesAllowed\": false,\n        \"disallowPrototype\": false,\n        \"returnStyle\": \"unchanged\",\n        \"singleReturnOnly\": false\n      }\n    ]\n  }\n}\n```\n\n## 🤔 Options\n\n### `classPropertiesAllowed`\n\nWhen `true`, functions defined as\n[class instance fields](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Field_declarations)\nwill be converted to arrow functions when doing so would not alter or break\ntheir behaviour.\n\n### `disallowPrototype`\n\nWhen `true`, functions assigned to a `prototype` will be converted to arrow\nfunctions when doing so would not alter or break their behaviour.\n\n### `returnStyle`\n\n- When `\"implicit\"`, arrow functions such as `x =\u003e { return x; }` will be\n  converted to `x =\u003e x`.\n- When `\"explicit\"`, arrow functions such as `x =\u003e x` will be converted to\n  `x =\u003e { return x; }`.\n- When `\"unchanged\"` or not set, arrow functions will be left as they were.\n\n### `singleReturnOnly`\n\nWhen `true`, only `function` declarations which _only_ contain a return\nstatement will be converted. Functions containing block statements will be\nignored.\n\n\u003e This option works well in conjunction with ESLint's built-in\n\u003e [arrow-body-style](http://eslint.org/docs/rules/arrow-body-style) set to\n\u003e `as-needed`.\n\n## 👏🏻 Credits\n\nThis project is a fork of https://github.com/TristonJ/eslint-plugin-prefer-arrow\nby [Triston Jones](https://github.com/TristonJ).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamieMason%2Feslint-plugin-prefer-arrow-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJamieMason%2Feslint-plugin-prefer-arrow-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJamieMason%2Feslint-plugin-prefer-arrow-functions/lists"}