jscs v2.10.0 Release Notes

Release Date: 2016-02-15 // about 8 years ago
  • Happy Presidents Day!

    🚀 In this release, it's just some additional rules to update to the airbnb preset, new rules, and fixes.

    Preset Changes

    • ➕ Add maximumLineLength to the airbnb preset (reference) (Oleg Gaidarenko)
    • ➕ Add disallowSpacesInsideTemplateStringPlaceholders to the airbnb preset (not explicit but used in examples) (Oleg Gaidarenko)
    • ➕ Add disallowNewlineBeforeBlockStatements rule to the mdcs preset (reference) (Mauricio Massaia)

    🆕 New Rules

    disallowSpacesInsideTemplateStringPlaceholders

    (ikokostya)

    Disallows spaces before and after curly brace inside template string placeholders.

    // usage in config
    "disallowSpacesInsideTemplateStringPlaceholders": true
    
    // Valid
    `Hello ${name}!`
    
    // Invalid
    `Hello ${ name}!`
    `Hello ${name }!`
    `Hello ${ name }!`
    

    requireImportsAlphabetized (Ray Hammond)

    Requires imports to be alphabetized

    // usage in config
    "requireImportAlphabetized": true
    
    // Valid
    import a from 'a';
    import c from 'c';
    import z from 'z';
    
    // Invalid
    import a from 'a';
    import z from 'z';
    import c from 'c';
    

    ⚡️ Rule Updates

    • 0️⃣ requireSpaceBeforeKeywords: add a allExcept option for filtering out default keywords (gpiress)
      • This allows you do specify exceptions to the all keywords instead of creating an array of whitelisted keywords when you only want to blacklist a few.

    🐛 Bug fixes

    • requireNumericLiterals: miss if first argument is an Identifier (Robert Jackson)
    • disallowSpacesInsideTemplateStringPlaceholders: skip the edge case (Oleg Gaidarenko)
    • requirePaddingNewLinesBeforeExport: exclude if only statement in block (Brian Schemp)
    • maximumLineLength: some nodes might contain null values (Oleg Gaidarenko)

    📄 Docs

    • Correct date in the changelog (Oleg Gaidarenko)
    • Various rule corrections (Christopher Cook)