sublimelinter安装后不起作用

发布于 2022-09-04 05:18:04 字数 3659 浏览 22 评论 0

如题,系统是 mac os

  1. 我安装了nodejs,并安装了jshint和csslint
npm install jshint
npm install csslint

图片描述

  1. 我在sublime text 3中安装了 sublimelinter
    图片描述

  2. 我在sublime text 3中安装了 jshint 和 csslint
    图片描述

  3. 我修改了 sublimelinter 的配置文件
    图片描述
    配置文件修改结果如下:

{
    "user": {
        "csslint_options": {
            "adjoining-classes": false,
            "box-model": false,
            "box-sizing": false,
            "compatible-vendor-prefixes": false,
            "floats": false,
            "font-sizes": false,
            "gradients": false,
            "important": false,
            "known-properties": false,
            "outline-none": false,
            "qualified-headings": false,
            "regex-selectors": false,
            "shorthand": false,
            "text-indent": false,
            "unique-headings": false,
            "universal-selector": false,
            "unqualified-attributes": false
        },
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "jshint_options": {
            "browser": true,
            "curly": true,
            "devel": true,
            "eqeqeq": true,
            "evil": true,
            "forin": true,
            "globals": {
                "$": true,
                "console": true,
                "document": true,
                "global": true,
                "grunt": true,
                "jQuery": true,
                "module": true,
                "setInterval": true,
                "setTimeout": true,
                "window": true
            },
            "jquery": true,
            "latedef": true,
            "noarg": true,
            "noempty": true,
            "quotmark": "single",
            "strict": false,
            "undef": true,
            "unused": "vars",
            "wsh": true
        },
        "lint_mode": "background",
        "linters": {},
        "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": true,
        "show_marks_in_minimap": true,
        "sublimelinter": "save-only",
        "sublimelinter_executable_map": {
            "css": "/usr/local/bin/node",
            "javascript": "/usr/local/bin/node"
        },
        "sublimelinter_popup_errors_on_save": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

可是,遇到js和css的代码错误,还是不提示。
图片描述

请问,到底哪里还没有配置对?
急等!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

墨落成白 2022-09-11 05:18:04

配置文件中的path一项没有设置jshint在电脑中安装的路径,需要补全,使用: which jshint得到:
/home/path/to/bin/jshint
或windows下使用 where jshint 得到:
C:\Users\Thinkpad\AppData\Roaming\npm
加入后再试试看吧

天赋异禀 2022-09-11 05:18:04

CTRL+` 开启控制台看看日志。

濫情▎り 2022-09-11 05:18:04

怀疑1:npm下没有执行到,你以《管理员》身份进入cmd 查看jslint csslint有木有成功:npm install jshint -g 和jshint -v
2:怀疑你的配置的格式有问题

请远离我 2022-09-11 05:18:04

git里面看到一句话
https://github.com/SublimeLin...

After installing Node.js, if the Node.js executable ("node" on Mac OS X, "node.exe" on Windows) cannot be found by SublimeLinter, you may have to set the path to the executable in the "sublimelinter_executable_map" setting. See the "Configuring" section below for info on SublimeLinter settings.

会不会是你jshint配置的路径有问题呢

"sublimelinter_executable_map": {
    "javascript": "jshint路径,通过which命令查看"
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文