Brackets-InteractiveLinter
Brackets-InteractiveLinter copied to clipboard
Some of the "more information links" are busted
Not sure what you can do about it.
if (a) b = 1;
Has a "more info" link that points to: http://jslinterrors.com/expected-a-and-instead-saw-b
Which is missing.
The missing page isn't a big deal -- most of the other errors seem to work but there are still a few broken ones.
@JeffryBooher Yeah man, I know. :/ Its really hard to verify every error that jshint/jslint can generate. If you happen to have which ones don't work, I will be happy to take those and help the author of the jslinterror page fix them.
@MiguelCastillo Do we know where the URLs for jslinterrors.com come from? If we could figure that out, I could write a nodejs script to iterate over them and check the HTTP status code of each.
Never mind, found it, at least for JSHint: https://github.com/MiguelCastillo/Brackets-InteractiveLinter/blob/master/plugins/jshint/groomer.js#L218
Weird! I just responded to this with the locations for jshint and jslint. Somehow its not here... Maybe I didn't press the comment button :/ Glad you found it.
Okay, I've created a script for JSHint errors - it goes through each error and checks if it is on jslinterrors.com.. here are my initial results for URLs that return a 404 header: where (error code: URL checked)
E001: http://jslinterrors.com/bad-option:-a
E002: http://jslinterrors.com/bad-option-value
E003: http://jslinterrors.com/expected-a-json-value
E004: http://jslinterrors.com/input-is-neither-a-string-nor-an-array-of-strings
E005: http://jslinterrors.com/input-is-empty
E008: http://jslinterrors.com/strict-violation
E006: http://jslinterrors.com/unexpected-early-end-of-program
E007: http://jslinterrors.com/missing-"use-strict"-statement
E012: http://jslinterrors.com/const-a-is-initialized-to-undefined
E014: http://jslinterrors.com/a-regular-expression-literal-can-be-confused-with-/=
E016: http://jslinterrors.com/invalid-regular-expression
E018: http://jslinterrors.com/unbegun-comment
E019: http://jslinterrors.com/unmatched-a
E021: http://jslinterrors.com/expected-a-and-instead-saw-b
E020: http://jslinterrors.com/expected-a-to-match-b-from-line-c-and-instead-saw-d
E022: http://jslinterrors.com/line-breaking-error-a
E027: http://jslinterrors.com/missing-]-to-match-[-from-line-a
E026: http://jslinterrors.com/missing--to-match--from-line-a
E023: http://jslinterrors.com/missing-a
E025: http://jslinterrors.com/missing-:-on-a-case-clause
E024: http://jslinterrors.com/unexpected-a
E028: http://jslinterrors.com/illegal-comma
E032: http://jslinterrors.com/expected-a-small-integer-or-false-and-instead-saw-a
E030: http://jslinterrors.com/expected-an-identifier-and-instead-saw-a
E033: http://jslinterrors.com/expected-an-operator-and-instead-saw-a
E034: http://jslinterrors.com/get/set-are-es5-features
E039: http://jslinterrors.com/function-declarations-are-not-invocable.-wrap-the-whole-function-invocation-in-parens
E035: http://jslinterrors.com/missing-property-name
E036: http://jslinterrors.com/expected-to-see-a-statement-and-instead-saw-a-block
E040: http://jslinterrors.com/each-value-should-have-its-own-case-label
E041: http://jslinterrors.com/unrecoverable-syntax-error
E043: http://jslinterrors.com/too-many-errors
E045: http://jslinterrors.com/invalid-for-each-loop
E046: http://jslinterrors.com/a-yield-statement-shall-be-within-a-generator-function-(with-syntax:-`function*`)
E048: http://jslinterrors.com/let-declaration-not-directly-within-block
E049: http://jslinterrors.com/a-a-cannot-be-named-b
E050: http://jslinterrors.com/mozilla-requires-the-yield-expression-to-be-parenthesized-here
E052: http://jslinterrors.com/unclosed-template-literal
E051: http://jslinterrors.com/regular-parameters-cannot-come-after-default-parameters
W002: http://jslinterrors.com/value-of-a-may-be-overwritten-in-ie-8-and-earlier
W008: http://jslinterrors.com/a-leading-decimal-point-can-be-confused-with-a-dot:-a
W009: http://jslinterrors.com/the-array-literal-notation-[]-is-preferable
W010: http://jslinterrors.com/the-object-literal-notation--is-preferable
W014: http://jslinterrors.com/bad-line-breaking-before-a
W016: http://jslinterrors.com/unexpected-use-of-a
W018: http://jslinterrors.com/confusing-use-of-a
W021: http://jslinterrors.com/a-is-a-function
W017: http://jslinterrors.com/bad-operand
W023: http://jslinterrors.com/expected-an-identifier-in-an-assignment-and-instead-saw-a-function-invocation
W026: http://jslinterrors.com/inner-functions-should-be-listed-at-the-top-of-the-outer-function
W024: http://jslinterrors.com/expected-an-identifier-and-instead-saw-a-(a-reserved-word)
W027: http://jslinterrors.com/unreachable-a-after-b
W028: http://jslinterrors.com/label-a-on-b-statement
W030: http://jslinterrors.com/expected-an-assignment-or-function-call-and-instead-saw-an-expression
W033: http://jslinterrors.com/missing-semicolon
W036: http://jslinterrors.com/unexpected-/*member-a
W034: http://jslinterrors.com/unnecessary-directive-"a"
W035: http://jslinterrors.com/empty-block
W039: http://jslinterrors.com/a-is-not-allowed
W041: http://jslinterrors.com/use-a-to-compare-with-b
W043: http://jslinterrors.com/bad-escaping-of-eol.-use-option-multistr-if-needed
W040: http://jslinterrors.com/possible-strict-violation
W042: http://jslinterrors.com/avoid-eol-escaping
W045: http://jslinterrors.com/bad-number-a
W046: http://jslinterrors.com/dont-use-extra-leading-zeros-a
W044: http://jslinterrors.com/bad-or-unnecessary-escaping
W047: http://jslinterrors.com/a-trailing-decimal-point-can-be-confused-with-a-dot:-a
W048: http://jslinterrors.com/unexpected-control-character-in-regular-expression
W049: http://jslinterrors.com/unexpected-escaped-character-a-in-regular-expression
W050: http://jslinterrors.com/javascript-url
W052: http://jslinterrors.com/unexpected-a
W057: http://jslinterrors.com/weird-construction.-is-new-necessary?
W059: http://jslinterrors.com/avoid-arguments.a
W058: http://jslinterrors.com/missing-()-invoking-a-constructor
W060: http://jslinterrors.com/document.write-can-be-a-form-of-eval
W063: http://jslinterrors.com/math-is-not-a-function
W064: http://jslinterrors.com/missing-new-prefix-when-invoking-a-constructor
W062: http://jslinterrors.com/wrap-an-immediate-function-invocation-in-parens-to-assist-the-reader-in-understanding-that-the-expression-is-the-result-of-a-function,-and-not-the-function-itself
W066: http://jslinterrors.com/implied-eval.-consider-passing-a-function-instead-of-a-string
W068: http://jslinterrors.com/wrapping-non-iife-function-literals-in-parens-is-unnecessary
W067: http://jslinterrors.com/bad-invocation
W069: http://jslinterrors.com/[a]-is-better-written-in-dot-notation
W070: http://jslinterrors.com/extra-comma.-(it-breaks-older-versions-of-ie)
W071: http://jslinterrors.com/this-function-has-too-many-statements.-(a)
W074: http://jslinterrors.com/this-functions-cyclomatic-complexity-is-too-high.-(a)
W073: http://jslinterrors.com/blocks-are-nested-too-deeply.-(a)
W072: http://jslinterrors.com/this-function-has-too-many-parameters.-(a)
W078: http://jslinterrors.com/setter-is-defined-without-getter
W077: http://jslinterrors.com/expected-a-single-parameter-in-set-a-function
W082: http://jslinterrors.com/function-declarations-should-not-be-placed-in-blocks.-use-a-function-expression-or-move-the-statement-to-the-top-of-the-outer-function
W086: http://jslinterrors.com/expected-a-break-statement-before-a
W084: http://jslinterrors.com/expected-a-conditional-expression-and-instead-saw-an-assignment
W088: http://jslinterrors.com/creating-global-for-variable.-should-be-for-(var-a-...
W089: http://jslinterrors.com/the-body-of-a-for-in-should-be-wrapped-in-an-if-statement-to-filter-unwanted-properties-from-the-prototype
W091: http://jslinterrors.com/a-is-out-of-scope
W093: http://jslinterrors.com/did-you-mean-to-return-a-conditional-instead-of-an-assignment?
W094: http://jslinterrors.com/unexpected-comma
W097: http://jslinterrors.com/use-the-function-form-of-"use-strict"
W096: http://jslinterrors.com/the-a-key-may-produce-unexpected-results
W103: http://jslinterrors.com/the-a-property-is-deprecated
W104: http://jslinterrors.com/a-is-available-in-es6-(use-esnext-option)-or-mozilla-js-extensions-(use-moz)
W101: http://jslinterrors.com/line-is-too-long
W105: http://jslinterrors.com/unexpected-a-in-b
W100: http://jslinterrors.com/this-character-may-get-silently-deleted-by-one-or-more-browsers
W106: http://jslinterrors.com/identifier-a-is-not-in-camel-case
W107: http://jslinterrors.com/script-url
W113: http://jslinterrors.com/control-character-in-string:-a
W114: http://jslinterrors.com/avoid-a
W116: http://jslinterrors.com/expected-a-and-instead-saw-b
W119: http://jslinterrors.com/a-is-only-available-in-es6-(use-esnext-option)
W118: http://jslinterrors.com/a-is-only-available-in-mozilla-javascript-extensions-(use-moz-option)
W120: http://jslinterrors.com/you-might-be-leaking-a-variable-(a)-here
W121: http://jslinterrors.com/extending-prototype-of-native-object:-a
W123: http://jslinterrors.com/a-is-already-defined-in-outer-scope
W124: http://jslinterrors.com/a-generator-function-shall-contain-a-yield-statement
W125: http://jslinterrors.com/this-line-contains-non-breaking-spaces:-http://jshint.com/doc/options/#nonbsp
Nice work, @Mark-Simulacrum! We may need to url encode those before they are written as links. We would have to test before making the change though. There are some characters that will cause problems like
W036: http://jslinterrors.com/unexpected-/*member-a W034: http://jslinterrors.com/unnecessary-directive-"a"
I can help log other legit 404 here https://github.com/jamesallardice/jslint-error-explanations
I've published my checker here: https://github.com/Mark-Simulacrum/InteractiveLinter-URL-Checker and added you (@MiguelCastillo) as a collaborator. Currently, I've change the existing fixer for JSHint from:
message = message
.replace(/'*\{*(\w*)\}*'*/g, "$1")
.replace(/\s/g, '-')
.replace(/\.$/, '')
.toLowerCase();
to
message = message
.replace(/'*\{*(\w*)\}*'*/g, "$1")
.replace(/\s/g, '-')
.replace(/\..*?$/, '')
.replace(/['"]/g, '')
.replace(/\/=/, '')
.replace(/\(\)/, '')
.replace(/\//g, '-')
.replace(/--/g, '-')
.toLowerCase();
Really cool, Mark! Do the changes in the regex fix the issues reported in your tester?
Not all of the issues are fixed - but the amount has been lowered from 116 to 104. Most of the errors left are either undocumented or not (correctly) fixable using regex - some of the messages simply need the URL to be different (whole words need changing).
I've pushed the current output to the repo (https://github.com/Mark-Simulacrum/InteractiveLinter-URL-Checker/blob/master/output), but I'll be moving it to a wiki page so that we can add notes easily to it.
Here is the wiki page, please add any comments that you find. I'll be working on a way to have the process create a wiki page -- with comments -- if at all possible.
https://github.com/Mark-Simulacrum/InteractiveLinter-URL-Checker/wiki/Output-@-1991a3daf5b217ca63cc497e11164623c3f602ec
I've found a promising feature of jslinterrors.com: It seems that http://jslinterrors.com/a-is-already-defined
and http://jslinterrors.com/W004
point to the same page, which would allow us to remove the replacement and simply use the error type and code for redirection.
Oh man, if the error code can used, then we are all set! But even if it is not available, we could log an issue in the jslinterrors project to see if they can the links available by error code
I've gone through some (5-10) error codes, and they all seem to work.
@Mark-Simulacrum thanks for checking! Somehow this one has taken a bit of a backseat... Maybe it is worth testing the links again. I will take a look this weekend, or if you want to take this one all the way to the finish line, dont let me stop you :)
Missing semicolon. - W033 - Details http://jslinterrors.com/missing-semicolon
busted. there is no code w033 anymore it seems
Also ran https://github.com/Mark-Simulacrum/InteractiveLinter-URL-Checker lots of 404s