Open privatenumber opened 6 months ago
It looks like getSourceCode() used to rewrite the function body is now deprecated and instead context.sourceCode should be used. Here is some documentation on how eslint API handles comments: https://eslint.org/docs/latest/extend/custom-rules#accessing-the-source-text
In case you're interested, I ended up rolling my own solution which makes autofixes with more precision: https://github.com/privatenumber/lintroll/tree/develop/src/custom-rules/prefer-arrow-functions
Description
Input code:
Fixed code:
Suggested Solution
Preserve whitespace and comments
Help Needed