-
Notifications
You must be signed in to change notification settings - Fork 100
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
Please support the new "fudge" option in JSLint #135
Comments
Yeah, that's a bit annoying because it works in JSLint web interface but when you open Developer tools and pass a JavaScript source to the |
BTW, the file |
Douglas doesn't come 'round here, this is the node-based repackaging of jslint. I can take a look at this in the next day or so, thanks for bringing it up. |
After taking a quick look at things, the jslint.js script doesn't fudge the line/col values. Instead, it's the report.js file that provides the on-screen report and uses the data.option.fudge value to apply any needed fudging. Line 37 of report.js:
|
I have found good success by editing Add a fudge variable to the
Update the terse output
Update the normal output
And that is all that needs to be done to Now the node version of jslint will change its output based on a command-line option, or a jslint directive. The only other change to make if you want this to be permanent, is to update the SublimeLinter user settings so that when you use the latest or es6 edition, you also include the fudge argument.
And job's done. The report will now update it's output based on a command-line option, a settings file, or a jslint directive at the top of the code. |
Now supported - merged PR #150. Thanks for the PR, sorry about the delay. |
The new JSLint seems to default to 0-based indexing of row/column numbers, which creates problems when trying to map reported errors to text editors which usually use 1-based numbering (see devdoc/SublimeLinter-jslint#5). JSLint seems to include a new option called "fudge" that can be used to revert to 1-based numbers in its reports, but this option does not seem to work with node-jslint. This seems to happen even if the fudge option is included in the Javascript file to be linted as an inline option (
/*jslint fudge: true */
) which makes me wonder whether there is a bug in JSLint itself. The inline directive does seem to work on jslint.com, though.The text was updated successfully, but these errors were encountered: