xojs / SublimeLinter-contrib-xo

SublimeLinter plugin for XO
https://github.com/xojs/xo
MIT License
55 stars 7 forks source link

Not activating when eslint is also installed #4

Closed dawsbot closed 8 years ago

dawsbot commented 8 years ago

When in Sublime 3, I like to lint code with both eslint and xo (at separate times). Switching between them worked at first by first disabling one and then enabling the other. Suddenly a few weeks ago, xo no longer activates ever.

I have ensured that there are indeed xo errors (using the cli), but in Sublime none of the errors are being registered. Even upon entering the SublimeLinter: Next Error it shows that there are no errors.


Here is the link to the repo I am currently running it with (you can clone it yourself and see since this is a link to the commit in history): https://github.com/dawsonbotsford/safpm/tree/4fce6dc05768e64704a9db9032936144fca09bfa


Here is my SublimeLinter.sublime-settings file contents:

{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "linters": {
            "eslint": {
                "@disable": true,
                "args": [],
                "excludes": []
            },
            "xo": {
                "@disable": false,
                "args": [],
                "excludes": []
            }
        },
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "passive_warnings": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "javascript (babel)": "javascript",
            "magicpython": "python",
            "php": "html",
            "python django": "python",
            "pythonimproved": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}```
sindresorhus commented 8 years ago

Tried your setup and works for me with latest XO. Try upgrading XO.

https://github.com/dawsonbotsford/safpm/blob/873f26d4539dd5799365258e1d14841bdbfa5a79/package.json#L57-L59

This is incorrect. The ESLint config should not be inside the xo property. And you don't use ESLint there either, so no idea why it's there. ?

https://github.com/dawsonbotsford/safpm/blob/873f26d4539dd5799365258e1d14841bdbfa5a79/package.json#L26

This should be simply: "test": "xo && ava"

npm uses the local binaries.

dawsbot commented 8 years ago

With the addition of installing eslint as a dev dependency, this does indeed work. Thank you for the triage. Cheers 🍻