Git Product home page Git Product logo

jslint-error-explanations's People

Contributors

artoale avatar jamesallardice avatar jklein avatar krinkle avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jslint-error-explanations's Issues

Move away from GitHub pages

The use of GitHub pages for hosting the built version of the site is quickly becoming a point of failure when it comes to new features, mainly due to the lack of Jekyll plugin support.

Here are a couple of the features I would like to implement:

  • Aliased URLs for some articles (e.g. /es5 will redirect to a bucket page linking to all related errors, and /asi will link directly to the related message since it only relates to a single message)
  • Expose an API that will allow developers of e.g. IDE plugins to pull in information from the site

Make 404 error page

Actually the current error page delivered by Cloudflare is confusing. It does not only look ugly, but I really thought this would be such a usual error message by Cloudflare saying the webserver is down. But actually, it is not!

So you could prevent such confusing by creating a real 404 error page.

weird condition

Hi, first thanks for this site.
Here's how this happened:
code with the error:

(function () {
  "use strict";
  var array = [1, 2, 3];
  if (!!array.indexOf(2)) {
    console.dir('in array');
  }
}());

After running jslint spits this error:

1 Weird condition.
if (!!array.indexOf(2)) { // Line 6, Pos 22

Changing the code to this fix it:

(function () {
  "use strict";
  var
    array = [1, 2, 3],
    test  = array.indexOf(2);
  if (!!test) {
    console.dir('in array');
  }
}());

Could you make a page about this I still don't know why using the first is a bad practice, or is't just a false error.
Thanks in advance.

Explain JSLint "Unexpected assignment expression."

Explain JSLint "Unexpected assignment expression."

Tolerate assignment expressions: true if assignment should be allowed outside of statement position

ass: true, if assignment expressions should be allowed

jslint-org/jslint@abc0d34

Example:

(function (console, window, HTMLElement) {
    "use strict";

    var children = [];

    var document = window.document;
    var element = document.body;
    while ((element = element.firstElementChild) instanceof HTMLElement) {
        children.push(element);
    }

    console.log(children);
}(this.console, this, this.HTMLElement));

Problem invoking /lint endpoint in API

When invoking the API's /lint request endpoint, I seem to be always getting a 400 error saying:
"Missing parameter: code"

This is despite providing the "code" or "c" as a parameter in a json body to the url as POST or GET request to: http://api.jslinterrors.com/lint and providing "application/json" as the "Content-type" in the header.

{ "c": "var b = 1;" }

OR

{ "code": "var b = 1;" }

Remove CSS-linting-related error messages?

JSLint has an experimental feature to lint CSS files. This mostly covers checking for whitespace-related matters but does also cover some CSS-specific issues that are wholly not relevant to JavaScript.

The list of pages needed includes all errors that could potentially be raised by JSLint, including some that are not relevant to the linting of JavaScript.

As jslinterrors.com is "designed to help you improve your JavaScript", should the focus of the site be purely on JavaScript-related improvement and if so should the CSS-only errors be removed from the list of pages needed?

I suppose this question could be generalised as: should the site cover all possible errors that can be raised by JSLint (and JSHint), or should the site instead focus only on the subset of errors that relate to JavaScript?

Explain "Unexpected '\'."

var json = {"content": "\u003c"};

causes the error: "Unexpected ''."

as does:
{"content": "\u003c"}
which also gives a "bad json" warning.

Logic error in Move the invocation into the parens that contain the function

The article is question: http://jslinterrors.com/move-the-invocation-into-the-parens-that-contain-the-function/

In this sentence in the second paragraph:

This error is raised to highlight a lack of convention. Your code will not run without error if you do not change it, but your code may be confusing to others.

Shouldn't that read:

This error is raised to highlight a lack of convention. Your code will not run without error if you do not change it, but your code may be confusing to others.

It is unclear about which error (jsHint or the JS interpreter) this 'without error' is referring too.

Unexpected '++' in a for loop

Hello,

first of all I want to say that I am really grateful for both JSLint and JSLintErrors projects.

I have a question regarding this classical idiom from the C language:

for (i = 0; i < someArray.length; i++) {
    // do something
}

The JSLint gives me the following error and the reason is not clear to me.

Unexpected '++'.

Why does the JSLint tool discourage the usage of the ++ operator?

Anonymous function wrapper with .call()

The error I am getting is Unexpected '.'.

Can't figure out how to get JSLint to let me do this but everywhere I am told to wrap my files in this (function () { ... }).call(this) and that will pass along the window to the function, but JSLint wants (function () { ... }()).call(this). The problem with the way JSLint wants it done this isn't passed through to the function's this. I don't know if there is a setting to prevent JSLint from caring about the }()) and let me just use the call method.

Add TSLint as hinter

It is a linter for TypeScript, which is as you know a superset of vanilla JS so has most of the same errors (if not more). We meet good-ol' eqeqeq, evil, curly etc.

As of now still early in the project, could be cool later on.

Explain "Unexpected 'typeof"

JSLint:
Unexpected 'typeof'. Use '===' to compare directly with undefined.

Debatable message. undefined is not real keyword and can be easily reassigned. Shouldn't I compare with typeof instead?

Explain Unexpected '1'

When converting a string like '9.59' to a number I have always used the syntax:
var a = '9.59';
a = a * 1;

JSLint seems to find this method odd and destructive. I thought my method was fairly standard and straight forward. It also happens to be the fastest to execute vs any other method like parseInt or parseFloat or Math.floor

Include JsLint Directives that would suppress a particular error?

My suggestion is about adding the kind of directives that would suppress some of the errors - for example, setting /*jslint plusplus: true */ to allow the usage of ++ without getting errors back from JSLint.

I'm thinking for each error -- include a section like "If you don't want to see this JSLint Error" to explain how to suppress, and explanations of the pros and cons of doing so.

Missing Bad Assignment explanation

Hello,
I love this site but I noticed that it lacks an explanation for Bad assignment and how to disable it.

The error is raised in cases like this

callAFunction() = 12;

Thanks

No article for this error: "W040 - Possible strict violation."

I have this error with JSLint: W040 - Possible strict violation.

But i couldn't find an article about this error on the website.

This error happened when you use the strict mode and you want to call a function (to have a private method for example).

For example:

function Foo() {
  this.toto = 42;
  bar.call(this);
}

function bar() {
  console.log(this.toto);
}

'Wrap the parameter in parens.' Error Missing

JSLint provides an error of 'Wrap the parameter in parens.' in some instances. I am having trouble figuring out what the cause of this error is and would appreciate it being included in this project. Sample of the code that produced this error. (The ellipsis marks where the code continues but I've left it out as unnecessary.) The error is triggered on the line, '.on("data", chunk => {'.

response
.on("data", chunk => {
responseBody += chunk;
})
.on("end", chunk => { ...

Building the site locally

I think there is one more step between forking the repository and jekyll, that is checking out 'gh-pages' branch(or other branch, I am not sure which one). because when we fork the repository, the default branch of the repository is master, and what we get after we jekyll on master branch is not a web site. my problem is that I am not sure which branch to check out before I jekyll.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.