Skip to content

Commit

Permalink
Update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 28, 2015
1 parent 935590c commit 3dae2f7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
31 changes: 23 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,49 @@

"rules": {
"accessor-pairs": [2, { getWithoutSet: false, setWithoutGet: true }],
"array-bracket-spacing": [2, "never", {
"singleValue": false,
"objectsInArrays": false,
"arraysInArrays": false
}],
"block-scoped-var": [0],
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"camelcase": [2],
"comma-dangle": [2, "never"],
"comma-spacing": [2],
"comma-style": [2, "last"],
"complexity": [0, 11],
"complexity": [2, 10],
"computed-property-spacing": [2, "never"],
"consistent-return": [2],
"consistent-this": [0, "that"],
"constructor-super": [2],
"curly": [2, "all"],
"default-case": [2],
"dot-notation": [2, { "allowKeywords": true }],
"eol-last": [2],
"eqeqeq": [2],
"func-names": [0],
"func-style": [2, "expression"],
"generator-star-spacing": [2, "after"],
"generator-star-spacing": [2, { "before": false, "after": true }],
"global-strict": [0, "never"],
"guard-for-in": [0],
"handle-callback-err": [0],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"linebreak-style": [2, "unix"],
"lines-around-comment": [2, { "beforeBlockComment": false, "afterBlockComment": false, "beforeLineComment": false, "beforeLineComment": false }],
"lines-around-comment": [2, {
"beforeBlockComment": false,
"afterBlockComment": false,
"beforeLineComment": false,
"beforeLineComment": false,
"allowBlockStart": true,
"allowBlockEnd": true
}],
"quotes": [2, "single", "avoid-escape"],
"max-depth": [0, 4],
"max-depth": [2, 4],
"max-len": [0, 80, 4],
"max-nested-callbacks": [0, 2],
"max-params": [0, 3],
"max-statements": [0, 10],
"max-nested-callbacks": [2, 3],
"max-params": [2, 3],
"max-statements": [2, 20],
"new-parens": [2],
"new-cap": [2],
"newline-after-var": [0],
Expand Down Expand Up @@ -111,7 +124,7 @@
"no-regex-spaces": [2],
"no-reserved-keys": [2],
"no-restricted-modules": [0],
"no-return-assign": [2],
"no-return-assign": [2, "always"],
"no-script-url": [2],
"no-self-compare": [0],
"no-sequences": [2],
Expand All @@ -122,12 +135,14 @@
"no-sparse-arrays": [2],
"no-sync": [0],
"no-ternary": [0],
"no-this-before-super": [2],
"no-throw-literal": [2],
"no-trailing-spaces": [2, { "skipBlankLines": false }],
"no-undef": [2],
"no-undef-init": [2],
"no-undefined": [0],
"no-underscore-dangle": [2],
"no-unexpected-multiline": [2],
"no-unneeded-ternary": [2],
"no-unreachable": [2],
"no-unused-expressions": [2],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tape": "^4.0.0",
"covert": "^1.1.0",
"jscs": "^1.13.1",
"eslint": "^0.23.0"
"eslint": "^0.24.0"
},
"licenses": [
{
Expand Down
11 changes: 5 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,19 @@ test('without a context', function (t) {
});

t.test('called as a constructor', function (st) {
var thunkify = function (value) {
return function () { return value; };
};
st.test('returns object value', function (sst) {
var expectedReturnValue = [1, 2, 3];
var Constructor = functionBind.call(function () {
return expectedReturnValue;
}, null);
var Constructor = functionBind.call(thunkify(expectedReturnValue), null);
var result = new Constructor();
sst.equal(result, expectedReturnValue);
sst.end();
});

st.test('does not return primitive value', function (sst) {
var Constructor = functionBind.call(function () {
return 42;
}, null);
var Constructor = functionBind.call(thunkify(42), null);
var result = new Constructor();
sst.notEqual(result, 42);
sst.end();
Expand Down

0 comments on commit 3dae2f7

Please sign in to comment.