Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

The default plugin Jslint is too old to support new features, such as es6 #12000

Open
Lingcan opened this issue Dec 12, 2015 · 2 comments
Open

Comments

@Lingcan
Copy link

Lingcan commented Dec 12, 2015

Jslint stop scanning while encounter const keyword. So I have to use Douglas Crockford's lastest jslint.js to override the local one at /src/extensions/default/JSLint/thirdparty/jslint/jslint.js and do a little following change on src/extensions/default/JSLint/main.js and it works great.

var jslintResult = jslint(text, options);
if (!jslintResult || jslintResult.ok) {
return null;
}
var errors = jslintResult.warnings.map(function (jslintError) {
return {
pos: { line: jslintError.line, ch: jslintError.column },
message: jslintError.message,
type: CodeInspection.Type.WARNING
};
});
var result = { errors: errors, aborted: false };
if (jslintResult.stop) {
var lastError = {
pos: {
line: jslintResult.warnings[jslintResult.warnings.length - 1].line,
ch: jslintResult.warnings[jslintResult.warnings.length - 1].column
},
message: 'Scanning stopped ...',
type: CodeInspection.Type.META
};
result.aborted = true;
result.errors.push(lastError);
}
return result;

Could anyone help to update the jslint to a newer version ?

Douglas Crockford's code:
https://github.com/douglascrockford/JSLint/blob/master/jslint.js

@petetnt
Copy link
Collaborator

petetnt commented Dec 12, 2015

Brackets is moving to using ESLint as the default linter in 1.6, see #11984 for more info. The status of JSLint is still undecided afaik but PR upgrading JSLint in the core would be appriciated

@ficristo
Copy link
Collaborator

ficristo commented Feb 3, 2016

@peterflynn Could you update the JSLint fork? And since we use the submodule take advantage of it and add an UMD wrapper?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants
@zaggino @abose @petetnt @ficristo @Lingcan @swmitra and others