You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
The version of jslint bundled in the default extensions is out of date (id 2347ec4, last updated 2011-12-21), and doesn't report on several types of programming errors. This should be updated to the latest version.
Dropping in the latest master causes a lot of warnings in the Brackets source. I think we should fix them, since they are low hanging fruits (especially the formatting and unused variables statements).
The new JSLint version introduces some linting errors that'd change our code style, for example unnecessary else after disruption.
I'd like to fix those, but I don't know whether we actually want to change the code (maybe accompanied with Coding Conventions changes) or just use a linting flag.
Another thing are the define(function (require, exports, module) { lines, where module isn't used very much, but these lines are consistent in the whole project. JSLint wants to disrupt them (unused variable).
I would be more than happy to make adjustments to the coding style and get these fixed. I'm going to create an overall report and ask the core team/committer about their opinions.
And yes @lkcampbell, me +1 too.
This is almost a dupe of #4462. I made a PR long time ago to update JSLint: #4557. But is totally out of date now. It was closed since the team wanted to switch to JSHint as the default linter for Brackets. When that is done (Brackets provides a default JSHint extension), the JSLint extension could be updated without issues in the Brackets codebase.
The new JSLint version introduces some linting errors that'd change our code style,
for example unnecessary else after disruption. I'd like to fix those, but I don't know
whether we actually want to change the code (maybe accompanied with Coding
Conventions changes) or just use a linting flag.
That can't be fixed with a flag, so we'd have to fix the code (which I think is a good idea). The fix is simple and there doesn't seem to be too many instances of it. Since JSLint will be flagging it as an error, then we probably don't need to mention it in Coding Conventions as a reminder :)
Hold up here. This issue is about upgrading the JSLint dependency in Brackets independent of any coding standards used in the Brackets codebase. There are projects other than Brackets that uses Brackets, after all.
Is the suggestion here that all projects using Brackets must use the old version of JSLint because the Brackets team isn't yet ready to transition their own code to JSHint?
@markmcintyre Even if that might be the case, there is no reason to not create a new JSLint extension with the newest version and start using it instead of the default one. I am not sure why none tried that yet.
I've created a new JSLint extension that adds support for the latest version of JSLint (2014-07-08 as of this writing). For any existing or future followers of this issue, the extension is available here, as well as in the Brackets Extension Registry under the name "JSLint."
@markmcintyre Nice. I just downloaded it and tried. It works nice. What do you think about hacking it a bit so that it does not display errors on lines with only spaces? JSLint in Brackets works like that, so you could copy the code.
I know it would be better if the default JSLint extension was upto date and this wasn't required. But one awesome thing about Brackets is how easy it is to extend it. And since the core team working full time on Brackets is small, this is awesome as it lets the community add some functionality before it gets implemented in the core code, and sometimes that code can then become part of the core.
I've opened a pull request on the repository for the JSLint extension with the changes to ignore lines with only spaces or tabs. Hope it helps streamline the addition of that feature into the updated JSLint extension. (Hope it's alright that I copied the code from Brackets, not sure how that works with the Brackets copyright/licensing.).
Activity
ingorichter commentedon Aug 26, 2014
Dropping in the latest master causes a lot of warnings in the Brackets source. I think we should fix them, since they are low hanging fruits (especially the formatting and unused variables statements).
marcelgerber commentedon Aug 26, 2014
The new JSLint version introduces some linting errors that'd change our code style, for example
unnecessary else after disruption.I'd like to fix those, but I don't know whether we actually want to change the code (maybe accompanied with Coding Conventions changes) or just use a linting flag.
Another thing are the
define(function (require, exports, module) {lines, wheremoduleisn't used very much, but these lines are consistent in the whole project. JSLint wants to disrupt them (unused variable).lkcampbell commentedon Aug 27, 2014
+1 for being able to find unused variables.
ingorichter commentedon Aug 28, 2014
I would be more than happy to make adjustments to the coding style and get these fixed. I'm going to create an overall report and ask the core team/committer about their opinions.
And yes @lkcampbell, me +1 too.
TomMalbran commentedon Aug 28, 2014
This is almost a dupe of #4462. I made a PR long time ago to update JSLint: #4557. But is totally out of date now. It was closed since the team wanted to switch to JSHint as the default linter for Brackets. When that is done (Brackets provides a default JSHint extension), the JSLint extension could be updated without issues in the Brackets codebase.
redmunds commentedon Aug 31, 2014
We're considering making this update for the Promises Upgrade feature (trello/waffle), so I started a randy/jslint-update branch.
redmunds commentedon Aug 31, 2014
@marcelgerber
That can't be fixed with a flag, so we'd have to fix the code (which I think is a good idea). The fix is simple and there doesn't seem to be too many instances of it. Since JSLint will be flagging it as an error, then we probably don't need to mention it in Coding Conventions as a reminder :)
dangoor commentedon Sep 3, 2014
Our current plan is to use JSHint and we'd welcome any help in that direction.
markmcintyre commentedon Sep 3, 2014
Hold up here. This issue is about upgrading the JSLint dependency in Brackets independent of any coding standards used in the Brackets codebase. There are projects other than Brackets that uses Brackets, after all.
Is the suggestion here that all projects using Brackets must use the old version of JSLint because the Brackets team isn't yet ready to transition their own code to JSHint?
TomMalbran commentedon Sep 3, 2014
@markmcintyre Even if that might be the case, there is no reason to not create a new JSLint extension with the newest version and start using it instead of the default one. I am not sure why none tried that yet.
markmcintyre commentedon Sep 3, 2014
Ah, I understand. Thanks, @TomMalbran.
Since no one else has tried it yet, I'm tempted to give it a go myself.
markmcintyre commentedon Sep 4, 2014
I've created a new JSLint extension that adds support for the latest version of JSLint (2014-07-08 as of this writing). For any existing or future followers of this issue, the extension is available here, as well as in the Brackets Extension Registry under the name "JSLint."
TomMalbran commentedon Sep 4, 2014
@markmcintyre Nice. I just downloaded it and tried. It works nice. What do you think about hacking it a bit so that it does not display errors on lines with only spaces? JSLint in Brackets works like that, so you could copy the code.
I know it would be better if the default JSLint extension was upto date and this wasn't required. But one awesome thing about Brackets is how easy it is to extend it. And since the core team working full time on Brackets is small, this is awesome as it lets the community add some functionality before it gets implemented in the core code, and sometimes that code can then become part of the core.
Mark-Simulacrum commentedon Sep 4, 2014
I've opened a pull request on the repository for the JSLint extension with the changes to ignore lines with only spaces or tabs. Hope it helps streamline the addition of that feature into the updated JSLint extension. (Hope it's alright that I copied the code from Brackets, not sure how that works with the Brackets copyright/licensing.).
TomMalbran commentedon Sep 4, 2014
Great. Thanks. Brackets is licensed as MIT, so I think that you can do almost anything with the code.