Changelog
Version 2.3.1 (10-14-2015):
A bunch of bug fixes in this release!
We are probably going to start 3.0 for the next release (mainly integrating CST into JSCS). If you want to know more about CST check out the previous changelog.
Our current plan is to move our 3.0/cst branch to master and then create a 2.x branch to continue to release bug fixes / contributer PRs. The core team will be mainly focused on tackling issues on our 3.0 roadmap (which we are still planning). We would love to hear your feedback on what you think should be in 3.0 and beyond!
disallowMultipleVarDecl
- improve {"allExcept": ["require"]}
logic (ValYouW)// Allow MemberExpressions: require('a').b.c;
var fs = require('fs');
var Emitter = require('events').EventEmitter;
disallowSpaceAfterObjectKeys
- Allow no space after key with align
option. (Andrey Ermakov)// this should be allowed
var f = {
"name": 1,
"x": 2
};
disallowUnusedParams
- correctly output unused param name (Oleg Gaidarenko)// Should output:
// Param unusedParam is not used at input
var a = function(unusedParam) {}
requireDollarBeforejQueryAssignment
- validate all keys (Brian Dixon)// check all keys
var x = {
bar: 1,
foo: $(".foo") // error here
};
requireDollarBeforejQueryAssignment
- Ignore array
destructuring (Simen Bekkhus)// Don't error with this
const [beep, boop] = meep;
var $s = $("#id")
CLI
- "auto-configure" argument should always be at the end
(Oleg Gaidarenko)// correct autoconfigure args
jscs --autoconfigure ./files/here
js-file
- make parser not confuse token types (Oleg Gaidarenko)// Fixes issues with keywords like with
class A {
catch() {}
}
Again, a big thanks to everything using JSCS! Definitely continue to report any bugs and new ideas! We always appreciate any help/PRs!
We'll probably be moving more of the new rule/option issues to orphaned
which just means that they are on hold but anyone can still PR it or reopen it later. Remember to tweet at us at @jscs_dev and chat with us on our gitter room!
hzoo
Changelog
Version 2.3.0 (10-07-2015):
A quick update! A few more rules, preset updates, and bug fixes!
If anyone missed it from the previous minor release, we've been working on https://github.com/cst/cst. This will help us continue to autofix more complex rules in the future. If you want to know more about it check out the changelog.
Now that we're done implementing all of ES6 the next major thing we'll be working on is intergrating CST into JSCS.
Changelog
Version 2.2.0 (09-28-2015):
Again, it's been way too long since the last version; we're going to be releasing more often in the future!
In this release, we have a nicer homepage, 5 new rules, 4 more autofixable rules, many new rule options/bug fixes, and a jscs-jsdoc@1.2.0 update.
We also added support for using YAML in config files, checking JS style in HTML files, and are trying out some non-stylistic rules (like disallowUnusedParams
)!
Be on the look out for https://github.com/cst/cst (just finished ES6 support this weekend) if you haven't already.
Thanks to @markelog, we also have autofix support for the following rules:
We will also be labeling which rules don't support autofixing (only a few).
We weren't even thinking about different config formats, but @ronkorving stepped in and added support for using YAML as a config format!
So now you can use a .jscsrc / jscs.json
(JSON) file or a .jscs.yaml
(YAML) file.
@lahmatiy has landed support for linting javascript in HTML files with the extract option! Thanks so much for sticking with us for that PR.
Example usage:
jscs ./hello.html --extract *.html
Changelog
Version 2.1.1
This release consists mostly of bug-fixes. Check them out – there are a lot of them!
We also managed to squeeze two new rules - requireSpacesInsideParenthesizedExpression and disallowSpacesInsideParenthesizedExpression, increase performance, and improve ES6 support.
One of the biggest issues fixed: a global jscs install can finally load local extensions (à la gulp style) like error-filters, plugins, additional rules, and presets.
This will fix issues with using a custom preset with something like SublimeLinter which uses the global jscs install.
jscs-preset-
or with jscs-config-
to help with searching for presets on npm and defining it in your config”preset”: “awesome”
instead of ”preset”: “jscs-preset-awesome”
”preset”: “awesome/super-awesome”
, provided that you have super-awesome.{json, js}
in your package root directoryjscs.json
file to store your jscs configpackage.json
, set the main
field to jscs.json
// example package.json in `jscs-config-awesome`
{
“name”: “jscs-config-awesome”,
“version”: “1.0.0”,
“main”: “jscs.json”
}
// example .jscsrc using a custom preset
// assuming the preset package name is `jscs-config-awesome`
{
“preset”: “awesome”,
“disallowEmptyBlocks”: false // example of disabling a preset rule with false
}
We will add more comprehensive documentation for this feature a bit later, so stay tuned.
false
or null
You can use false
(instead of only null
) to disable a rule (such as in a preset). This was a point of confusion for newer users. To disable a rule you can do:
{
“preset”: “airbnb”,
“disallowEmptyBlocks”: null // disabling a rule with null
“disallowSpacesInCallExpression”: false // disabling a rule with false
}
for..of
statements (regseb)Changelog
Version 2.1.0
In this release, we added three more rules: two of them are ES6-only, they "protect" you from the downside of arrow functions (see 1 and 2 for an explanation of why you might want to enable them) and another universal one if you like to keep your object neat and tidy.
Airbnb, jQuery, and Wordpress presets are now using some of the new rules we added in the previous release. Whereas, the wikimedia preset is now less strict for JSDoc comments.
This release also includes a JSON reporter, lots of bug fixes and enhancements, plus couple new rule values for your linting pleasure.
node_modules
dir in travis CI (Oleg Gaidarenko)Changelog
Version 2.0.0
Gosh! We haven’t released a new version in more than two months! What have we done all this time? Well, we were working hard on the next big step - 2.0!
And we’re finally ready to show it to you. We’ve improved JSCS all over the place!
esnext
It was a big pain to check ES6/JSX code with JSCS, since you had to install special extensions or different parsers. Well, no more of that! Thanks to all the hard work of the @hzoo, now you can just write "esnext": true
in your config or execute JSCS from the CLI with the --esnext
flag.
Now all that new fancy code will be examined without any hassle, as decorators, function bind (::) operator, and all valid babel code can be checked by JSCS.
We also added seven ES6-only rules; see below for more information.
We really want to support autofixing for as many rules as possible. But as it turns out, we are at forefront of this problem; it’s really hard to change the code without affecting unrelated instructions.
What we need is a Concrete Syntax Tree, instead of the AST + tokens structures that we use now. Unfortunately, there is no CST standard for JavaScript at the moment – this is why we decided to step up and come up with our vision of a CST - https://github.com/mdevils/cst. Currently, we are working with the estree team on this proposal – hoping the development of this crucial part of JavaScript parsing will move faster.
Meanwhile, using some workarounds and hacks, we managed to support autofixing for 4 more rules:
There are 31 new rules, including 16 rules for JSDoc validation, and 7 ES6-only rules:
var
declaration to be on the top of an enclosing scopeparseInt
..apply
in favor of the spread operatorThere are also a lot of new rule values (see the "Changelog" section) which makes a lot of rules more flexible.
We also added new rules and values to some presets. If you feel that we’ve missed something, don't be quiet! Send us a PR and we will surely add the needed rules to your favorite preset.
Since every possible JSCS extension can now be loaded without defining its full path, it is enough to just specify the needed dependency to your project so it can be found by JSCS.
{
"plugins": ["./your-local-package"], // Same with `additionalRules` and `preset` options
"plugins": ["jscs-your-npm-package"],
"plugins": ["your-npm-package"], // can omit “jscs-” prefix if you want
}
if (x) y(); // jscs:ignore requireCurlyBraces
if (z) a(); // will show the error with `requireCurlyBraces`
Two new reporters - summary
(could be very helpful to acquire full overview of all possible errors in your project) and unix
. You could enable them by providing --reporter=<reporter name>
flag.
node_modules
path is included by default to excludeFiles
For every possible error, like missing or corrupted config, JSCS now provides different exit-codes. We believe it might be useful for piping, editors plugins, etc.
JSCS (like any good unix program) now obeys the rule of silence.
And of course, a lot of bug-fixes, improved ES6 support of existing rules, docs, infrastructure changes, etc.
Although this is major version, we didn't remove deprecated rule values or changed config format, we expecting to do this in the 3.0 version while switching to CST and fully refactor JSCS code-base.
Backward incompatible changes
node_modules/
by default (Louis Pilfold)Autofix
Preset
New rules
New rule values
Enhancements for ES6 support
Inline control
New reporters
Bug fixes
Docs
true
value description (Adrian Heine né Lang)Misc
Changelog
Version 1.13.1
Small update for fix distribution of the --esnext
CLI option (#1321)