JSCS v1.12.0 Release Notes

  • Overview

    ๐Ÿ— Ladies and Gentlemen... Elvis is in the building - auto-fixing is finally here! We were working really hard to make this powerful new feature, and to make it right. We're hoping it will truly help make your code look good.

    ๐Ÿ‘ Auto-fixing supports the EOF rule and all rules related to spacing, including validateIndentation which is the most complicated rule we have (big thanks to @mikesherov for making that happen).

    Although this chunk of rules covers most of the popular use-cases, we're determine to add more rules to this list, please help us out and report any bugs or consider contributing with some code - http://jscs.info/contributing.html. We're really friendly to every new contributor.

    Apart from auto-fixing, there are six new rules โ€“ fresh out of the oven. Special thanks goes to @lahmatiy, who had the patience and perseverance to implement requireSemicolons.

    ๐Ÿš€ Because of tireless efforts of @hzoo, we're adding two new presets in this release - node-style-guide and wordpress. They have pretty consistent style guides... try it out; They are a breeze to work with.

    ๐Ÿš€ We're very grateful to everyone who helped out with this release, especially to @TheSavior who helped review the pull requests and shape out our API.

    โšก๏ธ Preset updates

    • ๐Ÿšš Preset: remove "requireMultipleVarDecl" rule from jquery preset (Oleg Gaidarenko)
    • Preset: wordpress (Henry Zhu)
    • Preset: Add "requireSemicolons" rule to the Yandex preset (ikokostya)
    • Preset: Add validate indentation rule for Yandex (Gunnar Lium)
    • ๐Ÿ’… Preset: node-style-guide (Henry Zhu)
    • โšก๏ธ Preset: update airbnb preset (Eli White)
    • Preset: require blank line before all line comments for jQuery preset (Eli White)
    • โœ… Preset: Add "requireSpaceBeforeObjectValues" to crockford test (Jackson Ray Hamilton)

    Auto-fixing

    • validateIndentation: autofixing! (Mike Sherov)
    • TokenAssert: only fix lines when comments do not exist between tokens (Mike Sherov)
    • disallowMultipleLineString: do not yet allow autofixing, which is a non-whitespace change (Mike Sherov)
    • disallowSemicolons: do not yet allow autofixing, which is a non-whitespace change (Mike Sherov)
    • Autofixing: add more rules to use assertion framework (Henry Zhu)
    • Autofixing: make most rules use assertion framework when possible (Eli White)
    • Autofixing: initial implementation (mdevils)
    • Autofixing: token data (mdevils)

    ๐Ÿ†• New rules

    • ๐Ÿ†• New Rule: requireSemicolons (Roman Dvornov)
    • ๐Ÿ†• New Rule: disallowMultipleSpaces (Todd Wolfson)
    • ๐Ÿ†• New Rule: disallowIdentifierNames (alawatthe)
    • ๐Ÿ†• New Rule: requirePaddingNewLineAfterVariableDeclaration (Evan Jacobs)
    • ๐Ÿ†• New Rule: requireDollarBeforejQueryAssignment (Eli White)
    • ๐Ÿ†• New Rules: (disallow/require)PaddingNewLinesBeforeLineComments (Eli White)

    Rule Values

    • requireCapitalizedComments: Add allExcept option (Ash Clarke)

    ๐Ÿ”ง Auto-configuration

    • ๐Ÿ”ง Auto-Configuration: show error count when handling violated rules (fubu)
    • ๐Ÿ”ง Auto-Configuration: show number of violated rules (fubu)

    CLI

    • CLI: simplify and increase coverage of "cli-config" module (Oleg Gaidarenko)
    • CLI: increase coverage of the "cli" module (Oleg Gaidarenko)

    ๐Ÿ› Bug fixes

    • ๐Ÿ›  (require|disallow)spacesIn*: add more invalid examples and fixes for rules (Henry Zhu)
    • disallowSpacesInsideArrayBrackets: fix error messages (Henry Zhu)
    • requireSpacesInsideArrayBrackets: comments should be also taken into account (gero3)
    • disallowSpaceBeforeBinaryOperators: comments are allowed (gero3)
    • ๐Ÿ‘ป requireLineBreakAfterVariableAssignment: allow exception for init part of for loop (Henry Zhu)
    • (require|disallow)SpacesInsideArrayBrackets: use includeComments in token (Henry Zhu)
    • ๐Ÿšš disallowAnonymousFunctions: remove errant "s" from error message (James Chin)
    • disallowDanglingUnderscores: Corrected rule name in assert message (Oswald Maskens)
    • ๐Ÿ“œ Parsing: Extend estraverse rules to support both XJS and JSX (Henry Zhu)
    • (disallow/require)PaddingNewLinesAfterBlocks: Ignoring the end of files (Eli White)
    • ๐Ÿ‘ป requirePaddingNewLinesBeforeLineComments: Allow consecutive comments and firstAfterCurly exception (Eli White)

    Misc

    • disallowSpacesInsideParentheses: fix es6 template literal token issues (Mike Sherov)
    • RequireAlignedObjectValues: use assertions (Mike Sherov)
    • DisallowMultipleLineBreaks: use assertions (Mike Sherov)
    • ๐Ÿšš Tests: Move to spec folder (Joel Kemp)
    • โœ… Tests: Adding some more fix tests (Eli White)
    • ๐Ÿšš Tests: move specs into a subdir so that tests, fixtures, and utilities aren't intermingled (Mike Sherov)
    • โšก๏ธ Misc: update dependencies (Oleg Gaidarenko)
    • JsFile: Make getTokens include comments (Eli White)
    • โœ… Assertions: Add fixing tests to several rules (Eli White)
    • โœ… Assertions: add tests for linesBetween (Mike Sherov)
    • ๐Ÿ›  Assertions: Make sure newlines get fixed (gero3)
    • ๐Ÿšš TokenAssert: remove newline fixing logic duplication to prepare for further fixes (Mike Sherov)
    • TokenAssert: simplify and strengthen linesBetween rules (Mike Sherov)
    • Token Assert: normalize whiteSpace assertions to match line assertions (Mike Sherov)
    • requireLineFeedAtFileEnd: make use of assert (gero3)
    • Don't trim whitespace in markdown-files (Simen Bekkhus)
    • Cleanup: use this.getOptionName() for consistency, options variable (Henry Zhu)
    • Cleanup: use iterateTokensByTypeAndValue where appropriate (Mike Sherov)
    • ๐Ÿšš Cleanup: remove archaic functions from JsFile (Mike Sherov)
    • ๐Ÿšš Cleanup: remove usage of getComment(After|Before)Token (Mike Sherov)
    • ๐Ÿšš Cleanup: remove redundant boolean check, use consistent error messages (Henry Zhu)
    • Cleanup: use iterateTokensByTypeAndValue and this.getOptionName() (Henry Zhu)
    • requireSpaceAfterKeywords: use token assert (Henry Zhu)
    • JsFile::getFirstTokenOnLine implementation (for indentation rules) (mdevils)
    • ๐Ÿ“ฆ Replaces the 'colors' and 'supports-colors' packages with 'chalk'. (Joshua Appelman)
    • ๐Ÿ›  Fix various doc typos (Jรฉrรฉmie Astori)
    • requirePaddingNewLinesAfterBlockDeclarations / disallowPaddingNewLinesAfterBlockDeclarations Adding an option to specify lines for errors.assert.differentLine (Eli White)
    • ๐Ÿ›  JsFile: add getLineBreaks function to support future whitespace fixes (Mike Sherov)
    • Appveyor: freeze node version to 0.12.x (Alexej Yaroshevich)
    • requireCapitalizedComments: automatically except jscs comments (James Reggio)

    ๐Ÿ“„ Docs

    • ๐Ÿ“„ Docs: Change "Values" and "Types" to grammatically correct forms (Shmavon Gazanchyan)
    • ๐Ÿ“„ Docs: add reporter (sanemat)
    • ๐Ÿ“„ Docs: less.js uses jscs (Bass Jobsen)
    • ๐Ÿ“„ Docs: added Goodvidio to the list of adopters (Adonis K)
    • ๐Ÿ›  Fix types and descriptions in documentation (Shmavon Gazanchyan)