I've been using vim for years, but I've just started integrating eslint (through ALE). I've found that sometimes I want to be able to quickly add an /* eslint-ignore-next-line */. For example:
...
❌ if (m = /^-l(\d+)$/.exec(args[i])) t.len = m[1];
...
~/some/dir/file.js [+]
cond-assign: Expected a conditional expression and instead saw an assignment.
It's really handy that ALE gives you the code at the bottom of the window, but being lazy I want to automate adding the comment/hint:
/* eslint-ignore-next-line cond-assign */
Is there a way to access that information at the bottom of the screen in a vim script/function?
Though not documented, ALE stores lint information in the
b:ale_highlight_itemsvariable.David784's solution didn't work for me because I had customized the location-list text using ALE's
g:ale_echo_msg_formatconfiguration option. So I modified it to obtain the information directly fromb:ale_highlight_itemsinstead of parsing it out of the location-list.Here it is: