owner

I am doing the first rewrite of JSLint since the project began in 2001. It is not finished yet, but it is stable enough that you can start poking at it. I have significantly changed the way options work. There are far fewer of them, and they work at file granularity, not block as before. I have moved this and for to the endangered list as we are now able to better embrace the functional paradigm. I haven't figured out what to do with arguments yet.

This rewrite was motivated by ES6. The old version was designed for ES3. New features like megastring literals and farts are a challenge to the old framework.

I expect the new version is way too strict in some ways, and way too lenient in others. It will take some time to get the balance right.

The things I am looking for right now are crashes: texts that JSLint is unable to complete.﻿

I want to underline all of a span except the first letter. I put a decoration on the span, and put a decoration of none on the ::first-letter. But that doesn't work because none does not remove the underline, it only doesn't add any additional decoration.

That is the problem I identified at the very beginning of this topic. I was looking for confirmation of my reading that CSS in its current form is broken. I was hoping that I was missing something, but it seems now that I wasn't. Thank you.﻿

JavaScript's RegExp constructor takes a string and returns a regular expression object. It is really difficult to use. Regular expressions are difficult to write because the notation is so terse and all mushed together. Writing regular expressions with string literals is even harder because of the need to double the backslashes and escape the quotes. It was recommend that you always use regular expression literals instead.

ES6 introduces a new string literal, the unfortunately named template string. It wraps a string in ` characters, allows it to span several lines, and avoids escapement. This turns out to be really helpful when composing regular expressions.

For example, make a little helper function that wraps RegExp while automatically deleting whitespace.

Regular expressions are still cryptic and bizarre, and I hope that someday we get a notation that is more reasonable, like the Rebol parse dialect. But until then, template strings are a huge improvement.﻿

Read moreShow less

77

15

Add a comment...

Communities

Douglas Crockford. Douglas Crockford is an American computer programmer and entrepreneur who is best known for his ongoing involvement in the development of the JavaScript language and for having popularized the data format JSON.

On the programming side, I was having some issues with how Squirrel handled classes, so I ditched the notion of rooms being classes and just made them simple tables/dictionaries. It works a lot better since I don't really need full-on classes for the rooms...

It could be argued you might want to create a base room class and derive from that, especially in the case of generic rooms like the forest in Monkey Island and the hotel in Thimbleweed Park, but endless class deriving and polymorphism is a pit of pain and eye poking. Object oriented programing (or OOP we pros call it) can make you feel very clever, but sometimes it feels like it's being used just because it makes you feel very clever.﻿

There is no UI for the character switching, and we don't know exactly how we're going to do it yet, but it's completely functional. Maniac Mansion had a New Kid verb that displayed a list of the kids that you would then click on to switch. We don't have the space for another verb, ...

There are two letters that have been allowed in number literals, E and X. Should they be written in upper case or lower case? There doesn't seem to be any good argument to support either case.

ES6 gives us an answer. ES6 introduces two new letters, B and O, which are used to indicate binary and octal, respectively. O is obviously a terrible choice because it looks like zero. This badness is mitigated by using the lower case o.

So in number literals, lower case letters should be used: b, e, o, x.﻿