1

I can't seem to enable the scss-stylelint checker for scss-mode.

flycheck-verify-setup gives me this:

Syntax checkers for buffer _typography.scss in scss-mode:

  scss-lint (disabled)
    - may enable:         Automatically disabled!
    - executable:         Not found
    - configuration file: Found at "/Users/edbury/.scss-lint.yml"

  scss-stylelint
    - may enable:         yes
    - executable:         Found at /Users/edbury/.nvm/versions/node/v8.11.1/bin/stylelint
    - configuration file: Found at "/Users/edbury/some/path/.stylelintrc.json"

  sass/scss-sass-lint
    - may enable:         Automatically disabled!
    - executable:         Not found
    - configuration file: Not found

  scss
    - may enable: Automatically disabled!
    - executable: Not found

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20190213.1525)
Emacs version:    26.1
System:           x86_64-apple-darwin17.5.0
Window system:    ns

So everything is configured correctly and it's ready to enable. Great! However, when I use SPC u C-c ! x to enable checkers, the only one that shows up in the list is scss-lint.

Since your input must match a list item, I can't enable scss-stylelint via this method.

I thought that my list of flycheck-checkers might be incomplete or something, but describing the variable gives me a complete list that includes the stylelint checker:

flycheck-checkers is a variable defined in ‘flycheck.el’.
Its value is
(d-ldc ada-gnat asciidoctor asciidoc c/c++-clang c/c++-gcc c/c++-cppcheck cfengine chef-foodcritic coffee coffee-coffeelint coq css-csslint css-stylelint cwl d-dmd dockerfile-hadolint emacs-lisp emacs-lisp-checkdoc erlang-rebar3 erlang eruby-erubis fortran-gfortran go-gofmt go-golint go-vet go-build go-test go-errcheck go-unconvert go-megacheck groovy haml handlebars haskell-stack-ghc haskell-ghc haskell-hlint html-tidy javascript-eslint javascript-jshint javascript-standard json-jsonlint json-python-json jsonnet less less-stylelint llvm-llc lua-luacheck lua markdown-markdownlint-cli markdown-mdl nix nix-linter opam perl perl-perlcritic php php-phpmd php-phpcs processing proselint protobuf-protoc pug puppet-parser puppet-lint python-flake8 python-pylint python-pycompile python-mypy r-lintr racket rpm-rpmlint rst-sphinx rst ruby-rubocop ruby-reek ruby-rubylint ruby ruby-jruby rust-cargo rust rust-clippy scala scala-scalastyle scheme-chicken scss-lint scss-stylelint sass/scss-sass-lint sass scss sh-bash sh-posix-dash sh-posix-bash sh-zsh sh-shellcheck slim slim-lint sql-sqlint systemd-analyze tcl-nagelfar tex-chktex tex-lacheck texinfo textlint typescript-tslint verilog-verilator vhdl-ghdl xml-xmlstarlet xml-xmllint yaml-jsyaml yaml-ruby)

Hopefully, I am missing something incredibly simple. Any insight?

Update Using flycheck-select-checker will allow me to manually select scss-stylelint. However, no linting occurs. I do get an error node: No such file or directory [env], which seems odd because flycheck-verify-setup returns the all clear.

Double Update This only happens in the GUI application. Running emacs in -nw resolves the issue; however, in GUI, running M-: (executable-find "node") does return the correct path (which matches flycheck-verify-setup).

Triple Update Even using flycheck-set-checker-executable, the binary can be located and set successfully, but the GUI app still returns the "not found" error.

Context I am using nvm, but the path correctly shows in exec-path. Clearly, flycheck is able to locate the executable, so something else is going on.

4
  • Have you read this paragraph on flycheck's troubleshooting page?
    – nega
    Feb 27, 2019 at 20:50
  • brew install npm && npm install stylelint stylelint-scss and adding ~/node_modules/.bin/stylelint to the path worksforme.
    – nega
    Feb 27, 2019 at 20:51
  • Also worksforme via nvm.
    – nega
    Feb 27, 2019 at 21:09
  • @nega as mentioned above, both executables are installed and flycheck can locate them (evidenced via flycheck-verify-setup), exec-path includes my nvm paths, and M-: (executable-find "node") returns the correct path as well. still nothing.
    – Edbury
    Feb 28, 2019 at 18:51

2 Answers 2

1

After lots of experimentation, I found that (for my setup), I had to skip over exec-path and set PATH directly via:

(setenv "PATH" (format "%s:%s" "/Users/me/.nvm/versions/node/v8.11.1/bin" (getenv "PATH")))

The relevant paths to node were being found in exec-path and M-: (executable-find "node") was working fine, but - without updating PATH directly - flycheck couldn't find the library.

0

In the output of flycheck-verify-setup notice

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

According to your flycheck-verify-setup scss-stylelint is enabled, so it won't be in the list of disabled checkers.

4
  • It "may" be enabled, but is not currently the selected checker. scss and sass/scss-sass-lint similarly do not show up on the list despite being disabled and in flycheck-checkers.
    – Edbury
    Feb 27, 2019 at 18:12
  • What happens when you load up some scss with errors in it?
    – nega
    Feb 27, 2019 at 20:20
  • GUI: I get an error "node: No such file or directory [env]", which seems odd because flycheck-verify-setup returns the all clear. || Terminal: lints code
    – Edbury
    Feb 28, 2019 at 18:38
  • @nega: I have the same problem with python-flake8: it is disabled and cannot be enabled. Spacemacs say C-c ! is undefined, and SPC u is transformed to C-u. There is a note in documentation about SPC u not working, but the workaround suggested does not do the job.
    – Ian
    Mar 3, 2019 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.