Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than 100% scanned #164

Open
alkuzad opened this issue Oct 21, 2017 · 2 comments
Open

More than 100% scanned #164

alkuzad opened this issue Oct 21, 2017 · 2 comments

Comments

@alkuzad
Copy link

alkuzad commented Oct 21, 2017

Input file:

function printUrl(e) {
  console.log(e.url);
}

try{
  browser.webRequest.onHeadersReceived.addListener(
    printUrl,
    {urls: ["<all_urls>"]},
    ["blocking", "responseHeaders"]
  )


// catch(err){
//   console.warn(err);
// }

Command: jslint --terse ddg_evernote.js (terse just to make this output smaller for example)

Output:

ddg_evernote.js:2:3: Missing 'use strict' statement.
ddg_evernote.js:5:4: Expected exactly one space between 'try' and '{'.
ddg_evernote.js:6:3: Expected 'browser' at column 5, not column 3.
ddg_evernote.js:7:5: Expected 'printUrl' at column 9, not column 5.
ddg_evernote.js:8:5: Expected '{' at column 9, not column 5.
ddg_evernote.js:9:5: Expected '[' at column 9, not column 5.
ddg_evernote.js:10:3: Expected ')' at column 5, not column 3.
ddg_evernote.js:10:4: Expected ';' and instead saw '(end)'.
ddg_evernote.js:16:1: Expected '}' to match '{' from line 5 and instead saw '(end)'.
ddg_evernote.js:17:1: Expected 'catch' and instead saw '(end)'.
ddg_evernote.js:17:1: Stopping. (113% scanned).

There is obviously no lines 16 and 17 in this file.

node-jslint version: 0.11.0 JSLint edition 2013-08-26

@smikes
Copy link
Collaborator

smikes commented Feb 3, 2018

edition 2013-08-26 is pretty old; it's only the default for backward compatibility.

You probably want to run with --edition=latest (for the latest es5) or --edition=es6 (for the es6 rewrite).

However, you will still see references past the end of the file:

Svarog:fixtures smikes$ ../../bin/jslint.js issue164.js --edition=es6 --terse
issue164.js:9:3: Expected ';' and instead saw '(end)'.
issue164.js:16:0: Expected '}' and instead saw '(end)'.

That would require a change to the core jslint module, which is maintained separately, here: https://plus.google.com/communities/104441363299760713736
(This particular repo is just for the command-line wrapper).

@smikes
Copy link
Collaborator

smikes commented Jan 29, 2019

Still broken with latest (2018-11-28) jslint from upstream.

smikes added a commit to smikes/node-jslint that referenced this issue Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants