-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionautofixThis change is related to ESLint's autofixing capabilitiesThis change is related to ESLint's autofixing capabilitiesbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible exampleruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
Environment
Node version: v19.3.0
npm version: v9.2.0
Local ESLint version: v8.30.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 22.1.0
What parser are you using?
Default (Espree)
What did you do?
Configuration
{
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"prefer-arrow-callback": [
"error"
]
}
}
test(
function ()
{ }
);
What did you expect to happen?
Autofix should fix the code like this:
test(
() =>
{ }
);
What actually happened?
Autofix produces unparseable code:
test(
()
=> { }
);
The problem occurs when the function body starts on a new line, like in the Allman style.
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionautofixThis change is related to ESLint's autofixing capabilitiesThis change is related to ESLint's autofixing capabilitiesbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible exampleruleRelates to ESLint's core rulesRelates to ESLint's core rules
Type
Projects
Status
Complete