简体   繁体   中英

jslint error - #1 Expected '(end)' and instead saw '<!'

I am typing in av simple example into sublime text. I have the SublimeLinter and JSLint plugins installed, but am getting the following error:

#1 Expected '(end)' and instead saw '<!'.

The code is a simple HTML file, which may be my problem. I don't know.

The code is as follows:

<!doctype html>
<html>
<head>
    <title></title>
</head>
<body>

</body>
</html>

If it is true that either linting plugin is causing this error what should I do?

The error is generated by JSLint. By default, it runs on files with extensions .js , .json , .html , .sass , and .less . To prevent the error without disabling or removing JSLint, try removing HTML files from this list.

To do this, open JSLint.sublime-settings . Around line 35 you should see the following property.

,"filename_filter": "(\\\\.js|\\\\.json|\\\\.html|\\\\.sass|\\\\.less|\\\\.html)$"

Erase both |\\\\.html entries so that you're left with this.

,"filename_filter": "(\\\\.js|\\\\.json|\\\\.sass|\\\\.less)$"

Save your file. You may need to restart Sublime Text. Also note that you can still run JSLint on an HTML file using the following shortcut.

  • Control + L

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM