:arrow_heading_up: JavaScript Code Style checker (unmaintained)
Fixed some bugs, correctly output CST errors plus improve speed and memory consumption
.only
call (Oleg Gaidarenko)validateQuoteMarks
of position calc (Oleg Gaidarenko)line
and column
properties (Oleg Gaidarenko)Hell yeah! 3.0 is here. First and foremost we rewrote every... single... rule. We fixed a plentiful amount of bugs (most of which were found during refactoring those rules using CST). This provides us the opportunity to include autofix for complicated rules like the brand new disallowUnusedVariables
rule (see below).
If you aren't a plugin writer or support build extensions (like grunt or gulp), etc you don't have to worry about anything.
We didn't rename/remove any rules. All you should have to do to update is just bump the jscs
version in your package
version to 3.0.0
and be done with it.
These following config options have been replaced in 3.0:
--esnext
(-e) // enabled by default--esprima
(-s) and --esprimaOptions
// babylon is the underlying CST parser--verbose
// also enabled by default to show rule name when there is an errorOne thing to notice: the yandex
preset was removed. Since Yandex doesn't have official code style (don't look at the https://github.com/ymaps/codestyle), we were requested to remove it
One drawback from all these changes is that JSCS might be a little, just a little slower, so if you find any issues related to that - don't hesitate to drop us a line, or just drop us a line since we are all friendly :).
Since this release is about rewrite of internal design, we adding only four new rules (all of them were added by our contributors!).
disallowUnusedVariables](http://jscs.info/rule/disallowUnusedVariables
) by Brian SchempThat rule useful when you have var x = <whatever>
and you don't export that x
and don't use it. This rule will highlight that and remove it if you want.
disallowSpacesInsideImportedObjectBraces](http://jscs.info/rule/disallowSpacesInsideImportedObjectBraces
) and [requireSpacesInsideImportedObjectBraces](http://jscs.info/rule/requireSpacesInsideImportedObjectBraces
) by Maks SadowskyWhen you need or don't need additional parentheses -
import /*–>*/{foo, bar}/*<–*/ from 'foo-bar';
requireUseStrict](http://jscs.info/rule/requireUseStrict
) Erik VoldShort and cool - ask you to use "use strict"
pragma on top of the file if you so desire.
requireImportsAlphabetized](http://jscs.info/rule/requireImportsAlphabetized
) by Ray HammondKeeps your imports alphabetized, pretty handy way to keep your dependency in tidy state.
requireSpaceBeforeObjectValues
rule to airbnb preset (Oleg Gaidarenko)requireSpacesInsideImportedObjectBraces
to airbnb (Maks Sadowsky)There are a lot of internal changes but we like to keep this changelog short and tidy. We will continue to update this shortly.
Spring release! Yeah, yeah, technically spring only comes in middle of the March (you nerds, you), but we're coming to you a bit earlier!
Anyways, there are three new rules, a couple of changes for the airbnb
preset and important fixes for disallowSpacesInsideTemplateStringPlaceholders
and validateQuoteMarks
(for all you ES7 lovers).
requireSpaceBeforeDestructuredValues
by Maks SadowskyEnforces colon spacing after destructuring assignment i.e. requireSpaceBeforeObjectValues
but for destructuring.
// good
const { String: EmberString } = Ember;
// bad
const { String:EmberString } = Ember;
disallowArrayDestructuringReturn
by Maks SadowskyEnforces the 5:3 verse of airbnb code style, which prohibits use of array destructuring for thy CallExpressions
.
// God is on your side
const { left, right } = processInput(input);
// Devil is on your shoulder!
const [left, __, top] = processInput(input);
requireNewlineBeforeSingleStatementsInIf
by Brian SchempEnforces using newlines in your parenthesesless code.
// Cool stairs brah
if (x)
doX();
else
doY();
// Just how could you have "X" and "Y"'s on the same line?!
if (x) doX();
else doY();
requireCamelCaseOrUpperCaseIdentifiers
in airbnb (Oleg Gaidarenko)disallowArrayDestructuringReturn
to airbnb preset (Maks Sadowsky)disallowSpacesInsideTemplateStringPlaceholders
: check template literal (ikokostya)validateQuoteMarks
: do not throw on es7 decorators (Oleg Gaidarenko)Other commits (as always) are omitted, since they're all about internal stuff and we care about your viewing pleasure.