Skip to content

Commit 8472b90

Browse files
committed
[Dev Deps] update eslint, @ljharb/eslint-config, is, jscs, nsp, semver, tape
1 parent 6e97a21 commit 8472b90

File tree

4 files changed

+73
-18
lines changed

4 files changed

+73
-18
lines changed

.jscs.json

+55-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99

1010
"disallowIdentifierNames": [],
1111

12-
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
12+
"requireCurlyBraces": {
13+
"allExcept": [],
14+
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
15+
},
1316

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

1619
"disallowSpaceAfterKeywords": [],
1720

1821
"disallowSpaceBeforeComma": true,
22+
"disallowSpaceAfterComma": false,
1923
"disallowSpaceBeforeSemicolon": true,
2024

2125
"disallowNodeTypes": [
@@ -27,7 +31,7 @@
2731
"WithStatement"
2832
],
2933

30-
"requireObjectKeysOnNewLine": false,
34+
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
3135

3236
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
3337
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
@@ -41,7 +45,7 @@
4145

4246
"disallowSpacesInsideArrayBrackets": true,
4347

44-
"disallowQuotedKeysInObjects": "allButReserved",
48+
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },
4549

4650
"disallowSpaceAfterObjectKeys": true,
4751

@@ -76,7 +80,7 @@
7680

7781
"disallowMultipleLineStrings": true,
7882

79-
"requireDotNotation": true,
83+
"requireDotNotation": { "allExcept": ["keywords"] },
8084

8185
"requireParenthesesAroundIIFE": true,
8286

@@ -121,6 +125,52 @@
121125

122126
"disallowMultiLineTernary": true,
123127

124-
"validateOrderInObjectKeys": "asc-insensitive"
128+
"validateOrderInObjectKeys": "asc-insensitive",
129+
130+
"disallowIdenticalDestructuringNames": true,
131+
132+
"disallowNestedTernaries": { "maxLevel": 1 },
133+
134+
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
135+
"requireAlignedMultilineParams": false,
136+
137+
"requireSpacesInGenerator": {
138+
"afterStar": true
139+
},
140+
141+
"disallowSpacesInGenerator": {
142+
"beforeStar": true
143+
},
144+
145+
"disallowVar": false,
146+
147+
"requireArrayDestructuring": false,
148+
149+
"requireEnhancedObjectLiterals": false,
150+
151+
"requireObjectDestructuring": false,
152+
153+
"requireEarlyReturn": false,
154+
155+
"requireCapitalizedConstructorsNew": {
156+
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
157+
},
158+
159+
"requireImportAlphabetized": false,
160+
161+
"requireSpaceBeforeObjectValues": true,
162+
"requireSpaceBeforeDestructuredValues": true,
163+
164+
"disallowSpacesInsideTemplateStringPlaceholders": true,
165+
166+
"disallowArrayDestructuringReturn": false,
167+
168+
"requireNewlineBeforeSingleStatementsInIf": false,
169+
170+
"disallowUnusedVariables": true,
171+
172+
"requireSpacesInsideImportedObjectBraces": true,
173+
174+
"requireUseStrict": true
125175
}
126176

index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
var getDay = Date.prototype.getDay;
4-
var tryDateObject = function tryDateObject(value) {
4+
var tryDateObject = function tryDateGetDayCall(value) {
55
try {
66
getDay.call(value);
77
return true;
@@ -15,6 +15,8 @@ var dateClass = '[object Date]';
1515
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
1616

1717
module.exports = function isDateObject(value) {
18-
if (typeof value !== 'object' || value === null) { return false; }
18+
if (typeof value !== 'object' || value === null) {
19+
return false;
20+
}
1921
return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
2022
};

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lint": "npm run jscs && npm run eslint",
1515
"jscs": "jscs test.js *.js",
1616
"eslint": "eslint test.js *.js",
17-
"security": "nsp package"
17+
"security": "nsp check"
1818
},
1919
"repository": {
2020
"type": "git",
@@ -29,16 +29,16 @@
2929
],
3030
"dependencies": {},
3131
"devDependencies": {
32+
"@ljharb/eslint-config": "^12.2.1",
33+
"covert": "^1.1.0",
34+
"eslint": "^4.8.0",
3235
"foreach": "^2.0.5",
33-
"is": "^3.1.0",
34-
"tape": "^4.2.1",
3536
"indexof": "^0.0.1",
36-
"covert": "^1.1.0",
37-
"jscs": "^2.2.1",
38-
"nsp": "^1.1.0",
39-
"eslint": "^1.6.0",
40-
"@ljharb/eslint-config": "^1.3.0",
41-
"semver": "^5.0.3"
37+
"is": "^3.2.1",
38+
"jscs": "^3.0.7",
39+
"nsp": "^2.8.1",
40+
"semver": "^5.4.1",
41+
"tape": "^4.8.0"
4242
},
4343
"testling": {
4444
"files": "test.js",

test.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var test = require('tape');
44
var isDate = require('./');
5-
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
5+
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('') === 'symbol';
66

77
test('not Dates', function (t) {
88
t.notOk(isDate(), 'undefined is not Date');
@@ -21,7 +21,10 @@ test('not Dates', function (t) {
2121

2222
test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) {
2323
var realDate = new Date();
24-
var fakeDate = { toString: function () { return String(realDate); }, valueOf: function () { return realDate.getTime(); } };
24+
var fakeDate = {
25+
toString: function () { return String(realDate); },
26+
valueOf: function () { return realDate.getTime(); }
27+
};
2528
fakeDate[Symbol.toStringTag] = 'Date';
2629
t.notOk(isDate(fakeDate), 'fake Date with @@toStringTag "Date" is not Date');
2730
t.end();

0 commit comments

Comments
 (0)