Profile cover photo
Profile photo
Νίκος Καλογρίδης
24 followers
24 followers
About
Posts

I was really surprised to find out that the following code works:
```
Object.freeze = function (o) {
return o;
};

var t = Object.freeze({a: 1});
t.a = 2;
console.log(t); // prints {a: 2}
```
that appears to work on browsers and also node. Using "use strict"; makes no difference and not even export/import statements (which supposedly switch to ES2015) produce an error.
That means that any false sense of safety by using Object.freeze or any other native function is incorrect.
Is there a way to fix this? Apart for making sure that your script runs before any other malicious scripts and that it does something like:
```
Object = Object.freeze(Object)
```

Can we please include the FileReader global variable when the "browser" switch is enabled?

Post has attachment
For anyone using node or a node based build system, I have created a node wrapper for jslint with the following features:

- Fetches and uses the latest version of JSLint from its github repository
- Supports file/directory watching
- Command line support
- Glob pattern matching files

** Update 30/05/2018: now supports latest version of JSLint using es6 modules

var t = "test";
var m = {
[t]: "me"
};

jslint complains with Expected an identifier and instead saw '['. I guess this is a bug?

what would be the suggested way of using the window global variable in an es6 module? JSLint does not like the global directive when using modules but how can I reference the window object?

Passing the following code through jslint:

/*jslint es6 */

import {div} from "@cycle/dom";
import xs from "xstream";

export function App() {
const vtree$ = xs.of(
div("Hello world!")
);
const sinks = {
DOM: vtree$
};
return sinks;
}

returns the following errors:

Unused 'vtree$'.
const vtree$ = xs.of(
Unused 'sinks'.
const sinks = {
Undeclared 'vtree$'.
DOM: vtree$
Undeclared 'sinks'.
return sinks;

Am I missing something?

JSLint used to warn on usage of parseInt without the radix parameter. Is that now deprecated?

Bad module name. The following line produces an error on JSLint:

/*jslint es6 */
import Cycle from '@cycle/core';

-> Bad module name '@cycle/core'

npm uses the @ sign for name spacing modules which I think is a good idea, name spacing of modules, for the @ I am not so sure. Any chance of accepting this in JSLint?

Destructuring on import statements. Is there a reason that jslint does not like the following:

/*jslint es6 */
import {a, b} from 'module';

Expected an identifier and instead saw '{'.

/*jslint
browser
*/
/*global
google
*/
(function () {
'use strict';
return new google.maps.places.Autocomplete();
}());

jslint complains with:
Expected 'new' before '.'.
return new google.maps.places.Autocomplete();

if I remove the ".places" part of the statement it seems to not produce that error. Am I missing something or is this a bug?
Wait while more posts are being loaded