You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if auto-fix is supported for plugins within ESLint at this point (I'm thinking not, given that --fix did nothing instead of fixed the wrong area).
If ESLint were to support fix in plugins, I would need to adjust post-processing to take the fix output (from the error message object) and adjust its range, not unlike how line and column get adjusted.
Update: I've opened eslint/eslint#5588 which is about halfway towards implementing plugin auto-fix in ESLint. The issue I've run into now, though, is that the auto-fix logic takes in a SourceCode object which is constructed from the code blocks returned by preprocess(). Unfortunately, the fixer really needs to be applied on the raw file text.
I'm exploring how we might be able to make that work-- I'm currently thinking SourceCodeFixer.applyFixes() should be split into two methods: one which processes the text, and one which takes in a SourceCode object and calls the text-processing method while taking advantage of some of the information available in SourceCode.
If I can figure out a way to make that work, then auto-fix for plugins should basically be in the bag.
Using
-- fix
does not currently work. Not sure if that's within the scope of this project, but I thought I'd document that it does not currently work.The error I tried to fix was
space-before-function-paren
.It did not error or cause problems, but simply did nothing.
The text was updated successfully, but these errors were encountered: