Comments (9)
It appears to process some output according to the log file.
Check with :lopen
if it is maybe only not recognized properly etc.
(sorry, I've only skimmed this quickly, thanks for the info so far regardless)
from neomake.
Thanks @blueyed !
:lopen
does show something, but I also noticed that it points to a different path (spec/javascripts/
) than the actual file (app/javascript
) so perhaps that's related?
from neomake.
Yes, certainly.
I suggest looking at the log and the code: the output has "filePath":"<text>"
, which gets uses as filename (
This results in a new buffer (check :ls!
), named <text>
then.
This is likely triggered by using --stdin
, which you've configured manually probably.
This should get handled by supports_stdin
(
neomake/autoload/neomake/makers/ft/javascript.vim
Lines 71 to 75 in 053d6bd
from neomake.
Are you re-defining/copying g:neomake_javascript_eslint_maker
?
Check that its supports_stdin
uses/adds --stdin-filename
also.
from neomake.
Thanks a bunch @blueyed. I changed my config to
let g:neomake_javascript_eslint_args = ['exec', '-T', 'webpacker', 'npx', 'eslint', '--stdin', '--stdin-filename=%:p'] + neomake#makers#ft#javascript#eslint().args
And it works... but somehow on another file, I'm not sure it's picking up my .eslintrc.yaml
file? because I get an error that I don't normally get ...
I tried to add --config ./.eslintrc.yaml
, e.g. let g:neomake_javascript_eslint_args = ['exec', '-T', 'webpacker', 'npx', 'eslint', '--stdin', '--stdin-filename=%:p', '--config ./.eslintrc.yaml'] + neomake#makers#ft#javascript#eslint().args
but then I get a strange error:
14:47:51 12601 [V ] [37.42:1:1] Starting async job: docker-compose exec -T webpacker npx eslint --stdin --stdin-filename=/path/to/my_file.js '--config eslintrc.yaml' --format=json.
14:47:51 12601 [D ] [37.42:1:1] cwd: /var/local/kenhub/kenhub/spec/javascripts (changed).
14:47:51 12601 [D ] [-.-:1:1] automake: started jobs: [42].
14:47:52 12601 [D +1.10] [37.42:1:1] output on stderr: ['Value for ''config'' of type ''path::String'' required.', ''].
14:47:52 12601 [D ] [37.42:1:1] exit: eslint: 2.
(somehow the --config
part of the params are quoted when executing eslint?? I'm really confused about what's happening here...)
from neomake.
Okay, problem solved eventually. I had to use --config=<path>
. Here's my eslint config :)
let g:neomake_javascript_eslint_exe = 'docker-compose'
let g:neomake_javascript_eslint_args = ['exec', '-T', 'webpacker', 'npx', 'eslint', '--stdin', '--stdin-filename=%:p', '--config=./.eslintrc.yaml'] + neomake#makers#ft#javascript#eslint().args
let g:neomake_javascript_eslint_uses_stdin = 1
let g:neomake_javascript_eslint_uses_filename = 1
let g:neomake_javascript_eslint_append_file = 0
Thank you so much for your help!!
from neomake.
I'm glad we could solve it.
However I recommend trying to not override maker
s in general, if not necessary, which also includes its args etc, if not necessary.
It looks like you are doing this to prefix / wrap it with docker-compose, for what you could use a wrapper script (see #2411 (comment), where we had that topic already).. :)
Alternatively check :h neomake-makers-InitForJob
, where it has an example to wrap/adjust/prefix the exe - which is meant to happen after any default supports-stdin handling etc.
from neomake.
Thanks again @blueyed ...
I tried to read the help doc you pointed to, but I have to admit (as I commented on #2411 (comment)), I don't really understand what to do instead. I can create a wrapper script, sure, but I think the main problem is that the paths inside the docker container and outside it are different, right? which means using stdin and somehow feeding the outside paths?
Are there any concrete canonical examples of how to configure things the right way? (ideally with eslint / rubocop if possible).
from neomake.
I played around with ALE, and in terms of configuration it seems to be a bit simpler to set up with docker? it relies on path mapping between where vim runs and where the linter does, so it looks like this
let b:ale_linters = ['rubocop', 'eslint']
let b:ale_ruby_rubocop_use_global = 1
let b:ale_javascript_eslint_use_global = 1
let b:ale_ruby_rubocop_executable = 'docker-compose -T web bundle exec rubocop'
let b:ale_javascript_eslint_executable = 'docker-compose -T webpacker npx eslint'
let b:ale_filename_mappings = {
\ '*': [
\ ['/local/vim/path', '/docker/path'],
\ ],
\ }
(the file mapping can be set on a per-linter basis as well)
from neomake.
Related Issues (20)
- [QUESTION] How the change clangcheck to use -std=c++2a? HOT 2
- [REQUEST] PLEASE UPDATE THE D MAKERS FILE! HOT 1
- Neomake quickfix not opening lnum: 0 bufnr: 0 ... HOT 3
- Aditional Arguments to clang maker not working HOT 2
- golang build tags can't set
- "E788: Not allowed to edit another buffer now" when opening the locations window HOT 1
- "Key not present in Dictionary: "maker_jobs)"" with automake HOT 2
- option for using quickfix list only HOT 4
- Making C++ header files results in uncleaned `.gch` files
- Run eslint for the whole project
- How to define maker that only supports project mode HOT 1
- Default ruby maker does not work with ruby version >= 3 HOT 2
- python: frosted is deprecated in favor of flake8
- g:neomake_logfile variable expansion not working homedir: ie., $HOME and ~ HOT 2
- Make neomake pick local tsc executable HOT 3
- feature: on/off switch to exclusively report to vim.diagnostic HOT 1
- Temporary files left over HOT 2
- Neomake: Exe (ruby-lint) of maker rubylint is not executable. HOT 2
- ansible-lint not working due to incorrect errorformat
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 neomake.