musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Major: Deprecate and remove JSHint #78

Closed iccir closed 8 years ago

iccir commented 8 years ago

JSHint is slow and duplicates many warnings found by the typechecker. Options related to code formatting are either going away ("JSHint is limiting its scope to issues of code correctness." in the options reference) or have already been turned off by ojc.

For the remaining options, I'd rather add more --warn-* options to ojc or add generic hooks to run external linting tools.

The oj 1.2 README mentions the deprecation. I'd like to officially remove it in oj 2.0.

iccir commented 8 years ago

The following options are deprecated by jshint: camelcase, enforceall, immed, indent, noempty, quotmark, sub, globalstrict, laxbreak, laxcomma, multistr, newcap

The following options can't be used due to oj code generation: es3, es5, esversion, esnext: oj always targets ES5 max*, eqeqeq, varstmt, nocomma, asi, eqnull - Causes false positives with oj generated code lastsemic - tied to asi

The following options are duplicated by the typechecker: Environments, freeze, predef, globals, undef, proto, with funcscope - typechecker warns when let is used rather than var

The following options weren't on by default (in oj 1.x) and had to be explicitly enabled: bitwise, curly, forin, futurehostile, latedef, noarg, nonbsp, nonew, notypeof, singleGroups, plusplus, moz, shadow

These options were on and did warn in oj 1.x: boss, debug, elision, evil, expr, loopfunc, noyield, scripturl, strict, supernew, unused, validthis

iccir commented 8 years ago

Adding warn-debugger to replace debug and warn-empty-array-element to replace elision, as they are both low-hanging fruit.

79 is the upgrade path for all others. It works well with both ESLint and JSHint.

iccir commented 8 years ago

On 2.0 branch.