Skip to content

Commit

Permalink
Update eslint, nsp
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 2, 2015
1 parent 1eb3424 commit a1b6388
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 24 deletions.
36 changes: 27 additions & 9 deletions .eslintrc
Expand Up @@ -9,35 +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, 2],
"max-statements": [2, 10],
"new-parens": [2],
"new-cap": [2],
"newline-after-var": [0],
Expand Down Expand Up @@ -110,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 @@ -121,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 All @@ -142,6 +158,7 @@
"operator-assignment": [0, "always"],
"operator-linebreak": [2, "none"],
"padded-blocks": [0],
"prefer-const": [0],
"quote-props": [0],
"radix": [0],
"semi": [2],
Expand All @@ -162,6 +179,7 @@
"space-infix-ops": [2],
"space-return-throw-case": [2],
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [2, "always"],
"spaced-line-comment": [0, "always"],
"strict": [0],
"use-isnan": [2],
Expand All @@ -170,6 +188,6 @@
"vars-on-top": [0],
"wrap-iife": [2],
"wrap-regex": [2],
"yoda": [2, "never", { "exceptRange": true }]
"yoda": [2, "never", { "exceptRange": true, "onlyEquality": false }]
}
}
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -38,8 +38,8 @@
"covert": "^1.1.0",
"jscs": "^1.13.1",
"editorconfig-tools": "^0.1.1",
"nsp": "^1.0.1",
"eslint": "^0.22.1",
"nsp": "^1.0.3",
"eslint": "^0.24.0",
"semver": "^4.3.6",
"replace": "^0.3.0"
},
Expand Down
34 changes: 21 additions & 13 deletions test.js
Expand Up @@ -5,19 +5,27 @@ var isBoolean = require('./');
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';

test('not Booleans', function (t) {
t.notOk(isBoolean(), 'undefined is not Boolean');
t.notOk(isBoolean(null), 'null is not Boolean');
t.notOk(isBoolean(0), '0 is not Boolean');
t.notOk(isBoolean(Object(42)), 'number object is not Boolean');
t.notOk(isBoolean(NaN), 'NaN is not Boolean');
t.notOk(isBoolean(Infinity), 'Infinity is not Boolean');
t.notOk(isBoolean('foo'), 'string is not Boolean');
t.notOk(isBoolean([]), 'array is not Boolean');
t.notOk(isBoolean({}), 'object is not Boolean');
t.notOk(isBoolean(function () {}), 'function is not Boolean');
t.notOk(isBoolean(/a/g), 'regex literal is not Boolean');
t.notOk(isBoolean(new RegExp('a', 'g')), 'regex object is not Boolean');
t.notOk(isBoolean(new Date()), 'new Date() is not Boolean');
t.test('primitives', function (st) {
st.notOk(isBoolean(), 'undefined is not Boolean');
st.notOk(isBoolean(null), 'null is not Boolean');
st.notOk(isBoolean(0), '0 is not Boolean');
st.notOk(isBoolean(NaN), 'NaN is not Boolean');
st.notOk(isBoolean(Infinity), 'Infinity is not Boolean');
st.notOk(isBoolean('foo'), 'string is not Boolean');
st.end();
});

t.test('objects', function (st) {
st.notOk(isBoolean(Object(42)), 'number object is not Boolean');
st.notOk(isBoolean([]), 'array is not Boolean');
st.notOk(isBoolean({}), 'object is not Boolean');
st.notOk(isBoolean(function () {}), 'function is not Boolean');
st.notOk(isBoolean(/a/g), 'regex literal is not Boolean');
st.notOk(isBoolean(new RegExp('a', 'g')), 'regex object is not Boolean');
st.notOk(isBoolean(new Date()), 'new Date() is not Boolean');
st.end();
});

t.end();
});

Expand Down

0 comments on commit a1b6388

Please sign in to comment.