Giter Site home page Giter Site logo

Comments (32)

w0rp avatar w0rp commented on July 22, 2024

Hmm, I'll have a look when I get home in a day or so. Maybe I broke it
recently.

from ale.

prashcr avatar prashcr commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

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.

w0rp avatar w0rp commented on July 22, 2024

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.

prashcr avatar prashcr commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

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.

w0rp avatar w0rp commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

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.

w0rp avatar w0rp commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

command -v eslint returns:
/usr/bin/eslint

from ale.

deathmaz avatar deathmaz commented on July 22, 2024

BTW, the version of eslint is v2.2.0

from ale.

w0rp avatar w0rp commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

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.

w0rp avatar w0rp commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

Sure:
jshint v2.9.3

from ale.

w0rp avatar w0rp commented on July 22, 2024

I'll try it out over lunch in a few hours and get back to you.

from ale.

deathmaz avatar deathmaz commented on July 22, 2024

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.

prashcr avatar prashcr commented on July 22, 2024

Do you happen to be on Node v6?

Apparently there are others with the same issue
standard/standard#504

from ale.

deathmaz avatar deathmaz commented on July 22, 2024

Yes, my Node version is v6.6.0

from ale.

w0rp avatar w0rp commented on July 22, 2024

@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.

w0rp avatar w0rp commented on July 22, 2024

Whatever problems you are experiencing with jshint still need to be investigated.

from ale.

w0rp avatar w0rp commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

I downgraded eslint and here what i got:
https://asciinema.org/a/di1md91nto6txmxxovr203qxr

from ale.

w0rp avatar w0rp commented on July 22, 2024

Ah, getbufinfo doesn't exist in NeoVim, only in Vim 8. I'll try something else.

from ale.

w0rp avatar w0rp commented on July 22, 2024

Okay, pull again and try again. That should hopefully do the trick.

from ale.

deathmaz avatar deathmaz commented on July 22, 2024

Yes, it works!

from ale.

w0rp avatar w0rp commented on July 22, 2024

Awesome. I'm glad I could get it working for you. 👍 I'll look into jshint issues later perhaps.

from ale.

deathmaz avatar deathmaz commented on July 22, 2024

Thank you for your work!

from ale.

w0rp avatar w0rp commented on July 22, 2024

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.

deathmaz avatar deathmaz commented on July 22, 2024

Awesome, i can confirm that it works with jshint!
I'm closing this issue
Thank you very much! 👍

from ale.

w0rp avatar w0rp commented on July 22, 2024

Nice. No problemo.

from ale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.