neoclide / coc-eslint

Eslint extension for coc.nvim
MIT License
396 stars 25 forks source link

shoudFix parameter was false #140

Closed ppp-12 closed 1 year ago

ppp-12 commented 1 year ago

I have the settings of CocConfig eslint.autoFixOnsave: true, when I do :w, I can see the fixes being applied momentarily in the buffer, but then it reverts to the unfixed version.

however when I run the CocCommand eslint.executeAutoFix the fixes are applied and not reverted.

in the CocCommand eslint.showOutputChannel, I have got the following:

eslint:source-code-fixer shouldFix parameter was false, not attempting fixes

for vscode, there seem to be somewhere it can be set, not sure where this shouldFix param can be set in coc-eslint though

eslint version: "8.28.0" coc-eslint version: 1.6.0

fannheyward commented 1 year ago

It's eslint.autoFixOnSave, not eslint.autoFixOnsave, upper S.

ppp-12 commented 1 year ago

oops, I just checked again, in my CocConfig it is eslint.autoFixOnSave like you've mentioned instead of eslint.autoFixOnsave, I made a mistake in the original post, and I still haven't figured out how to get it to work

edit: if it is helpful, here's my CocConfig:

{
    "coc.preferences.jumpCommand": "vsplit",
    "languageserver": {
        "golang": {
            "command": "gopls",
            "rootPatterns": ["go.mod"],
            "filetypes": ["go"]
        }
    },
    "eslint.autoFixOnSave": true,
    "suggest.noselect": true,
    "suggest.enablePreselect": false,
    "typescript.suggest.autoImports": true
}
fannheyward commented 1 year ago

the fixes being applied momentarily in the buffer, but then it reverts to the unfixed version

Looks like this isn't coc-eslint's issue, cause the fixes already work, try minimal vimrc, only coc+coc-eslint only.

ppp-12 commented 1 year ago

thanks for your time @fannheyward , I will treat this as closed then