Closed herman-rogers closed 5 years ago
Did you see any other useful error messages? Or do you have linting engine configured properly?
I believe the linting is setup properly - I'll give it another look today. Sorry for the lack of information - but that's all that was output by fixmyjs. Fairly annoying :/
Edit: btw I'm using plain old eslint
Here's a bit more information I was able to get out:
Error detected while processing function Fixmyjs:
line 20: E37: No write since last change (add ! to override)
Yea not sure what's going on here, I suspect the recent changes may have broken something. How I got around this was forking the project and resetting HEAD back to before the changes made 3 months ago. Everything is working now.
For some more information, I have eslint installed globally npm install -g eslint
and I have it set to a custom eslint file let g:fixmyjs_rc_filename = ['.eslintrc', '.eslintrc.json']
and I have my preferences stored in a .eslint.json
file.
same problem now: Error detected while processing function Fixmyjs: line 20: E37: No write since last change (add ! to override)
@herman-rogers @zhongfox Thank you very much for the comments.
In the latest commit, let g:fixmyjs_rc_filename = ['.eslintrc', '.eslintrc.json']
is no longer needed. It will automatically resolve the .rc
file just like how you use eslint
in command line.
But there is a breaking change:
eslint
will fix the file in-place(previously, it copy the current buffer to a new tmp file and fix the tmp file and copy the fixed file back to current buffer). This change requires you to save your current file first and then run :Fixmyjs
, I guess this might be the reason why you see this error.
This is how I configure my VIM to format the code when I save it. He made the same mistake.
au BufWritePre *.js :Fixmyjs
au BufWritePre *.jsx :Fixmyjs
au BufWritePre *.vue :Fixmyjs
au BufWritePre *.html :Fixmyjs
I changed the following way to solve the problem.
au BufWritePost .js :Fixmyjs
au BufWritePost .jsx :Fixmyjs
au BufWritePost .vue :Fixmyjs
au BufWritePost .html :Fixmyjs
thanks! @aapelismith
Not sure what's happening - whenever I try to run Fixmyjs it throws the above error and fails to auto format my js.