Comments (32)
Hmm, I'll have a look when I get home in a day or so. Maybe I broke it
recently.
from ale.
It's working fine for me on NVIM 0.1.5
https://asciinema.org/a/1bmolpzfuvp35yranh0uwv64l
Could you update to the latest version of the plugin and try to use a clean .nvimrc containing just this plugin?
from ale.
I cleared my init.vim so it looks like this:
call plug#begin()
Plug 'w0rp/ale'
call plug#end()
set nocompatible
filetype off
filetype plugin on
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
let g:ale_sign_column_always = 1
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'
But the actual behaviour is still the same as here https://asciinema.org/a/bwl9gjml8rptaztb08ntegn66
from ale.
I had a look myself, and the plugin seems to work in NVim. Have you tried using any of the other linters? I wonder if there might be an issue with switching to the right directory to pick up on something like an eslint
configuration file. Can you see any warnings/errors with eslint
at all?
from ale.
It's strange because according to the recording, eslint
runs fine in the shell.
At about 00:14 I saw a ctags error flash at the bottom, wonder if that may have anything to do with it.
Could you try running these commands and let us know the results?
:set ft?
:call ALELint(0)
:echo ALEGetLinters('javascript')
from ale.
Have you tried using any of the other linters?
I'm using neomake in my daily work and it works as intended.
At about 00:14 I saw a ctags error flash at the bottom, wonder if that may have anything to do with it.
This is not the case because i cleared my config file and disabled the rest of plugins.
So here's an update:
https://asciinema.org/a/98nbo4ql1b71emsiwthj5x2ki
Could you try running these commands and let us know the results?
:set ft?
:call ALELint(0)
:echo ALEGetLinters('javascript')
https://asciinema.org/a/93j7i1p67x613mfke60700bza
from ale.
I'm using neomake in my daily work and it works as intended.
I was actually referring to one of the other linters offered in this plugin. I wonder if your issue is specific to eslint
, or if the issue is caused by something else we haven't determined yet.
from ale.
I tried the plugin with jshint
and the behaviour was the same as with eslint
:
https://asciinema.org/a/96k6ftygd500vdkrx5lj7ohwp
But it worked for php file:
https://asciinema.org/a/580nis1zb6xnrrc299p7aqxp2
from ale.
Hmm. What's the output of command -v eslint
? Maybe the executable isn't in PATH
for NeoVim? Maybe it's failing to find a configuration file for JavaScript files?
from ale.
command -v eslint
returns:
/usr/bin/eslint
from ale.
BTW, the version of eslint is v2.2.0
from ale.
Could you paste the output of :!eslint -f unix --stdin < %
on a file which has some kind of problem? We can check if eslint
works from NeoVim with those options at all.
from ale.
Here the output:
:!eslint -f unix --stdin < test.js
Path must be a string. Received undefined
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.extname (path.js:1433:5)
at processText (/usr/lib/node_modules/eslint/lib/cli-engine.js:144:30)
at CLIEngine.executeOnText (/usr/lib/node_modules/eslint/lib/cli-engine.js:671:26)
at Object.execute (/usr/lib/node_modules/eslint/lib/cli.js:178:36)
at /usr/lib/node_modules/eslint/bin/eslint.js:41:28
at ConcatStream.<anonymous> (/usr/lib/node_modules/eslint/node_modules/concat-stream/index.js:36:43)
at emitNone (events.js:91:20)
at ConcatStream.emit (events.js:185:7)
at finishMaybe (/usr/lib/node_modules/eslint/node_modules/readable-stream/lib/_stream_writable.js:475:14)
shell returned 1
from ale.
Aha, that's probably the problem there. It looks like eslint
isn't running. Maybe something different needs to be done for that version of eslint
. I'm on 2.5.3
myself. Could you let me know what your version of jshint
is too? I can try installing that version too and see if I can repeat the same error.
from ale.
Sure:
jshint v2.9.3
from ale.
I'll try it out over lunch in a few hours and get back to you.
from ale.
I can confirm that the problem is in version.
I just installed eslint v3.7.1
and the plugin starts to show errors.
from ale.
Do you happen to be on Node v6?
Apparently there are others with the same issue
standard/standard#504
from ale.
Yes, my Node version is v6.6.0
from ale.
@deathmaz I just pushed a fix now for the older eslint version. There is an --stdin-filename
option for giving a hint as to what the file you are linting is, even though you are passing input from stdin. If you set that option for the older eslint version, it seems to execute. Try it again with your older eslint
version, and let me know if it works for you.
I added support for formatting the filename into commands for any linter to fix this.
from ale.
Whatever problems you are experiencing with jshint
still need to be investigated.
from ale.
I also need to find a way to somehow automatically report when linters were run, but failed, and explain why they failed. That would help in these situations. Maybe I can assume that when a program exits with an error code and no warnings are errors are outputted from one of the handler functions, that something went wrong, and then complain about things going wrong.
from ale.
If you set that option for the older eslint version, it seems to execute
You mean now i need to run this command:
!eslint -f unix --stdin-filename < %
?
from ale.
I downgraded eslint and here what i got:
https://asciinema.org/a/di1md91nto6txmxxovr203qxr
from ale.
Ah, getbufinfo
doesn't exist in NeoVim, only in Vim 8. I'll try something else.
from ale.
Okay, pull again and try again. That should hopefully do the trick.
from ale.
Yes, it works!
from ale.
Awesome. I'm glad I could get it working for you. 👍 I'll look into jshint
issues later perhaps.
from ale.
Thank you for your work!
from ale.
You can check jshint
now. jshint
was one of the first linters added, and it was set up with a fixed configuration file initially. I fixed it so it searches for your .jshintrc
file. Let me know if that works for you.
from ale.
Awesome, i can confirm that it works with jshint
!
I'm closing this issue
Thank you very much! 👍
from ale.
Nice. No problemo.
from ale.
Related Issues (20)
- ALE linting .tsx as .ts files when using Biome
- [Biome] Linter not usable
- Should/could ALE pass --no-fix argument to ruff when linting (to override project configuration)? HOT 5
- ALEHover text not appearing in floating preview HOT 1
- Cannot use ALE in MacVim when the file is opened via the right-click context menu or the File > Open dialog in MacVim HOT 2
- error loading shared lib: libicui18n.so.73 HOT 1
- json linting with jq doesn't report errors correctly
- On Windows 11, shell=pwsh/powershell continues breaking ALE lint HOT 1
- `write-good` plugin need make separate files that only have text
- cspell option “-c config.yaml” not work
- `sqlfluff` does not work in Neovim, throws an error when trying to lint an opened file HOT 1
- Signs cannot be customized HOT 5
- ALEFix with clangtidy not updating the buffer HOT 1
- clang++ command not getting correct include paths
- error highlights entire function
- Add support for pymarkdown
- Strange syntax highlighting behavior with ALE on Neovim HOT 1
- ALE ruff format shows error: "Unidentified byte: Loading .env environment variables..."
- ALE support linter group HOT 3
- Incorrect eslint project root when using nested node_modules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ale.