This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
v2.9.0
Version 2.9.0 (2015-01-23):
Changed the changelog date format to be YYYY-MM-DD.
Whoo a release during this blizzard! Hopefully, this will be our last release before we start pushing out pre-release versions of 3.0. (If necessary, we can push bug fixes to 2.x)
The plan:
- Push the
2.9.0
release - Create a
2.x
branch off ofmaster
- Switch
master
to be the3.0
branch - Merge in 2.x changes + cleanup stuff for a 3.0 alpha release.
- Do what we can in our 3.0 milestone. We would really appreciate any help!
- Especially for deprecating rules/options, rule merging, renames/inconsistencies that we don't catch.
New Rules
requireCapitalizedConstructorsNew
(Alexander O'Mara)
// Description: Requires capitalized constructors to to use the `new` keyword
// Usage
"requireCapitalizedConstructors": {
"allExcept": ["somethingNative"]
}
// Valid
var x = new Y();
var x = new somethingNative(); // exception
// Invalid
var x = Y();
Rule Updates
validateNewlineAfterArrayElements
: add autofix support for this rule (Joeri de Gooijer)
// can turn
var a = [0,
1,
2];
// into
var a = [
0,
1,
2
];
This was @joerideg's first PR, so congrats and hope to see more contributions (not necessarily here)!
I think we would need a seperate rule to both check/fix alignment properly.
requireSemicolons
: account for stage-2ClassProperty
(Henry Zhu)
class A {
prop; // will add a semicolon here
prop2 = 1; // and here
}
requireCamelCaseOrUpperCaseIdentifiers
: add extra optionsallowedPrefixes, allowedSuffixes, allExcept
- This lets you specify a permitted array of String, RegExp, or ESTree RegExpLiteral values
For options: { allowedSuffixes: ["_dCel", {regex:{pattern:"_[kMG]?Hz"}}] }
// Extra valid options
var camelCase_dCel = 5;
var _camelCase_MHz = 6;
// Invalid
var camelCase_cCel = 4;
var CamelCase_THz = 5;
requireNewlineBeforeBlockStatements
,disallowNewlineBeforeBlockStatements
: account forSwitchStatement
// Valid for requireNewlineBeforeBlockStatements
switch (a)
{
case 1: break;
}
// Valid for disallowNewlineBeforeBlockStatements
switch (a) {
case 1: break;
}
Presets
airbnb
: Enforce rule 25.1 (Joe Bartlett)- This adds
requireDollarBeforejQueryAssignment
- This adds
airbnb
: Enforce rule 7.11 (Joe Bartlett)- This fixes up function spacing issues (autofixable)
google
: Enforce naming rules- This adds
"requireCamelCaseOrUpperCaseIdentifiers": { "allowedPrefixes": ["opt_"], "allExcept": ["var_args"] }
- This adds
Bug Fixes
requireEnhancedObjectLiterals
: Don't error for computed properties (Henry Zhu)requireTemplateStrings
: should not report string to binary (Oleg Gaidarenko)requireVarDeclFirst
: be aware of the comments (Kushan Joshi)
Misc
OVERVIEW.md
: add the Visual Studio Code extension to list of "Friendly Packages" (Tyler Hughes)