Skip to content

Commit

Permalink
[Dev Deps] update tape, jscs, nsp, semver, eslint, `@ljharb…
Browse files Browse the repository at this point in the history
…/eslint-config`
  • Loading branch information
ljharb committed Jan 10, 2017
1 parent d1853ad commit 45e17bd
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 17 deletions.
62 changes: 57 additions & 5 deletions .jscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@

"disallowIdentifierNames": [],

"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"requireCurlyBraces": {
"allExcept": [],
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
},

"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],

"disallowSpaceAfterKeywords": [],

"disallowSpaceBeforeComma": true,
"disallowSpaceAfterComma": false,
"disallowSpaceBeforeSemicolon": true,

"disallowNodeTypes": [
Expand All @@ -27,7 +31,7 @@
"WithStatement"
],

"requireObjectKeysOnNewLine": true,
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },

"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
Expand All @@ -41,7 +45,7 @@

"disallowSpacesInsideArrayBrackets": true,

"disallowQuotedKeysInObjects": "allButReserved",
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },

"disallowSpaceAfterObjectKeys": true,

Expand Down Expand Up @@ -76,7 +80,7 @@

"disallowMultipleLineStrings": true,

"requireDotNotation": true,
"requireDotNotation": { "allExcept": ["keywords"] },

"requireParenthesesAroundIIFE": true,

Expand Down Expand Up @@ -119,6 +123,54 @@

"disallowArrowFunctions": true,

"validateOrderInObjectKeys": "asc-insensitive"
"disallowMultiLineTernary": true,

"validateOrderInObjectKeys": "asc-insensitive",

"disallowIdenticalDestructuringNames": true,

"disallowNestedTernaries": { "maxLevel": 1 },

"requireSpaceAfterComma": { "allExcept": ["trailing"] },
"requireAlignedMultilineParams": false,

"requireSpacesInGenerator": {
"afterStar": true
},

"disallowSpacesInGenerator": {
"beforeStar": true
},

"disallowVar": false,

"requireArrayDestructuring": false,

"requireEnhancedObjectLiterals": false,

"requireObjectDestructuring": false,

"requireEarlyReturn": false,

"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},

"requireImportAlphabetized": false,

"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,

"disallowSpacesInsideTemplateStringPlaceholders": true,

"disallowArrayDestructuringReturn": false,

"requireNewlineBeforeSingleStatementsInIf": false,

"disallowUnusedVariables": true,

"requireSpacesInsideImportedObjectBraces": true,

"requireUseStrict": true
}

16 changes: 11 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
'use strict';

var toStr = Object.prototype.toString;
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('x') === 'symbol';

if (hasSymbols) {
var symToStr = Symbol.prototype.toString;
var symStringRegex = /^Symbol\(.*\)$/;
var isSymbolObject = function isSymbolObject(value) {
if (typeof value.valueOf() !== 'symbol') { return false; }
var isSymbolObject = function isRealSymbolObject(value) {
if (typeof value.valueOf() !== 'symbol') {
return false;
}
return symStringRegex.test(symToStr.call(value));
};

module.exports = function isSymbol(value) {
if (typeof value === 'symbol') { return true; }
if (toStr.call(value) !== '[object Symbol]') { return false; }
if (typeof value === 'symbol') {
return true;
}
if (toStr.call(value) !== '[object Symbol]') {
return false;
}
try {
return isSymbolObject(value);
} catch (e) {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "npm run jscs && npm run eslint",
"jscs": "jscs *.js */*.js",
"eslint": "eslint *.js */*.js",
"security": "nsp package"
"security": "nsp check"
},
"repository": {
"type": "git",
Expand All @@ -29,13 +29,13 @@
},
"dependencies": {},
"devDependencies": {
"tape": "^4.2.0",
"tape": "^4.6.3",
"covert": "^1.1.0",
"jscs": "^2.1.1",
"nsp": "^1.1.0",
"semver": "^5.0.3",
"eslint": "^1.5.1",
"@ljharb/eslint-config": "^1.2.0"
"jscs": "^3.0.7",
"nsp": "^2.6.2",
"semver": "^5.3.0",
"eslint": "^3.13.1",
"@ljharb/eslint-config": "^9.0.1"
},
"testling": {
"files": "test/index.js",
Expand Down
7 changes: 7 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
"max-statements-per-line": [2, { "max": 2 }],
"no-restricted-properties": 0,
"symbol-description": 0,
}
}

0 comments on commit 45e17bd

Please sign in to comment.