JSCS v3.0.0 Release Notes

Release Date: 2016-04-14 // about 8 years ago
  • ๐Ÿ”– Version 3.0.0 (2016-04-14):

    ๐Ÿ”จ 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).

    ๐Ÿ’ฅ Breaking Changes

    ๐Ÿ— 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.

    ๐Ÿ”ง Configuration

    These following config options have been replaced in 3.0:

    • 0๏ธโƒฃ --esnext (-e) // enabled by default
    • ๐Ÿ“œ --esprima (-s) and --esprimaOptions // babylon is the underlying CST parser
    • 0๏ธโƒฃ --verbose // also enabled by default to show rule name when there is an error

    ๐Ÿ’… One 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 :).

    ๐Ÿ†• New rules

    ๐Ÿš€ Since this release is about rewrite of internal design, we adding only four new rules (all of them were added by our contributors!).

    `disallowUnusedVariables by Brian Schemp

    ๐Ÿšš That 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 and `requireSpacesInsideImportedObjectBraces by Maks Sadowsky

    When you need or don't need additional parentheses -

    import /\*โ€“\>\*/{foo, bar}/\*\<โ€“\*/ from 'foo-bar';
    

    `requireUseStrict Erik Vold

    Short and cool - ask you to use "use strict" pragma on top of the file if you so desire.

    `requireImportsAlphabetized by Ray Hammond

    Keeps your imports alphabetized, pretty handy way to keep your dependency in tidy state.

    Presets

    • Preset: allow URLs inside comments for airbnb (andreyvolokitin)
    • Preset: add requireSpaceBeforeObjectValues rule to airbnb preset (Oleg Gaidarenko)
    • Preset: add requireSpacesInsideImportedObjectBraces to airbnb (Maks Sadowsky)
    • Preset: Add 'requireSpaceBetweenArguments' to google preset (Jon Merrifield)

    Internal

    โšก๏ธ There are a lot of internal changes but we like to keep this changelog short and tidy. We will continue to update this shortly.